mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Cc: "anishm7030@gmail.com" <anishm7030@gmail.com>,
	"jack@suse.cz" <jack@suse.cz>,
	"brauner@kernel.org" <brauner@kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"dlemoal@kernel.org" <dlemoal@kernel.org>,
	"lorenzo.stoakes@oracle.com" <lorenzo.stoakes@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ramfs: convert alloc_pages() to folio_alloc() in ramfs_nommu_expand_for_mapping()
Date: Wed, 25 Feb 2026 22:18:22 +0000	[thread overview]
Message-ID: <aZ91LpkKStjWXTZD@casper.infradead.org> (raw)
In-Reply-To: <9a40c9e323e30b61527f96796e10daffef5d06e7.camel@ibm.com>

On Wed, Feb 25, 2026 at 06:44:28PM +0000, Viacheslav Dubeyko wrote:
> CC: linux-fsdevel@vger.kernel.org

Good plan.

> On Tue, 2026-02-24 at 15:31 -0500, AnishMulay wrote:
> > Currently, ramfs_nommu_expand_for_mapping() utilizes the deprecated
> > alloc_pages() API. This patch converts the allocation step to use

alloc_pages() is not deprecated.  There are no plans for its removal.

> > the modern folio_alloc() API, removing a legacy caller and helping
> > pave the way for the eventual removal of alloc_pages().
> > 
> > Because nommu architectures require physically contiguous memory that
> > often needs to be trimmed to the exact requested size, the allocated
> > folio is immediately shattered using split_page().

Except that split_page() doesn't work on folios.  It says so right there
in the documentation:

 * split_page takes a non-compound higher-order page, and splits it into

Folios are compound pages.  This should have told you that you were
going the wrong thing.

> > Since split_page() destroys the compound folio metadata, using folio
> > iteration helpers (like folio_page) becomes unsafe. Therefore, this
> > patch deliberately drops back to a standard struct page array after
> > the split. This safely isolates the folio conversion to the allocation
> > phase while strictly preserving the existing trimming and page cache
> > insertion behavior.

Please stop trying to help, particularly for code you can't test.

      reply	other threads:[~2026-02-25 22:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 20:31 AnishMulay
2026-02-25 18:44 ` Viacheslav Dubeyko
2026-02-25 22:18   ` Matthew Wilcox [this message]

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=aZ91LpkKStjWXTZD@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Slava.Dubeyko@ibm.com \
    --cc=anishm7030@gmail.com \
    --cc=brauner@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    /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

all inboxes | Powered by JetHome®