From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D20A2C352A4 for ; Wed, 12 Feb 2020 18:52:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9B3E2073C for ; Wed, 12 Feb 2020 18:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581533578; bh=s0rQQJgReY1pvJWTDvRS2Q9eLU7aX05/Am/N2h5REPM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=HQvo060JsWcgHT4qCtlgj/oOHtXP8GL0HHdv9DGbPfwxQrPrZmzCmcHZZ26kpBLTL a4PBxjqu05N/xJYIRLKwg6/5/W/lMA1C/5i7xGBN9etWKS8Qfv9pvWVreZFVjkUy+h n7bnt/yzmgKg1okiY7M/JYlhjNKKuBLNm0NeaMmY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728993AbgBLSw4 (ORCPT ); Wed, 12 Feb 2020 13:52:56 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34433 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728948AbgBLSw4 (ORCPT ); Wed, 12 Feb 2020 13:52:56 -0500 Received: by mail-ed1-f65.google.com with SMTP id r18so3666477edl.1 for ; Wed, 12 Feb 2020 10:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8S2w7jKfhj8nqr2BEN6cbFr7nckGF3MBI5pTAOk2Bgk=; b=E/vN3AE3iyzGDOzjrhIyYOh5wyK5H3COrkDAy4Yb/0fuIwlyf50yEW7S/x5cDf9tHW zWbCuDLoLaAGtRSBjikTyE8yY06byotE/cGEhEbxOklsxfNCa9G0PsCjeYAs62WP1DSa M2BG1IabKnVo1IvqnOENDDauUUlMg+SJyMK4U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8S2w7jKfhj8nqr2BEN6cbFr7nckGF3MBI5pTAOk2Bgk=; b=Rt9/Z7eOPTOvdlvBe/PjHygA8sJUPc4WNpDYFTtGPxzeQDwWttytHnA8swd6k2ViEb gndde7M2BPAw+dvhKH0AcTyFgnXIwPOvpBhXgU4GO/gLPSauGAYccSJS5GC6QV7xNk/V JIfaprEymSe1c+GR2vG7He45CGQKFtRjtIx+wbtu1ONbkBdbtzm8RIaY8fL9QcIdCMK0 bB7z2csZbAsBAkp50cSziNcHNeePa91WG+THTc9qTtKCwMsjHbuAtn2D0sZ2KngeGnbI I7Jvg6BFPJuQfB9VWw5c1YnXclPrmPWDZd4AY1WQBy00SCBayQLV1SW2Z6U9InOsPq9y OumQ== X-Gm-Message-State: APjAAAW3NBqzo5AzDluzWigSMMlcL/SRVfh3fI1qDLY4IEffET7adhIS /HM6ial7qdHF4zz4lo/wI176dSMVMis= X-Google-Smtp-Source: APXvYqz2YYUPTwgrL9FiB75EowOgglMyMdYnMoj9hKxXoKpr6z5+0gfGO0YfuP44up4EeSPTrhjCTQ== X-Received: by 2002:a05:6402:b59:: with SMTP id bx25mr12417752edb.5.1581533574078; Wed, 12 Feb 2020 10:52:54 -0800 (PST) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id dd20sm101018ejb.59.2020.02.12.10.52.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Feb 2020 10:52:53 -0800 (PST) Received: by mail-ed1-f45.google.com with SMTP id p23so3645205edr.5 for ; Wed, 12 Feb 2020 10:52:53 -0800 (PST) X-Received: by 2002:a2e:97cc:: with SMTP id m12mr8440902ljj.241.1581533122702; Wed, 12 Feb 2020 10:45:22 -0800 (PST) MIME-Version: 1.0 References: <20200210150519.538333-1-gladkov.alexey@gmail.com> <20200210150519.538333-8-gladkov.alexey@gmail.com> <87v9odlxbr.fsf@x220.int.ebiederm.org> <20200212144921.sykucj4mekcziicz@comp-core-i7-2640m-0182e6> <87tv3vkg1a.fsf@x220.int.ebiederm.org> In-Reply-To: <87tv3vkg1a.fsf@x220.int.ebiederm.org> From: Linus Torvalds Date: Wed, 12 Feb 2020 10:45:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances To: "Eric W. Biederman" Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov , Solar Designer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 12, 2020 at 7:01 AM Eric W. Biederman wrote: > > Fundamentally proc_flush_task is an optimization. Just getting rid of > dentries earlier. At least at one point it was an important > optimization because the old process dentries would just sit around > doing nothing for anyone. I'm pretty sure it's still important. It's very easy to generate a _ton_ of dentries with /proc. > I wonder if instead of invalidating specific dentries we could instead > fire wake up a shrinker and point it at one or more instances of proc. It shouldn't be the dentries themselves that are a freeing problem. They're being RCU-free'd anyway because of lookup. It's the proc_mounts list that is the problem, isn't it? So it's just fs_info that needs to be rcu-delayed because it contains that list. Or is there something else? Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances Date: Wed, 12 Feb 2020 10:45:06 -0800 Message-ID: References: <20200210150519.538333-1-gladkov.alexey@gmail.com> <20200210150519.538333-8-gladkov.alexey@gmail.com> <87v9odlxbr.fsf@x220.int.ebiederm.org> <20200212144921.sykucj4mekcziicz@comp-core-i7-2640m-0182e6> <87tv3vkg1a.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <87tv3vkg1a.fsf@x220.int.ebiederm.org> Sender: linux-fsdevel-owner@vger.kernel.org To: "Eric W. Biederman" Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet Ke List-Id: linux-api@vger.kernel.org On Wed, Feb 12, 2020 at 7:01 AM Eric W. Biederman wrote: > > Fundamentally proc_flush_task is an optimization. Just getting rid of > dentries earlier. At least at one point it was an important > optimization because the old process dentries would just sit around > doing nothing for anyone. I'm pretty sure it's still important. It's very easy to generate a _ton_ of dentries with /proc. > I wonder if instead of invalidating specific dentries we could instead > fire wake up a shrinker and point it at one or more instances of proc. It shouldn't be the dentries themselves that are a freeing problem. They're being RCU-free'd anyway because of lookup. It's the proc_mounts list that is the problem, isn't it? So it's just fs_info that needs to be rcu-delayed because it contains that list. Or is there something else? Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE90C352A4 for ; Wed, 12 Feb 2020 18:45:44 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 4F7E224680 for ; Wed, 12 Feb 2020 18:45:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="E/vN3AE3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F7E224680 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17798-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 9977 invoked by uid 550); 12 Feb 2020 18:45:37 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 9954 invoked from network); 12 Feb 2020 18:45:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8S2w7jKfhj8nqr2BEN6cbFr7nckGF3MBI5pTAOk2Bgk=; b=E/vN3AE3iyzGDOzjrhIyYOh5wyK5H3COrkDAy4Yb/0fuIwlyf50yEW7S/x5cDf9tHW zWbCuDLoLaAGtRSBjikTyE8yY06byotE/cGEhEbxOklsxfNCa9G0PsCjeYAs62WP1DSa M2BG1IabKnVo1IvqnOENDDauUUlMg+SJyMK4U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8S2w7jKfhj8nqr2BEN6cbFr7nckGF3MBI5pTAOk2Bgk=; b=mDiWsS1zbXumAtH6xw7daYDSB25pmcZ7QH8ouCX/beYtZOtm0nm2QXcN5SkLmlZzfM EYgGUR26ncUdqgjlkl8wsjeuTgY1U3KgHrPTG8I1F6keqoySGdOKXFPozMT4IukJ6s7N F5am+9XxRXj3n1JgMNQFmfiKwlqkQhWJ53AjinWw+wrp2NmeCcVFXM2wWqhz5+9hunFb 9/Byeo4DATd4szdZ8Oja1GXbLmcfOfEIXEYmHJahAt6e6op+ynanWMryrDp/QmQU/sP2 aj/vThST1PUXnuwCGLT6oUdP15HRnGBwF6NjGiATCfNkpX+uZ6z/Cn/bqmxJ4PDvuQHm a3wQ== X-Gm-Message-State: APjAAAVYuiuOjagQgKRZtj6ouXvQbcdmeE0cPg5np/J93ggRSJrTNeL0 /kV/5F3i8Y8AFYGX4bpKe4OtxbBW7fs= X-Google-Smtp-Source: APXvYqzAX6l3297axlS1lTYXG2/KJK8zs/9BAol15HKsqOLRe8T1CD8M0c0DqZ0ZoU31LpHSE6YBkQ== X-Received: by 2002:a05:6512:284:: with SMTP id j4mr7307015lfp.109.1581533124558; Wed, 12 Feb 2020 10:45:24 -0800 (PST) X-Received: by 2002:a2e:97cc:: with SMTP id m12mr8440902ljj.241.1581533122702; Wed, 12 Feb 2020 10:45:22 -0800 (PST) MIME-Version: 1.0 References: <20200210150519.538333-1-gladkov.alexey@gmail.com> <20200210150519.538333-8-gladkov.alexey@gmail.com> <87v9odlxbr.fsf@x220.int.ebiederm.org> <20200212144921.sykucj4mekcziicz@comp-core-i7-2640m-0182e6> <87tv3vkg1a.fsf@x220.int.ebiederm.org> In-Reply-To: <87tv3vkg1a.fsf@x220.int.ebiederm.org> From: Linus Torvalds Date: Wed, 12 Feb 2020 10:45:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances To: "Eric W. Biederman" Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov , Solar Designer Content-Type: text/plain; charset="UTF-8" On Wed, Feb 12, 2020 at 7:01 AM Eric W. Biederman wrote: > > Fundamentally proc_flush_task is an optimization. Just getting rid of > dentries earlier. At least at one point it was an important > optimization because the old process dentries would just sit around > doing nothing for anyone. I'm pretty sure it's still important. It's very easy to generate a _ton_ of dentries with /proc. > I wonder if instead of invalidating specific dentries we could instead > fire wake up a shrinker and point it at one or more instances of proc. It shouldn't be the dentries themselves that are a freeing problem. They're being RCU-free'd anyway because of lookup. It's the proc_mounts list that is the problem, isn't it? So it's just fs_info that needs to be rcu-delayed because it contains that list. Or is there something else? Linus