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]
Date: Tue, 30 Jan 2024 12:58:12 -0800
From: "T.J. Mercier" <tjmercier@...gle.com>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Michal Hocko <mhocko@...e.com>, Roman Gushchin <roman.gushchin@...ux.dev>, 
	Shakeel Butt <shakeelb@...gle.com>, Muchun Song <muchun.song@...ux.dev>, 
	Andrew Morton <akpm@...ux-foundation.org>, android-mm@...gle.com, yuzhao@...gle.com, 
	yangyifei03@...ishou.com, cgroups@...r.kernel.org, linux-mm@...ck.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Revert "mm:vmscan: fix inaccurate reclaim during
 proactive reclaim"

On Fri, Jan 26, 2024 at 8:41 AM T.J. Mercier <tjmercier@...gle.com> wrote:
>
> On Fri, Jan 26, 2024 at 8:34 AM Johannes Weiner <hannes@...xchg.org> wrote:
> >
> > On Wed, Jan 24, 2024 at 09:46:23AM -0800, T.J. Mercier wrote:
> > > In the meantime, instead of a revert how about changing the batch size
> > > geometrically instead of the SWAP_CLUSTER_MAX constant:
> > >
> > >                 reclaimed = try_to_free_mem_cgroup_pages(memcg,
> > > -                                       min(nr_to_reclaim -
> > > nr_reclaimed, SWAP_CLUSTER_MAX),
> > > +                                       (nr_to_reclaim - nr_reclaimed)/2,
> > >                                         GFP_KERNEL, reclaim_options);
> > >
> > > I think that should address the overreclaim concern (it was mentioned
> > > that the upper bound of overreclaim was 2 * request), and this should
> > > also increase the reclaim rate for root reclaim with MGLRU closer to
> > > what it was before.
> >
> > Hahaha. Would /4 work for you?
> >
> > I genuinely think the idea is worth a shot. /4 would give us a bit
> > more margin for error, since the bailout/fairness cutoffs have changed
> > back and forth over time. And it should still give you a reasonable
> > convergence on MGLRU.
> >
> > try_to_free_reclaim_pages() already does max(nr_to_reclaim,
> > SWAP_CLUSTER_MAX) which will avoid the painful final approach loops
> > the integer division would produce on its own.
> >
> > Please add a comment mentioning the compromise between the two reclaim
> > implementations though.
>
> I'll try it out and get back to you. :)

Right, so (nr_to_reclaim - nr_reclaimed)/4 looks pretty good to me:

root - full reclaim       pages/sec   time (sec)
pre-0388536ac291      :    68047        10.46
post-0388536ac291     :    13742        inf
(reclaim-reclaimed)/4 :    67352        10.51

/uid_0 - 1G reclaim       pages/sec   time (sec)  overreclaim (MiB)
pre-0388536ac291      :    258822       1.12            107.8
post-0388536ac291     :    105174       2.49            3.5
(reclaim-reclaimed)/4 :    233396       1.12            -7.4

/uid_0 - full reclaim     pages/sec   time (sec)
pre-0388536ac291      :    72334        7.09
post-0388536ac291     :    38105        14.45
(reclaim-reclaimed)/4 :    72914        6.96

So I'll put up a new patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ