[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D3D3F7A5-A7CD-4D93-AB76-2200569AF98E@nvidia.com>
Date: Thu, 14 Aug 2025 11:52:57 -0400
From: Zi Yan <ziy@...dia.com>
To: Usama Arif <usamaarif642@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, david@...hat.com,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, corbet@....net,
rppt@...nel.org, surenb@...gle.com, mhocko@...e.com, hannes@...xchg.org,
baohua@...nel.org, shakeel.butt@...ux.dev, riel@...riel.com,
laoar.shao@...il.com, dev.jain@....com, baolin.wang@...ux.alibaba.com,
npache@...hat.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
ryan.roberts@....com, vbabka@...e.cz, jannh@...gle.com,
Arnd Bergmann <arnd@...db.de>, sj@...nel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH v4 5/7] selftest/mm: Extract sz2ord function into
vm_util.h
On 13 Aug 2025, at 9:55, Usama Arif wrote:
> The function already has 2 uses and will have a 3rd one
> in prctl selftests. The pagesize argument is added into
> the function, as it's not a global variable anymore.
> No functional change intended with this patch.
>
> Suggested-by: David Hildenbrand <david@...hat.com>
> Signed-off-by: Usama Arif <usamaarif642@...il.com>
> ---
> tools/testing/selftests/mm/cow.c | 12 ++++--------
> tools/testing/selftests/mm/uffd-wp-mremap.c | 9 ++-------
> tools/testing/selftests/mm/vm_util.h | 5 +++++
> 3 files changed, 11 insertions(+), 15 deletions(-)
>
<snip>
> diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
> index 148b792cff0fc..e5cb72bf3a2ab 100644
> --- a/tools/testing/selftests/mm/vm_util.h
> +++ b/tools/testing/selftests/mm/vm_util.h
> @@ -135,6 +135,11 @@ static inline void log_test_result(int result)
> ksft_test_result_report(result, "%s\n", test_name);
> }
>
> +static inline int sz2ord(size_t size, size_t pagesize)
> +{
> + return __builtin_ctzll(size / pagesize);
> +}
> +
There is a psize() at the top of vm_util.h to get pagesize.
But I have no strong opinion on passing pagesize or not.
Anyway, Reviewed-by: Zi Yan <ziy@...dia.com>
Best Regards,
Yan, Zi
Powered by blists - more mailing lists