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.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, 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 D1A52C3B18B for ; Thu, 13 Feb 2020 14:00:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E737218AC for ; Thu, 13 Feb 2020 14:00:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="psiuyPbQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E737218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2532F6B0549; Thu, 13 Feb 2020 09:00:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 202896B054B; Thu, 13 Feb 2020 09:00:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 119276B054C; Thu, 13 Feb 2020 09:00:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id EC9666B0549 for ; Thu, 13 Feb 2020 08:59:59 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 97F8B2A87 for ; Thu, 13 Feb 2020 13:59:59 +0000 (UTC) X-FDA: 76485262518.11.hand06_3a08c78d99e28 X-HE-Tag: hand06_3a08c78d99e28 X-Filterd-Recvd-Size: 6880 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 13:59:58 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id n18so6699398ljo.7 for ; Thu, 13 Feb 2020 05:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=d+8KvklWJGXWjHgD35gpB8KFdd0PBjAC6j+lE4WHS6s=; b=psiuyPbQz1NHGk/uKAcko22FjVpQaBiPUQsZnLfMz8UcnqnCzhwomLXDyVAZL5Eu2u aMNMpiYcSoCKYYWJZfnits7z6Pxopm8MAEr7YpcWpFd2VcMG6kXMUtgnN1B996+O6m01 2YWZ0j0AYJQu4O0peQTTJUlOJpkoomSWShV0+qWeFJi/IV6VsLqbhNlysAq5yC9Mhte6 MlPCz72BcpYIRDA0Q6liWRRVkftLwlAWxPwCCU7gCqHeNKbDEnAGUl5A4jG2aBXmjC4S RoTaiyV2b7y2UI1e8C3P1D/cUHKXH0abvTuZ0WnA6TqGxZwLj4dd0rzGCKGL/S2uYv41 MqiA== 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; bh=d+8KvklWJGXWjHgD35gpB8KFdd0PBjAC6j+lE4WHS6s=; b=V1F8VPEQVOr2EG4H6F4dBEWJbbdYjBR2VU/kcws/69lK1QN+NCzm14TQY/ER8tq136 apSTbtSsZLSZmFH7fwxXuWqACVjQBuovXOhpJ1hhkd9+lqpAivXdFZ6VltPTV+h9/dFG Pdikt70EuKiaTlCVjPdEGLFFpIfvaU06XKxV5pFJtSD5dVTTXloQKcq/7AgLi44xudm9 h12zZFfZuu9vbFf4JYfl9X5sjKxDQB692QPCFFzYTsM3s+srvgleVVB475UpAwc4s4QW DEvumXgqDO+1b+pze8OHBXXI2Jvufx0owVhTUP4v3TDIe0l3tfrrhxweJpWBUcI72/8E TU7Q== X-Gm-Message-State: APjAAAXxdgyg1NE4piE0eYwRAOpnbMZ7z5tuya/pLlXu6Vta+5Phg3Fh P+qy2iQPIx4yWJpxzYbrUq4Fow== X-Google-Smtp-Source: APXvYqy3MZCrg50lwTpOQ2nHdXM9qpNzZJvp69TAtFVoYduIuHyCUH1khFeVOUGwlcb9kbKq8ja8XQ== X-Received: by 2002:a2e:b04b:: with SMTP id d11mr11336407ljl.248.1581602397526; Thu, 13 Feb 2020 05:59:57 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id l12sm1522216lji.52.2020.02.13.05.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 05:59:56 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id DC75C100F25; Thu, 13 Feb 2020 17:00:18 +0300 (+03) Date: Thu, 13 Feb 2020 17:00:18 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 05/25] mm: Fix documentation of FGP flags Message-ID: <20200213140018.fv2uj7knrd3chdgz@box> References: <20200212041845.25879-1-willy@infradead.org> <20200212041845.25879-6-willy@infradead.org> <20200212074215.GF7068@infradead.org> <20200212191145.GH7778@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200212191145.GH7778@bombadil.infradead.org> 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 Wed, Feb 12, 2020 at 11:11:45AM -0800, Matthew Wilcox wrote: > On Tue, Feb 11, 2020 at 11:42:15PM -0800, Christoph Hellwig wrote: > > On Tue, Feb 11, 2020 at 08:18:25PM -0800, Matthew Wilcox wrote: > > > - * @fgp_flags: PCG flags > > > + * @fgp_flags: FGP flags > > > * @gfp_mask: gfp mask to use for the page cache data page allocation > > > * > > > * Looks up the page cache slot at @mapping & @offset. > > > * > > > - * PCG flags modify how the page is returned. > > > + * FGP flags modify how the page is returned. > > > > This still looks weird. Why not just a single line: > > > > * @fgp_flags: FGP_* flags that control how the page is returned. > > Well, now you got me reading the entire comment for this function, and > looking at the html output, so I ended up rewriting it entirely. > > +++ b/mm/filemap.c > @@ -1574,37 +1574,34 @@ struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset) > EXPORT_SYMBOL(find_lock_entry); > > /** > - * pagecache_get_page - find and get a page reference > - * @mapping: the address_space to search > - * @offset: the page index > - * @fgp_flags: FGP flags > - * @gfp_mask: gfp mask to use for the page cache data page allocation > - * > - * Looks up the page cache slot at @mapping & @offset. > + * pagecache_get_page - Find and get a reference to a page. > + * @mapping: The address_space to search. > + * @offset: The page index. > + * @fgp_flags: %FGP flags modify how the page is returned. > + * @gfp_mask: Memory allocation flags to use if %FGP_CREAT is specified. > * > - * FGP flags modify how the page is returned. > + * Looks up the page cache entry at @mapping & @offset. > * > - * @fgp_flags can be: > + * @fgp_flags can be zero or more of these flags: > * > - * - FGP_ACCESSED: the page will be marked accessed > - * - FGP_LOCK: Page is return locked > - * - FGP_CREAT: If page is not present then a new page is allocated using > - * @gfp_mask and added to the page cache and the VM's LRU > - * list. The page is returned locked and with an increased > - * refcount. > - * - FGP_FOR_MMAP: Similar to FGP_CREAT, only we want to allow the caller to do > - * its own locking dance if the page is already in cache, or unlock the page > - * before returning if we had to add the page to pagecache. > + * * %FGP_ACCESSED - The page will be marked accessed. > + * * %FGP_LOCK - The page is returned locked. > + * * %FGP_CREAT - If no page is present then a new page is allocated using > + * @gfp_mask and added to the page cache and the VM's LRU list. > + * The page is returned locked and with an increased refcount. > + * * %FGP_FOR_MMAP - The caller wants to do its own locking dance if the > + * page is already in cache. If the page was allocated, unlock it before > + * returning so the caller can do the same dance. > * > - * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even > - * if the GFP flags specified for FGP_CREAT are atomic. > + * If %FGP_LOCK or %FGP_CREAT are specified then the function may sleep even > + * if the %GFP flags specified for %FGP_CREAT are atomic. > * > * If there is a page cache page, it is returned with an increased refcount. > * > - * Return: the found page or %NULL otherwise. > + * Return: The found page or %NULL otherwise. > */ > struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, > - int fgp_flags, gfp_t gfp_mask) > + int fgp_flags, gfp_t gfp_mask) > { LGTM: Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov