[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3fa9edc-370c-4087-a201-6419185a0e72@kernel.org>
Date: Wed, 4 Feb 2026 12:41:04 +0100
From: "David Hildenbrand (arm)" <david@...nel.org>
To: Jiaqi Yan <jiaqiyan@...gle.com>, jane.chu@...cle.com,
muchun.song@...ux.dev
Cc: osalvador@...e.de, william.roche@...cle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] fs: hugetlb: simplify remove_inode_hugepages() return
type
On 2/3/26 00:36, Jiaqi Yan wrote:
> When remove_inode_hugepages is introduced in
> commit c86272287bc6 ("hugetlb: create remove_inode_single_folio to remove single file folio")
> it used to return a boolean to indicate if it bailed out due to race with
> page faults. However, since the race is already solved by [1],
> remove_inode_hugepages() doesn't have any path to return false anymore.
>
> Simplify remove_inode_hugepages() return type to void, remove the
> unnecessary ret variable, and adjust the call site in
> remove_inode_hugepages(). No functional change in this commit.
>
> [1] https://lore.kernel.org/all/20220914221810.95771-10-mike.kravetz@oracle.com
>
> Suggested-by: Jane Chu <jane.chu@...cle.com>
> Signed-off-by: Jiaqi Yan <jiaqiyan@...gle.com>
> ---
> fs/hugetlbfs/inode.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 3b4c152c5c73a..83d71cea7e384 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -515,13 +515,11 @@ hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end,
> * Called with hugetlb fault mutex held.
> * Returns true if page was actually removed, false otherwise.
> */
> -static bool remove_inode_single_folio(struct hstate *h, struct inode *inode,
> - struct address_space *mapping,
> - struct folio *folio, pgoff_t index,
> - bool truncate_op)
> +static void remove_inode_single_folio(struct hstate *h, struct inode *inode,
> + struct address_space *mapping,
> + struct folio *folio, pgoff_t index,
> + bool truncate_op)
While you are touching this, this would look better with two-tab
alignment on second parameter line.
Acked-by: David Hildenbrand (arm) <david@...nel.org>
--
Cheers,
David
Powered by blists - more mailing lists