mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Xuewen Wang <wangxuewen_ky@163.com>
Cc: david@kernel.org, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, sj@kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Xuewen Wang <wangxuewen@kylinos.cn>
Subject: Re: [PATCH v1] tools/mm: page-types: flush pending idle bitmap bits after walking
Date: Tue, 24 Nov 2026 18:46:53 -0800	[thread overview]
Message-ID: <20261124184653.d6e1d627154d526e6cd85d27@linux-foundation.org> (raw)
In-Reply-To: <20261118021253.1691428-1-wangxuewen_ky@163.com>

On Wed, 18 Nov 2026 10:12:53 +0800 Xuewen Wang <wangxuewen_ky@163.com> wrote:

> From: Xuewen Wang <wangxuewen@kylinos.cn>
> 
> mark_page_idle() buffers bits for one 64-page bitmap word and writes
> that word when a page in another word is encountered.
> 
> walk_addr_ranges() tries to flush the final word by marking PFN 0.
> If the last buffered PFN is below 64, this only adds a bit to the same
> word and nothing is written. Otherwise it writes the pending word but
> leaves an unwanted PFN 0 bit buffered. walk_page_cache() does not flush
> at all, so its final pending bits are not written.
> 
> Extract the write operation into flush_page_idle() and use it both when
> changing words and after either walker returns to main(). Clear the
> buffer after a successful write and skip writes when it is empty.
> Place the final flush before the no-summary early return.
> 
> Use 1ULL for the bit mask so shifts by 32 through 63 are also valid
> on 32-bit hosts.
> 
> ...
>  
> @@ -1364,6 +1373,9 @@ int main(int argc, char *argv[])
>  	else
>  		walk_addr_ranges();
>  
> +	if (opt_mark_idle)
> +		flush_page_idle();

Very minor, but we shouldn't exit(0) if that flush_page_idle() returned
error?

>  	if (opt_list == 1)
>  		flush_page_range();
>  


      reply	other threads:[~2026-11-25  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  2:12 Xuewen Wang
2026-11-25  2:46 ` Andrew Morton [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=20261124184653.d6e1d627154d526e6cd85d27@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=sj@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=wangxuewen@kylinos.cn \
    --cc=wangxuewen_ky@163.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

all inboxes | Powered by JetHome®