Re: [PATCH v14 011/138] mm/lru: Add folio LRU functions

Mike Rapoport
2021-07-21T08:52:37Z

On Wed, Jul 21, 2021 at 05:08:44AM +0100, Matthew Wilcox wrote:
> On Tue, Jul 20, 2021 at 01:44:10PM +0300, Mike Rapoport wrote:
> > It seems mm_inline.h is not a part of generated API docs, otherwise
> > kerneldoc would be unhappy about missing Return: description.
>
> It isn't, but I did add mm_inline.h to Documentation as part of this
> patch (thanks!) and made this change:
>
> /**
> - * folio_is_file_lru - should the folio be on a file LRU or anon LRU?
> - * @folio: the folio to test
> - *
> - * Returns 1 if @folio is a regular filesystem backed page cache folio
> - * or a lazily freed anonymous folio (e.g. via MADV_FREE). Returns 0 if
> - * @folio is a normal anonymous folio, a tmpfs folio or otherwise ram or
> - * swap backed folio. Used by functions that manipulate the LRU lists,
> - * to sort a folio onto the right LRU list.
> + * folio_is_file_lru - Should the folio be on a file LRU or anon LRU?
> + * @folio: The folio to test.
> *
> * We would like to get this info without a page flag, but the state
> * needs to survive until the folio is last deleted from the LRU, which
> * could be as far down as __page_cache_release.
> + *
> + * Return: An integer (not a boolean!) used to sort a folio onto the
> + * right LRU list and to account folios correctly.
> + * 1 if @folio is a regular filesystem backed page cache folio
> + * or a lazily freed anonymous folio (e.g. via MADV_FREE).
> + * 0 if @folio is a normal anonymous folio, a tmpfs folio or otherwise
> + * ram or swap backed folio.
> */
>
> I wanted to turn those last two sentences into a list, but my
> kernel-doc-fu abandoned me. Feel free to submit a follow-on patch to
> fix that ;-)

Here it is ;-)

Feel free to fold it into the original commit if you'd like to.

From 636d1715252f7bd1e87219797153b8baa28774af Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@linux.ibm.com>
Date: Wed, 21 Jul 2021 11:35:15 +0300
Subject: [PATCH] mm/docs: folio_is_file_lru: make return description a list

Reformat return value description of folio_is_file_lru() so that will be
presented as a list in the generated output.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
include/linux/mm_inline.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index d39537c5471b..b263ac0a2c3a 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -15,10 +15,11 @@
*
* Return: An integer (not a boolean!) used to sort a folio onto the
* right LRU list and to account folios correctly.
- * 1 if @folio is a regular filesystem backed page cache folio
- * or a lazily freed anonymous folio (e.g. via MADV_FREE).
- * 0 if @folio is a normal anonymous folio, a tmpfs folio or otherwise
- * ram or swap backed folio.
+ *
+ * - 1 if @folio is a regular filesystem backed page cache folio
+ * or a lazily freed anonymous folio (e.g. via MADV_FREE).
+ * - 0 if @folio is a normal anonymous folio, a tmpfs folio or otherwise
+ * ram or swap backed folio.
*/
static inline int folio_is_file_lru(struct folio *folio)
{
--
2.31.1

--
Sincerely yours,
Mike.