Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp937219imi; Fri, 22 Jul 2022 13:02:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sGpepU8HJaFqgHZHzIXW8A/I8HqNeuZMlE0/z6ZPUU7HpLjExvLiVacySbcxmO/UC5LvD6 X-Received: by 2002:a17:907:7255:b0:72b:50b8:82d6 with SMTP id ds21-20020a170907725500b0072b50b882d6mr1177694ejc.677.1658520142909; Fri, 22 Jul 2022 13:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658520142; cv=none; d=google.com; s=arc-20160816; b=NcFwcMIm2MWsf7szuM0rfhb3GwnCohgd6NGTN6APijW9ftJ07lr4BTPJVYzaSvhmNW esdoAiwnuMvZYHocwVwgRo07mp48tmVSjPrljNiMPH5UqyepMUEfDp99s8tbmJiMmBl+ 0+OjyQf2gdx8RDZ+A2Zx1RLmrLZG+9p0XHa+5zm0TP/3VboBrnj/xNkd8Oi+vqiSmkbg GLCpH8XNn2S97lCF52P4bpF9d1pnKVZ/yTKPI/1WtG11B/UDDKTaurwfjqlpzQdVyQJD 409trCiFmDTQcFYIZrKaakcljeof5roE6hVIYp7Ownpx2xaA3CNWHa+ijn6HYUZ/3X3F L6Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZosF4/sMc0ihmX47ZtSXWJLh9VlS4bzSsfv/BETdwF4=; b=zpo0365hEeO+/wfKadtRHGB6njRquxrdphm+jdlBdSDCkYY+ytWErr1c0ulYRPrrY4 Yj0alHaadezOYbTyqVZdx18MFHCy9pOI+brXZe4Uc/jDiU8AM8/+ORAICxWEGdKR92Nl 8Anp3nnQ2K/9NxHr2fX3EkhlCTIMyrVaVk4C96SB7115VY4Ox2UUXO3IowLoOdi6+pFB GS0avjqUno3td4Sb7937uKQkGq97nZoKSPMEPRX+t6vrXdxkSBlBZ+T63frKrqftiizz 8w1Glk2A/6d697utZCjTjlenUe3cUUpvDc6I9bzROihFA51WDS1MWKqZsIFwS1FU2ZpN 6skw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VNhO9L3H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020aa7dcd0000000b0043a6ca62799si5406104edu.307.2022.07.22.13.01.58; Fri, 22 Jul 2022 13:02:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VNhO9L3H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236580AbiGVT42 (ORCPT + 99 others); Fri, 22 Jul 2022 15:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbiGVT40 (ORCPT ); Fri, 22 Jul 2022 15:56:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 354259C27B; Fri, 22 Jul 2022 12:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=ZosF4/sMc0ihmX47ZtSXWJLh9VlS4bzSsfv/BETdwF4=; b=VNhO9L3HEMflnvHx6vsxrwdWR6 BeMsUX5k5thgO5ceMSltwRfdDNQWHw+slUvZMJF45URjzjQ5t5orJLjccfNNLVm9hE6NWLyla9sVK DUETIYMZSceOB1HrGZsftTEV9OHhGsKOmWu0qWiWOc4qTm3K06uxzC6at2pm0mP2SkjWzylGhaAsy lTnNeEdIEnfgUc/7nAoeqnAJheKRqrETrRi3SGS3sD8zs/fgcO8TZyt+Y02zuUpLUN4kTq7qSapud zBOQYKE9BXo6z6MRWlVu9REjeS7eiA1KnbqJzHReMVKXPbAYgtT63wFw/+jZThS9GF06guioAuLmt YLCk674g==; Received: from [2601:1c0:6280:3f0::a6b3] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEykt-009cUn-Fz; Fri, 22 Jul 2022 19:56:11 +0000 Message-ID: Date: Fri, 22 Jul 2022 12:56:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 2/2] Documentation/filesystems/proc.rst: document procfs inode timestamps Content-Language: en-US To: Luis Chamberlain , ebiederm@xmission.com, corbet@lwn.net, keescook@chromium.org, yzaikin@google.com Cc: songmuchun@bytedance.com, zhangyuchen.lcr@bytedance.com, dhowells@redhat.com, deepa.kernel@gmail.com, hch@lst.de, linux-doc@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220722162934.1888835-1-mcgrof@kernel.org> <20220722162934.1888835-3-mcgrof@kernel.org> From: Randy Dunlap In-Reply-To: <20220722162934.1888835-3-mcgrof@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi-- On 7/22/22 09:29, Luis Chamberlain wrote: > The timestamps for procfs files are not well understood and can > confuse users and developers [0] in particular for the timestamp > for the start time or a process. Clarify what they mean and that > they are a reflection of the ephemeral nature of the filesystem > inodes. > > The procfs inodes are created when you first read them and then > stuffed in the page cache. If the page cache and indodes are > reclaimed they can be removed, and re-created with a new timestamp > after read again. Document this little bit of tribal knowledge. > > [0] https://lkml.kernel.org/r/20220721081617.36103-1-zhangyuchen.lcr@bytedance.com > Reported-by: Zhang Yuchen > Signed-off-by: Luis Chamberlain > --- > Documentation/filesystems/proc.rst | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > index 9fd5249f1a5f..9defe9af683a 100644 > --- a/Documentation/filesystems/proc.rst > +++ b/Documentation/filesystems/proc.rst > @@ -59,6 +59,15 @@ The proc file system acts as an interface to internal data structures in the > kernel. It can be used to obtain information about the system and to change > certain kernel parameters at runtime (sysctl). > > +The proc files are dynamic in nature and allow for developers to make the Awkward. How about: The proc files are dynamic and allow for the content to be changed each time a file is read. > +content to be changed each time a file is read. The proc files and directories The proc files and directory > +inodes are created when someone first reads a respective proc file or directory, > +as such the timestamps of the proc files reflect this time. As with other > +filesystems, these proc inodes can be removed through reclaim under memory > +pressure and so the timestamps of the proc files can change if the proc files > +are destroyed and re-created (echo 3 > /proc/sys/vm/drop_caches forces and > +illustrate the reclaim of inodes and page cache). > + > First, we'll take a look at the read-only parts of /proc. In Chapter 2, we > show you how you can use /proc/sys to change settings. Thanks. -- ~Randy