Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4827796imc; Mon, 25 Feb 2019 11:48:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZvklSMsEQwHH+gCAvnU9A+dSxJmH+JYNIbnr3xP8XauAt+9NKJg+/8ejWE7y12CJ93lJp4 X-Received: by 2002:a17:902:9307:: with SMTP id bc7mr21900019plb.234.1551124125467; Mon, 25 Feb 2019 11:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551124125; cv=none; d=google.com; s=arc-20160816; b=ei1bNf9KrM42RD7sT27ooBk2j2d8MqF/zuVErVn+maIy3cRhCyMg3lu49EXnAZ2B/K q0XnqiAwMVcyBxSPCq0nvdhgpjor8Dvs0B31TQpneeI8igHWzZCOaC+N1z1z51qWenV4 3qjeF/SVXUpQuStbReU8TcgfO+9+eeZ7XThDiT3JwaFucLsqgtYyaWO5vPpe2CFQkNaf 2oOxbSJQnzAm6Q1hT228anfsFs+at+/4kvXIBxVdrfjb5YQPCpudsaMR43K4797jpsKe 9C55vpFz/xGz/Fv9W5qpMrxB35U7HUlLowmXEQVl6H+GS6Fr1/+TRckYwb+mTJs2q8I+ UH4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cqvd7lW6S0ulQdJhtJFnIlzmKEqsb42Eu4kRGe6Js4w=; b=irpMa6/m2TzTZ9Qs99m1whjwcHiavx+GE7xyba2VYeyNfXVpIpGqS5doD5wlji95LP qZLJabSxZkdao+aVZGI+JCt578RQaD92C+uTi19xs2xz3S261Y2D1RMRbPw3EeQTshkB M+4xJ9NHDweK2SF7nTQOoe5DclBlJoHB6qPBk6JsHmpbG++/IPmDVF6932Jw1rKEb497 R+BNRV0I/bqj+th7q+q+gbBLcgwRZ9Z68X8hWE185UKhS/HjuABUAGTC79g8jU9zHBbH lJxbMX2EyMbCLpYJrDQNYZZvBLglwQku+lxueWQ+OyZlxcJkX9J5MMI9NAwGwmLklD5Y AkEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SjvR6SkG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si10301844pgb.276.2019.02.25.11.48.30; Mon, 25 Feb 2019 11:48:45 -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=@gmail.com header.s=20161025 header.b=SjvR6SkG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727271AbfBYTri (ORCPT + 99 others); Mon, 25 Feb 2019 14:47:38 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41185 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbfBYTri (ORCPT ); Mon, 25 Feb 2019 14:47:38 -0500 Received: by mail-wr1-f67.google.com with SMTP id n2so11294488wrw.8; Mon, 25 Feb 2019 11:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cqvd7lW6S0ulQdJhtJFnIlzmKEqsb42Eu4kRGe6Js4w=; b=SjvR6SkGXssoG+gt8dJehg/2BKeKxp7wRaRdI4QmqixfjrfRnegGvNYZjHSTOnDgT3 G2/0szpwvV5P82f+OZtc3Tq6D5/Y0rkGLEORXkUQv5mv1OCHX77PnWuWMgOslHA0UTki qaIfgoRLvkysc1S83kIhIPf1lwmCAHGaV0HhggmkpaMyHQLV6TvqUC1tSMGFgtIOZLwn SJuLR2lN7fVdkfChHWlSEkssn2paFVEetSmEjM1Ph9BhYF5XWoPiLIAZtMW3WAayHdMd naTT8/wpqdCwFr24p88LghpLAfkw1sADZjoLfVe3RrpA8VJWXfzOKNYOayL3hCKyJoVc vvxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cqvd7lW6S0ulQdJhtJFnIlzmKEqsb42Eu4kRGe6Js4w=; b=LDaFin+MCBOCJI6SM00do0PshGGklS8rLkPu4r4aGnv50TrPfH+dB0hMw+xyTQgoJb RmomXS6s6VHQhgxXy7KwbpZy/UOWYmP/Aa7HaICWzA4WdMGftfH5wUkf6czGpJxkciFZ yIOTcJmOH6oq6mFBfl1gKh6pUlkjoqEAUw3Xs/E3S7Xl6ydqochcmrWLr2s+5VG5f7nq 7ElatljVO1OsCSGML/6byHJbYmnBILPHbf6C0AEez3KwM9cceqRArILL0FQn3tAfqVcQ 3dC16Ri+xBm+4PrwhtkNIifLfguAvrnZiD76PRIqPW7GN/70GFk/wx0aeexOMznOXyYM AvgQ== X-Gm-Message-State: AHQUAua/orX3UyFlo1tj7W58epKWzja18ZB8gkj/tAbxgguNmDA4vcvc nYEJ70r6N35ysnC5iIUfig== X-Received: by 2002:adf:bc11:: with SMTP id s17mr14367808wrg.129.1551124056449; Mon, 25 Feb 2019 11:47:36 -0800 (PST) Received: from avx2 ([46.53.243.195]) by smtp.gmail.com with ESMTPSA id z129sm17814884wmc.33.2019.02.25.11.47.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 11:47:35 -0800 (PST) Date: Mon, 25 Feb 2019 22:47:30 +0300 From: Alexey Dobriyan To: Jeremy Cline Cc: David Both , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] proc: update i_atime when reading files Message-ID: <20190225194627.GA14348@avx2> References: <20190221163714.22330-1-jcline@redhat.com> <20190222053742.GA4270@avx2> <20190222150020.GA14465@laptop.jcline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190222150020.GA14465@laptop.jcline.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 22, 2019 at 10:00:20AM -0500, Jeremy Cline wrote: > On Fri, Feb 22, 2019 at 08:37:42AM +0300, Alexey Dobriyan wrote: > > On Thu, Feb 21, 2019 at 11:37:14AM -0500, Jeremy Cline wrote: > > > Prior to commit 1da4d377f943 ("proc: revalidate misc dentries"), the > > > access, modify, and change times of files in /proc were just the current > > > time. > > > > Ehh, actually no. Doing > > > > $(which sleep) infinity > > > will sabotage atime updates because dentry and inode will be pinned in > > caches. > > > > "revalidate misc denries" commit simply makes the effect (much) more > > visible by making objects stay in caches for longer. > > Indeed. It wasn't my intention to imply there's anything wrong with that > commit, just that that's what caused this apparent change in behavior > for users. In the "common" case when something hasn't pinned the dentry > and inode what users saw was the current time. > > > > > > Now the mtime and ctime values change mostly as a user would > > > expect, but the atime isn't updated when the file read. This patch > > > updates the access time of /proc files when they are read. > > > > > rv = read(file, buf, count, ppos); > > > + if (rv >= 0) > > > + inode->i_atime = current_time(inode); > > > + } > > > > Maybe it should be done given /proc is virtual so there are no concerns > > about scheduling writes noone cares about to the filesystem. > > Sorry, maybe I've not had enough coffee yet, but I don't understand this > sentence. I meant it should be harmless to enable atime unconditionally for /proc because it is virtual filesystem.