Re: [PATCH 1/2] pagevec: Allow pagevecs to be different sizes

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

 



On Fri, Nov 06, 2020 at 02:18:40PM -0800, Tim Chen wrote:
> On 11/6/20 11:12 AM, Matthew Wilcox wrote:
> > I have a number of changes already in that area that are currently in-flight.
> > https://lore.kernel.org/linux-mm/20201026041408.25230-1-willy@xxxxxxxxxxxxx/
> > 
> > (although I should modify patch 9/12 to not use PAGEVEC_SIZE directly)
> 
> Okay. I assume that you are using pagevec_size somewhere to replace those
> hardcoded PAGEVEC_SIZE somewhere.

Ah.  I felt I should add it, as a counterpart to pagevec_count().
But most users don't need to ask what size the pagevec is; they just
add pages to it until it's full.  eg:

        pvec = this_cpu_ptr(&lru_pvecs.lru_add);
        if (!pagevec_add(pvec, page) || PageCompound(page))
                __pagevec_lru_add(pvec);

so as long as it's right in pagevec_add(), it'll be fine:

static inline unsigned pagevec_add(struct pagevec *pvec, struct page *page)
{
        pvec->pages[pvec->nr++] = page;
        return pagevec_space(pvec);
}

and I fix pagevec_space in patch 1:

        return pvec->sz - pvec->nr;





[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