lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSX1wgqlCj9UBzCR@smile.fi.intel.com>
Date: Tue, 25 Nov 2025 20:30:26 +0200
From: "andriy.shevchenko@...ux.intel.com" <andriy.shevchenko@...ux.intel.com>
To: "Stamatis, Ilias" <ilstam@...zon.co.uk>
Cc: "nadav.amit@...il.com" <nadav.amit@...il.com>,
	"david@...nel.org" <david@...nel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"huang.ying.caritas@...il.com" <huang.ying.caritas@...il.com>,
	"bhe@...hat.com" <bhe@...hat.com>,
	"nh-open-source@...zon.com" <nh-open-source@...zon.com>
Subject: Re: [PATCH] Reinstate "resource: avoid unnecessary lookups in
 find_next_iomem_res()"

On Tue, Nov 25, 2025 at 02:23:38PM +0000, Stamatis, Ilias wrote:
> On Tue, 2025-11-25 at 12:23 +0200, andriy.shevchenko@...ux.intel.com wrote:
> > Thanks for elaboration.
> > 
> > Please summarise this, add the performance test results and send a v2.
> > Seems okay to me.
> 
> How does this look?
> 
> No code change, but happy to send a v2 if that makes things easier for merging.

Yes, please do.

> Reinstate "resource: avoid unnecessary lookups in find_next_iomem_res()"

resource: Reinstate "avoid unnecessary lookups in find_next_iomem_res()"

(always keep leading prefix).

> Commit 97523a4edb7b ("kernel/resource: remove first_lvl / siblings_only
> logic") removed an optimization introduced by commit 756398750e11
> ("resource: avoid unnecessary lookups in find_next_iomem_res()"). That
> was not called out in the message of the first commit explicitly so it's
> not entirely clear whether removing the optimization happened
> inadvertently or not.
> 
> As the original commit message of the optimization explains there is no
> point considering the children of a subtree in find_next_iomem_res() if
> the top level range does not match.
> 
> Reinstating the optimization results in performance improvements in
> systems where /proc/iomem is ~5k lines long. Calling mmap() on /dev/mem
> in such platforms takes 700-1500μs without the optimisation and 10-50μs
> with the optimisation.
> 
> Note that even though commit 97523a4edb7b removed the 'sibling_only'
> parameter from next_resource(), newer kernels have basically reinstated
> it under the name 'skip_children'.
> 
> Link: https://lore.kernel.org/all/20251124165349.3377826-1-ilstam@amazon.com/T/#u
> Fixes: 97523a4edb7b ("kernel/resource: remove first_lvl / siblings_only logic")
> Signed-off-by: Ilias Stamatis <ilstam@...zon.com>
> Acked-by: David Hildenbrand (Red Hat) <david@...nel.org>

The rest LGTM.

Also, if required, make a comment in the code aligned with this new commit
message.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ