Re: [PATCH v3 01/25] mm: Introduce struct folio

2021-03-02 Thread Zi Yan
On 2 Mar 2021, at 8:22, Matthew Wilcox wrote: > On Mon, Mar 01, 2021 at 03:26:11PM -0500, Zi Yan wrote: >>> +static inline struct folio *next_folio(struct folio *folio) >>> +{ >>> + return folio + folio_nr_pages(folio); >> >> Are you planning to make hugetlb use folio too? >> >> If yes, this

Re: [PATCH v3 01/25] mm: Introduce struct folio

2021-03-02 Thread Matthew Wilcox
On Mon, Mar 01, 2021 at 03:26:11PM -0500, Zi Yan wrote: > > +static inline struct folio *next_folio(struct folio *folio) > > +{ > > + return folio + folio_nr_pages(folio); > > Are you planning to make hugetlb use folio too? > > If yes, this might not work if we have CONFIG_SPARSEMEM && >

Re: [PATCH v3 01/25] mm: Introduce struct folio

2021-03-01 Thread Zi Yan
On 1 Mar 2021, at 15:53, Matthew Wilcox wrote: > On Mon, Mar 01, 2021 at 03:26:11PM -0500, Zi Yan wrote: >>> +static inline struct folio *next_folio(struct folio *folio) >>> +{ >>> + return folio + folio_nr_pages(folio); >> >> Are you planning to make hugetlb use folio too? > > Eventually,

Re: [PATCH v3 01/25] mm: Introduce struct folio

2021-03-01 Thread Matthew Wilcox
On Mon, Mar 01, 2021 at 03:26:11PM -0500, Zi Yan wrote: > > +static inline struct folio *next_folio(struct folio *folio) > > +{ > > + return folio + folio_nr_pages(folio); > > Are you planning to make hugetlb use folio too? Eventually, probably. It's not my focus. > If yes, this might not

Re: [PATCH v3 01/25] mm: Introduce struct folio

2021-03-01 Thread Zi Yan
On 28 Jan 2021, at 2:03, Matthew Wilcox (Oracle) wrote: > We have trouble keeping track of whether we've already called > compound_head() to ensure we're not operating on a tail page. Further, > it's never clear whether we intend a struct page to refer to PAGE_SIZE > bytes or

[PATCH v3 01/25] mm: Introduce struct folio

2021-01-27 Thread Matthew Wilcox (Oracle)
We have trouble keeping track of whether we've already called compound_head() to ensure we're not operating on a tail page. Further, it's never clear whether we intend a struct page to refer to PAGE_SIZE bytes or page_size(compound_head(page)). Introduce a new type 'struct folio' that always