Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1050734ybv; Thu, 13 Feb 2020 14:48:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzfXuTy9jrHQkBFhDwDZoCdGD0p/m9rbVciXozOuBckMbN1tA6FLP+MyaPxY+EDIK+4Faqt X-Received: by 2002:aca:b1d5:: with SMTP id a204mr4480647oif.82.1581634119644; Thu, 13 Feb 2020 14:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581634119; cv=none; d=google.com; s=arc-20160816; b=C36iGOg/LoepTxheYc31Pgzf6JwuAzaJhd0VnuBpcToq0WqleZdjMkuirW19zqNS8F jnhmOYrr8MeSeO1vZj1zg8F+JLTRFGQ5rVpOOAdJSAKk8n9G/Di5rQKmBdazay4pBXkH I3Mh+CFr7bKtshWIwhxK7zFol6Fywd0ugmW5xBNJdSxczfdRvwT/mz/gkEpeYJDPdAvi 0imeW6Hqp1F6DW6oSWwNBelCGbM1YaQ1MAJQzO1T/+vl0iIJeu+jCijlARjjS/Mp6LPb wyJdHZ4rb2G2VUWFs509eSjTHk/oQ0sxo6hiXs09Xf/Wy1cZ2bFKnLapIPqFJ+k5KcdA iIRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rVdHJ1r/9FxJmwhDqRkVHSIn1Ry+lO3z+KpnaUuqwYk=; b=op8xshcgLtxcFFbs+gYkc2JKIRBi3ErZeHnkK1Z0Pd6wdrSFbPOcLLPB7kQn3w/Y/z nV2ntbOyW1Lqvp7ZXTUpVtalLdQluXEDWBvvqCiF5rXnBLhmZ6KGPdvSEpjhIlBSkqJp CCYFSvN9Jv95C8JV+TPBAevHUa7w5g+55gXqP2rjL2Uow7ZB/RoJ2J4OzedurnddstLe cb95vZFUOeda3r8Md90EZOFPTtAJjIUzoi6DF+OiFMPL0AKSDpPZ0bJaUnTuUJUYav8M gnMowNNhr8KODWnJj1nFzcbTa+3Y8vIZ714upbm9MgJYpkm+yplt2aUkHvINvnApHSq3 6W1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=dRYW8Mem; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l83si1733922oih.58.2020.02.13.14.48.27; Thu, 13 Feb 2020 14:48:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=dRYW8Mem; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727665AbgBMWsJ (ORCPT + 99 others); Thu, 13 Feb 2020 17:48:09 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41575 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbgBMWsJ (ORCPT ); Thu, 13 Feb 2020 17:48:09 -0500 Received: by mail-lj1-f193.google.com with SMTP id h23so8514175ljc.8 for ; Thu, 13 Feb 2020 14:48:08 -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=rVdHJ1r/9FxJmwhDqRkVHSIn1Ry+lO3z+KpnaUuqwYk=; b=dRYW8MemR37cE0uru6NTUES5Od7vEqzfZmb/KMY93QEjURoq6DE5QcXLZ6JJL9HB8V KfvM/ZKQbYsF7Zy+x1PnUgqdmV3x1lbxpWU+BFmhJglL6UqALgYvF3IltbUH8c3PxzFq KRLtkM5e8bHrUc0004IuGa/Hy6940Rjrv4zzw= 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=rVdHJ1r/9FxJmwhDqRkVHSIn1Ry+lO3z+KpnaUuqwYk=; b=TPsfmJYY3XsBpE2qb0LJZLq/eC+UvaX+mnCB/ijzgZB/fVazZywBjbbF2smo8o9yJl Y2ZwBKYiu5yk4nTYbaH9v//unzDRxqDPbYiH7lNsE5nmzZEma1harOipH95Ihu3q8bok qBls1BRRvjSBdLbX8Lu+vM0ysGCXh9r0DrP+Zg2mTqqAHTB+S6gV+j0kt1JSjQkMCt9g fB3/rYimOnWbyKfzPvax2yFHg/hXP4aIizK7LQHCHPoPgNfJwsrmkDe+plaxL/4cV/05 cYqlLrN6iCvSVuJGqRY7XX8I0rbscmmSbQ8iiSAf41YMeSfsZzTpJy0q7sTaK9gQGeiT 5aQw== X-Gm-Message-State: APjAAAXCMq6vIqt8QjEL+wujGqid6jOCt/HIGQT+UGYv2wZ7KrF5HOWJ sh9lQHYS9/BF8h6ERzh+7Krti41aPs4= X-Received: by 2002:a2e:8145:: with SMTP id t5mr58212ljg.144.1581634086996; Thu, 13 Feb 2020 14:48:06 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id m83sm2017565lfa.5.2020.02.13.14.48.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Feb 2020 14:48:05 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id w1so8527966ljh.5 for ; Thu, 13 Feb 2020 14:48:05 -0800 (PST) X-Received: by 2002:a2e:88c5:: with SMTP id a5mr35496ljk.201.1581634084790; Thu, 13 Feb 2020 14:48:04 -0800 (PST) MIME-Version: 1.0 References: <20200212200335.GO23230@ZenIV.linux.org.uk> <20200212203833.GQ23230@ZenIV.linux.org.uk> <20200212204124.GR23230@ZenIV.linux.org.uk> <87lfp7h422.fsf@x220.int.ebiederm.org> <87pnejf6fz.fsf@x220.int.ebiederm.org> <20200213055527.GS23230@ZenIV.linux.org.uk> <20200213222350.GU23230@ZenIV.linux.org.uk> In-Reply-To: <20200213222350.GU23230@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 13 Feb 2020 14:47:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances To: Al Viro Cc: "Eric W. Biederman" , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , 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 Thu, Feb 13, 2020 at 2:23 PM Al Viro wrote: > > I'd been thinking of ->d_fsdata pointing to a structure with list_head > and a (non-counting) task_struct pointer for those guys. Allocated > on lookup, of course (as well as readdir ;-/) and put on the list > at the same time. Hmm. That smells like potentially a lot of small allocations, and making readdir() even nastier. Do we really want to create the dentries at readdir time? We do now (with proc_fill_cache()) but do we actually _need_ to? I guess a lot of readdir users end up doing a stat on it immediately afterwards. I think right now we do it to get the inode number, and maybe that is a basic requirement (even if I don't think it's really stable - an inode could be evicted and then the ino changes, no?) Ho humm. This all doesn't make me happy. But I guess the proof is in the pudding - and if you come up with a good patch, I won't complain. Linus