lkml.org 
[lkml]   [2022]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] resource: re-factor page_is_ram()
From
On 01.06.22 18:32, Vaibhav Jain wrote:
> Presently page_is_ram() relies on walk_system_ram_range() that performs a walk
> on kernel iomem resources hierarchy with a dummy callback __is_ram(). Before
> calling find_next_iomem_res(), walk_system_ram_range() does some book-keeping
> which can be avoided for page_is_ram() use-case.
>
> Hence this patch proposes to update page_is_ram() to directly call
> find_next_iomem_res() with minimal book-keeping needed.

I consider the code harder to get compared to just reusing the
more-generic and expressive walk_system_ram_range().

It somehow feels like we're duplicating the code here just to optimize
out a handful of instructions.

If it doesn't make the code easier to read (at least for me), why do we
care?

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2022-06-10 12:25    [W:0.056 / U:1.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site