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 D5782C433F5 for ; Mon, 4 Apr 2022 23:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67C7D6B0071; Mon, 4 Apr 2022 19:10:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 603CC6B0073; Mon, 4 Apr 2022 19:10:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47D876B0074; Mon, 4 Apr 2022 19:10:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 31C8B6B0071 for ; Mon, 4 Apr 2022 19:10:59 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E3BEB27F for ; Mon, 4 Apr 2022 23:10:48 +0000 (UTC) X-FDA: 79320743376.15.1407D59 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf03.hostedemail.com (Postfix) with ESMTP id 5E78920004 for ; Mon, 4 Apr 2022 23:10:48 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CA98A210E5; Mon, 4 Apr 2022 23:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649113846; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A+BVPy66n8ErIedTq/1vwrjA26ZSdrDU4ZmbYGeUBFg=; b=S1xEWmHkZN49zjH96zxwx5Q4WomGYMvKQg5yJJRVXTo6TAIo3p9GoKyU7YOrwM//BVYW5b cZWP8LhgeJCuszC+k2yx8llXhMxkj3xG/4zqQrsz7fJqZ2YP5gdURZ9P70c+6ZcFsAwvNC zEwoXoYfpxOTXxvxGQPqCQ/6Ki6r7NQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649113846; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A+BVPy66n8ErIedTq/1vwrjA26ZSdrDU4ZmbYGeUBFg=; b=kSHk1k1egdAygIIr8enp8LNwSM/ft3X7yjsC9Lukz36qOWimrHcRYk0T5yi1PkJhBGBwPO OZdLJy0YOBqG12CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 230D313216; Mon, 4 Apr 2022 23:10:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id h6rCM/R6S2JGZwAAMHmgww (envelope-from ); Mon, 04 Apr 2022 23:10:44 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Matthew Wilcox" Cc: "Andrew Morton" , "Jonathan Corbet" , "Linux Memory Management List" , linux-doc@vger.kernel.org Subject: Re: [PATCH] MM: minor improvements to readahead documentation In-reply-to: References: <164879346851.25542.18299715584610241983@noble.neil.brown.name>, , <164904545104.27040.12709890187296939611@noble.neil.brown.name>, Date: Tue, 05 Apr 2022 09:10:40 +1000 Message-id: <164911384099.10985.7554281018592465423@noble.neil.brown.name> X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: goukep14xiegqmpsshi91gur7aobah8e Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=S1xEWmHk; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=kSHk1k1e; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf03.hostedemail.com: domain of neilb@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=neilb@suse.de X-Rspamd-Queue-Id: 5E78920004 X-HE-Tag: 1649113848-180288 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, 04 Apr 2022, Matthew Wilcox wrote: > 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 load= ed > > > - * 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 > >=20 > > 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. >=20 > 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. Yes, we have an abstraction layer - but WHY do you have an abstraction layer? I can't see that it adds anything other than obfuscation. Do you WANT to keep the learning curve nice and steep? >=20 > > > - * 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 filesyst= em > > > + * to indicate that the read attempt has failed. In the first case the > > > + * folio will be unlocked by the VFS. > >=20 > > VFS?? The code is in mm/readahead.c, not in fs/*.c > > Why didn't you like "caller" ?? >=20 > 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. >=20 You didn't answer the second question. NeilBrown