Re: [PATCH -next 4/8] mm: damon: add temporary damon_get_folio()

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

 



On Tue, 13 Dec 2022 14:40:41 +0000 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:

> On Tue, Dec 13, 2022 at 05:27:31PM +0800, Kefeng Wang wrote:
> > -struct page *damon_get_page(unsigned long pfn)
> > +struct folio *damon_get_folio(unsigned long pfn)
> >  {
> > -	struct page *page = pfn_to_online_page(pfn);
> > +	struct folio *folio = pfn_to_online_folio(pfn);
> >  
> > -	if (!page || !PageLRU(page) || !get_page_unless_zero(page))
> > +	if (!folio || !folio_test_lru(folio) || !folio_try_get(folio))
> >  		return NULL;
> 
> Well, this is awkward.  I asked Vishal to think about exactly this problem
> and we were going to talk about it after we're both back from vacation
> in January.  But I guess we're going to do this in public instead ...
> 
> Specifically, what should the semantics be for a putative
> damon_get_folio() when it encounters a tail page?  Should it return
> the containing folio, or should it return NULL?  And if the semantics
> change here to return the containing folio, what adjustments need to
> be made to the callers?

I'd prefer to simply keep the original behavior, returning NULL, for now unless
someone complaints.


Thanks,
SJ




[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