Re: [PATCH 4/5] mm/vmscan: Convert shrink_active_list() to use a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Jul 2022 21:53:04 +0100 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:

> On Fri, Jun 17, 2022 at 04:42:47PM +0100, Matthew Wilcox (Oracle) wrote:
> > @@ -2478,23 +2477,21 @@ static void shrink_active_list(unsigned long nr_to_scan,
> >  
> >  	while (!list_empty(&l_hold)) {
> >  		struct folio *folio;
> > -		struct page *page;
> >  
> >  		cond_resched();
> >  		folio = lru_to_folio(&l_hold);
> >  		list_del(&folio->lru);
> > -		page = &folio->page;
> >  
> > -		if (unlikely(!page_evictable(page))) {
> > -			putback_lru_page(page);
> > +		if (unlikely(!folio_evictable(folio))) {
> > +			folio_putback_lru(folio);
> >  			continue;
> >  		}
> >  
> >  		if (unlikely(buffer_heads_over_limit)) {
> > -			if (page_has_private(page) && trylock_page(page)) {
> > -				if (page_has_private(page))
> > -					try_to_release_page(page, 0);
> > -				unlock_page(page);
> > +			if (folio_get_private(folio) && folio_trylock(folio)) {
> > +				if (folio_get_private(folio))
> > +					filemap_release_folio(folio, 0);
> > +				folio_unlock(folio);
> >  			}
> >  		}
> >  
> 
> Hi Andrew.  Hugh points out that the above is not an equivalent
> transformation for pages which are in the swapcache.  Can you apply
> this fix, or would you like a full patch?
> 
> ...

The original is in mm-stable and rebasing that is bad (sigh) so I'll
add this as a standalone patch.  So yes, please send along the real
thing.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux