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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112145320.3748979-1-joshua.hahnjy@gmail.com>
Date: Mon, 12 Jan 2026 06:53:19 -0800
From: Joshua Hahn <joshua.hahnjy@...il.com>
To: Yajun Deng <yajun.deng@...ux.dev>
Cc: akpm@...ux-foundation.org,
	vbabka@...e.cz,
	surenb@...gle.com,
	mhocko@...e.com,
	jackmanb@...gle.com,
	hannes@...xchg.org,
	ziy@...dia.com,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm/page_alloc: Avoid duplicate NR_FREE_PAGES updates in move_to_free_list()

On Mon, 12 Jan 2026 20:16:14 +0800 Yajun Deng <yajun.deng@...ux.dev> wrote:

> In move_to_free_list(), when a page block changes its migration type,
> we need to update free page counts for both the old and new types.
> Originally, this was done by two calls to account_freepages(), which
> updates NR_FREE_PAGES and also type-specific counters. However, this
> causes NR_FREE_PAGES to be updated twice, while the net change is zero
> in most cases.
> 
> This patch adds a condition that updates the NR_FREE_PAGES only if one of
> the two types is the isolate type. This avoids NR_FREE_PAGES being
> updates twice.
> 
> The optimization avoid duplicate NR_FREE_PAGES updates in
> move_to_free_list().
> 
> Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
> Suggested-by: Joshua Hahn <joshua.hahnjy@...il.com>

Hello Yajun,

LGTM. Thank you for kindly accepting my suggestion!
Reviewed-by: Joshua Hahn <joshua.hahnjy@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ