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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0FEAC433EF for ; Mon, 4 Apr 2022 13:26:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F29306B0072; Mon, 4 Apr 2022 09:26:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDA2B6B0073; Mon, 4 Apr 2022 09:26:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA1006B0074; Mon, 4 Apr 2022 09:26:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id C92636B0072 for ; Mon, 4 Apr 2022 09:26:09 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 9948081573 for ; Mon, 4 Apr 2022 13:25:59 +0000 (UTC) X-FDA: 79319269638.07.CA09DFB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 76880100024 for ; Mon, 4 Apr 2022 13:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XGCV0/4swvZ3PQNBW75blrReho8Qtcu9hFHAog2b5mg=; b=Yg+AGDrexwOvK8O/BucnkUM0jf M9i6uivtTHsfFDZ+IbpUkZVoCKbFLCmpd+WIu3FfQ9cBtfIYZYhUdMZ4Br/yqAxBniqxEIintHE0j eKXpF7YDKFrQvAqGGeBWQ2RZKKHBBfi2Bap2BA1jeyOUifHSpOi/kJwfbh46klqABNALsGZYY+Wb5 Qr7NKHBi9bzR/6JiiFdw8dcadDcvc+42WpLZiogJLO/DrwEJBARe1Xj7hOA2En4TG+N4TsvWP76C5 2YYfCJxWLt/v/jxUWpt8gIdqIg1a2Yp4wiU218heb4ynBC26ZA+w6McAtjiHwqFF9VSKSkDJ+xvyy 22QCvCvA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbMiP-005l1W-3C; Mon, 04 Apr 2022 13:25:53 +0000 Date: Mon, 4 Apr 2022 14:25:53 +0100 From: Matthew Wilcox To: NeilBrown Cc: Andrew Morton , Jonathan Corbet , Linux Memory Management List , linux-doc@vger.kernel.org Subject: Re: [PATCH] MM: minor improvements to readahead documentation Message-ID: References: <164879346851.25542.18299715584610241983@noble.neil.brown.name> <164904545104.27040.12709890187296939611@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164904545104.27040.12709890187296939611@noble.neil.brown.name> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 76880100024 X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Yg+AGDre; dmarc=none; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: npqwkdh43auga8eywgjaxwgdhihedag3 X-HE-Tag: 1649078758-444077 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 04, 2022 at 02:10:51PM +1000, NeilBrown wrote: > > * Readahead is triggered when an application read request (whether a > > - * systemcall or a page fault) finds that the requested page is not in > > + * system call or a page fault) finds that the requested folio is not in > > * the page cache, or that it is in the page cache and has the > > - * %PG_readahead flag set. This flag indicates that the page was loaded > > - * as part of a previous read-ahead request and now that it has been > > - * accessed, it is time for the next read-ahead. > > + * readahead flag set. This flag indicates that the folio was read > > Ugh. Why don't you like %PG_readahead? I absolutely loath the > practice of hiding flags inside accessor functions, and hiding the truth > in documentation is just as bad. It all makes grepping that much > harder. > I would MUCH prefer that the %PG_ were restored. Please. I absolutely loathe it that there are references to PG_* anywhere outside page-flags.h. We have the abstraction layer, we want people to use it, and we shouldn't needlessly multiply entities by referring to the implementation of the abstraction. I remove references to PG_ flags wherever I find them. I agree that grepping for page/folio flags doesn't work, and it's something I spend a lot of time thinking about. In particular, I want to produce decent kernel-doc for them. > > - * In the last two cases, the page should be unlocked to indicate that > > - * the read attempt has failed. In the first case the page will be > > - * unlocked by the caller. > > + * In the last two cases, the folio should be unlocked by the filesystem > > + * to indicate that the read attempt has failed. In the first case the > > + * folio will be unlocked by the VFS. > > VFS?? The code is in mm/readahead.c, not in fs/*.c > Why didn't you like "caller" ?? I view mm/readahead.c, mm/filemap.c and mm/page-writeback.c as part of the VFS more than as part of the VM. But that's something that reasonable people can disagree on. I think from the point of view of the filesystem author, it's all VFS.