linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Cheng Li <lic121@chinatelecom.cn>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: use mem_map_offset instead of mem_map_next
Date: Tue, 6 Sep 2022 10:04:52 -0700	[thread overview]
Message-ID: <Yxd9tA8ThZtB77dq@monkey> (raw)
In-Reply-To: <YxUVZpsmukNW5NyK@casper.infradead.org>

On 09/04/22 22:15, Matthew Wilcox wrote:
> On Sun, Sep 04, 2022 at 02:02:41PM +0000, Cheng Li wrote:
> > To handle discontiguity case, mem_map_next() has a parameter named
> > `offset`. As a function caller, one would be confused why "get
> > next entry" needs a parameter named "offset". The other drawback of
> > mem_map_next() is that the callers must take care of the map between
> > parameter "iter" and "offset", otherwise we may get an hole or
> > duplication during iteration. So we use mem_map_offset instead of
> > mem_map_next.
> 
> I think we should go further and get rid of mem_map_offset().
> nth_page() is now more efficient than mem_map_offset().

Agree.

However, IIUC nth_page() will 'almost' always be more efficient.  The
only exception is unlikely configuration where CONFIG_SPARSEMEM &&
!CONFIG_SPARSEMEM_VMEMMAP.  Correct?

Not arguing against replacement.  Just wanting to refresh my memory.
-- 
Mike Kravetz


      reply	other threads:[~2022-09-06 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 14:02 Cheng Li
2022-09-04 16:38 ` kernel test robot
2022-09-04 17:00 ` kernel test robot
2022-09-04 21:15 ` Matthew Wilcox
2022-09-06 17:04   ` Mike Kravetz [this message]

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=Yxd9tA8ThZtB77dq@monkey \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=lic121@chinatelecom.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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