linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "andriy.shevchenko@linux.intel.com" <andriy.shevchenko@linux.intel.com>
To: "Stamatis, Ilias" <ilstam@amazon.co.uk>
Cc: "nadav.amit@gmail.com" <nadav.amit@gmail.com>,
	"david@kernel.org" <david@kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"huang.ying.caritas@gmail.com" <huang.ying.caritas@gmail.com>,
	"bhe@redhat.com" <bhe@redhat.com>,
	"nh-open-source@amazon.com" <nh-open-source@amazon.com>
Subject: Re: [PATCH] Reinstate "resource: avoid unnecessary lookups in find_next_iomem_res()"
Date: Tue, 25 Nov 2025 20:30:26 +0200	[thread overview]
Message-ID: <aSX1wgqlCj9UBzCR@smile.fi.intel.com> (raw)
In-Reply-To: <265028eb24f60ce45725d7887e93f76a3e86f897.camel@amazon.co.uk>

On Tue, Nov 25, 2025 at 02:23:38PM +0000, Stamatis, Ilias wrote:
> On Tue, 2025-11-25 at 12:23 +0200, andriy.shevchenko@linux.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@amazon.com>
> Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>

The rest LGTM.

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

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2025-11-25 18:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 16:53 Ilias Stamatis
2025-11-24 16:58 ` Andrew Morton
2025-11-24 17:05   ` Andy Shevchenko
     [not found]   ` <c7411175b332f3befb5bebb6a75c7b91f2c1dbbc.camel@amazon.co.uk>
2025-11-24 18:55     ` andriy.shevchenko
2025-11-24 19:35       ` Stamatis, Ilias
2025-11-24 19:52         ` andriy.shevchenko
2025-11-24 23:30           ` Stamatis, Ilias
2025-11-25  6:50             ` andriy.shevchenko
2025-11-25  9:56               ` Stamatis, Ilias
2025-11-25 10:23                 ` andriy.shevchenko
2025-11-25 14:23                   ` Stamatis, Ilias
2025-11-25 18:30                     ` andriy.shevchenko [this message]
2025-11-25  8:09 ` David Hildenbrand (Red Hat)
2025-11-25  8:18   ` David Hildenbrand (Red Hat)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSX1wgqlCj9UBzCR@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=david@kernel.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=ilstam@amazon.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nadav.amit@gmail.com \
    --cc=nh-open-source@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox