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] [day] [month] [year] [list]
Date:   Tue, 10 May 2022 14:44:38 -0700
From:   Minchan Kim <minchan@...nel.org>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Michal Hocko <mhocko@...e.com>,
        John Dias <joaodias@...gle.com>,
        Tim Murray <timmurray@...gle.com>,
        Matthew Wilcox <willy@...radead.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Martin Liu <liumartin@...gle.com>
Subject: Re: [PATCH v3] mm: don't be stuck to rmap lock on reclaim path

On Tue, May 10, 2022 at 02:16:07PM -0400, Johannes Weiner wrote:
> Hi Minchan,
> 
> The patch looks reasonable to me, but one thing stands out:
> 
> On Tue, May 10, 2022 at 10:11:00AM -0700, Minchan Kim wrote:
> > @@ -1391,6 +1391,10 @@ static enum page_references folio_check_references(struct folio *folio,
> >  	if (vm_flags & VM_LOCKED)
> >  		return PAGEREF_ACTIVATE;
> >  
> > +	/* page_referenced didn't work due to lock contention */
> > +	if (referenced_ptes == -1)
> > +		return PAGEREF_KEEP;
> > +
> >  	if (referenced_ptes) {
> >  		/*
> >  		 * All mapped folios start out with page table
> 
> This means contended inactive pages get rotated.
> 
> > @@ -2492,7 +2496,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
> >  		}
> >  
> >  		if (folio_referenced(folio, 0, sc->target_mem_cgroup,
> > -				     &vm_flags)) {
> > +				     &vm_flags) > 0) {
> >  			/*
> >  			 * Identify referenced, file-backed active pages and
> >  			 * give them one more trip around the active list. So
> 
> This means contended active pages do NOT get rotated.
> 
> It's a bit of an arbitrary choice what to do with reclaim candidates
> for which you can get no reference information, but staying consistent
> is likely a good idea. My preference would be to just rotate contended
> pages throughout rather than risk dropping the workingset on the floor.
> 
> 		/* Referenced or rmap lock contention: rotate */
> 		if (folio_referenced() != 0) {
> 			...
> 
> What do you think?

Sure, it's good start before adding more heuristic later.

Thanks for the review. I will post v4.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ