linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH 2/4] slab: Convert __kmalloc_large_node() and free_large_kmalloc() to use folios
Date: Sat, 23 Dec 2023 06:09:21 +0000	[thread overview]
Message-ID: <ZYZ5kW+ofOSgPTla@casper.infradead.org> (raw)
In-Reply-To: <CAB=+i9TeoeeAXcb7Q_z3=vmNgQC-8A01YkJpU+S=XUnuNMXOmg@mail.gmail.com>

On Sat, Dec 23, 2023 at 08:11:11AM +0900, Hyeonggon Yoo wrote:
> > +       folio = folio_alloc_node(flags, order, node);
> 
> folio_alloc_node()
> ->__folio_alloc_node()
> ->__folio_alloc()
> ->page_rmappable_folio()
> ->folio_prep_large_rmappable()
> 
> I think it's not intentional to call this?

I've been thinking about this, and obviously I got bitten by two of
the meanings of folio (both "not a tail page" and "mmapable memory").
And that leads me to thinking about how this will look when we allocate
memdescs separately from pages.

I don't think we should try to keep memcg_data at the same offset in
struct slab and struct folio (once we're out of our current transitional
period).  So we need to stop casting from folio to slab and vice versa.
Which means that slab can't call __lruvec_stat_mod_folio().

I'll try and get something together to support this, both for the
current layout and once memdescs are separated from struct page.


  parent reply	other threads:[~2023-12-23  6:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 20:28 [PATCH 0/4] Remove some lruvec page accounting functions Matthew Wilcox (Oracle)
2023-12-22 20:28 ` [PATCH 1/4] mm: Remove inc/dec lruvec page state functions Matthew Wilcox (Oracle)
2023-12-22 20:28 ` [PATCH 2/4] slab: Convert __kmalloc_large_node() and free_large_kmalloc() to use folios Matthew Wilcox (Oracle)
2023-12-22 23:11   ` Hyeonggon Yoo
2023-12-22 23:13     ` Matthew Wilcox
2023-12-23  6:09     ` Matthew Wilcox [this message]
2023-12-27 22:01   ` Andrew Morton
2023-12-28  4:15     ` Hyeonggon Yoo
2024-01-02 15:58     ` Vlastimil Babka
2023-12-22 20:28 ` [PATCH 3/4] mm/khugepaged: Use a folio more in collapse_file() Matthew Wilcox (Oracle)
2023-12-22 20:28 ` [PATCH 4/4] mm/memcontrol: Remove __mod_lruvec_page_state() Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZYZ5kW+ofOSgPTla@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox