Re: [PATCH v6 01/27] mm: Introduce struct folio

From: Kirill A. Shutemov
Date: Tue Apr 06 2021 - 10:21:41 EST


On Tue, Apr 06, 2021 at 01:48:07PM +0100, Matthew Wilcox wrote:
> Now, maybe we should put this optimisation into the definition of nth_page?

Sounds like a good idea to me.

> > > +struct folio {
> > > + /* private: don't document the anon union */
> > > + union {
> > > + struct {
> > > + /* public: */
> > > + unsigned long flags;
> > > + struct list_head lru;
> > > + struct address_space *mapping;
> > > + pgoff_t index;
> > > + unsigned long private;
> > > + atomic_t _mapcount;
> > > + atomic_t _refcount;
> > > +#ifdef CONFIG_MEMCG
> > > + unsigned long memcg_data;
> > > +#endif
> >
> > As Christoph, I'm not a fan of this :/
>
> What would you prefer?

I liked earlier approach with only struct page here. Once we know a field
should never be referenced from raw struct page, we can move it here.

But feel free to ignore my suggestion. It's not show-stopper for me and
reverting is back doesn't worth it.

I went through the patchset and it looks good. You can use my

Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

on all of them.

Thanks a lot for doing this.

--
Kirill A. Shutemov