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: <20250123172338.53472-1-sj@kernel.org>
Date: Thu, 23 Jan 2025 09:23:38 -0800
From: SeongJae Park <sj@...nel.org>
To: Vinay Banakar <vny@...gle.com>
Cc: SeongJae Park <sj@...nel.org>,
	Bharata B Rao <bharata@....com>,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org,
	willy@...radead.org,
	mgorman@...e.de,
	Wei Xu <weixugc@...gle.com>,
	Greg Thelen <gthelen@...gle.com>
Subject: Re: [PATCH] mm: Optimize TLB flushes during page reclaim

On Thu, 23 Jan 2025 11:11:13 -0600 Vinay Banakar <vny@...gle.com> wrote:

> On Wed, Jan 22, 2025 at 2:05 PM SeongJae Park <sj@...nel.org> wrote:
> > damon_pa_pageout() from mm/damon/paddr.c also calls shrink_folio_list() similar
> > to madvise.c, but it doesn't aware such batching behavior.  Have you checked
> > that path?
> 
> Thanks for catching this path. In damon_pa_pageout(),
> shrink_folio_list() processes all pages from a single NUMA node that
> were collected (filtered) from a single DAMON region (r->ar.start to
> r->ar.end). This means it could be processing anywhere from 1 page up
> to ULONG_MAX pages from a single node at once.

Thank you Vinay.  That's same to my understanding, except that it is not
limited to a single NUMA node.  A region can have any start and end physical
addresses, so it could cover memory of different NUMA nodes.

> With the patch, we'll
> send a single IPI for TLB flush for the entire region, reducing IPIs
> by a factor equal to the number of pages being reclaimed by DAMON at
> once (decided by damon_reclaim_quota).

I guess the fact that the pages could belong to differnt NUMA nodes doesn't
make difference here?

> 
> My only concern here would be the overhead of maintaining the
> temporary pageout_list for batching. However, during BIO submission,
> the patch checks if the folio was reactivated, so submitting to BIO in
> bulk should be safe.
> 
> Another option would be to modify shrink_folio_list() to force batch
> flushes for up to N pages (512) at a time, rather than relying on
> callers to do the batching via folio_list.

Both sounds good to me :)


Thanks,
SJ

> 
> Thanks!
> Vinay

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ