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.8 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,URIBL_BLOCKED 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 13AB8C352A3 for ; Thu, 13 Feb 2020 22:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFC832073A for ; Thu, 13 Feb 2020 22:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581634091; bh=kuhbs/VbpNEZWogAUDjvRYiro5cykILbgDMBojkyEI0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=Ks1sZwnIzU3RuDo/CBUKrkOWm3kJO587S5Q8ZEN6FMapWl6rD5M+vIgl4zdT7Gjn8 hxoa4DviEcAfEkLQDxOON5M5TG6+7Dz0R0DOYxPVzwBmLh/UvgfdR5Mo++3rcxI4gj KByFT1/96b6LgPD4RUfcYM9XktDANCdpaWGtwTZ8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbgBMWsK (ORCPT ); Thu, 13 Feb 2020 17:48:10 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:35473 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727594AbgBMWsK (ORCPT ); Thu, 13 Feb 2020 17:48:10 -0500 Received: by mail-lj1-f196.google.com with SMTP id q8so8532686ljb.2 for ; Thu, 13 Feb 2020 14:48:07 -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=JDC/w2mnE06o1Apg+OW2QJXf2jHUPkk2CakDhlEAvra1NamXkG42J4S3x4e3H1SEKN sI9ThGKG35b7qsVOhmkTN9bfShQ0ye9983AvrQ9DkMB/6ks0OYvpkxobHmKX/Ualolwr oGPMDph0DuHjoqIR1VUwcDsobfDmQ15wbjWSpdABmm1beSpeKrbGhk9+XW1ip26lRSZ4 czFlA11utFP20Bu5AUC/ppp5Fkfk3uBmonSBlWTzhP477YVSunQWhIgcS35vjKRKewbT N8xJViAilkq6Efn0q1YRGRQvSCbUCYnzcl9P22DG80j4KOveOOWdQt5Winpgstlrv6tN 1Vtw== X-Gm-Message-State: APjAAAVc2LsZi69mS1EMCoXA+ZFkmV+9g/7xBBpPcK0xsRx7wWdQJ51P 7CuU4nS6QC6GLEuZ2WaYFfmBYzwiieA= X-Google-Smtp-Source: APXvYqyCnzNWrp/WWfxKN40kv7ge5us0qFcW6gfMZnOxWEahe/r8VX/9a3Ocd1uqee7EzeXQgNf56A== X-Received: by 2002:a2e:914d:: with SMTP id q13mr53349ljg.198.1581634086497; Thu, 13 Feb 2020 14:48:06 -0800 (PST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id m16sm2401054ljb.47.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-f176.google.com with SMTP id h23so8514085ljc.8 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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