Linux userland API discussions
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Theodore Tso <tytso@mit.edu>,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	linux-f2fs-devel@lists.sourceforge.net,
	Christoph Hellwig <hch@infradead.org>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	Akilesh Kailash <akailash@google.com>,
	Christian Brauner <christian@brauner.io>
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: another way to set large folio by remembering inode number
Date: Tue, 26 May 2026 04:12:32 +0000	[thread overview]
Message-ID: <ahUdsKSVV65qSvDm@google.com> (raw)
In-Reply-To: <8a42abed-8289-44ec-a144-dfe531a4af71@infradead.org>

On 05/25, Randy Dunlap wrote:
> 
> 
> On 5/25/26 6:10 PM, Jaegeuk Kim wrote:
> > On 05/22, Theodore Tso wrote:
> >> On Fri, May 22, 2026 at 05:08:41PM +0000, Jaegeuk Kim wrote:
> >>>
> >>> Thank you for the explanation. It seems I made a wrong assumption on the
> >>> usage of "user." prefix where each filesystem can support in different
> >>> ways.
> >>
> >> The "user." prefix is used by all userspace applications that wish to
> >> store extended attributes.  For example, user.mime_type,
> >> user.xdg.origin_url, user.charset, user.appache_handler, etc
> >>
> >> For more information, see:
> >>
> >>     https://www.freedesktop.org/wiki/CommonExtendedAttribute
> >>     https://wiki.archlinux.org/title/Extended_attributes
> >>
> >> I certainly assumed this was common knowledge across all file system
> >> maintainers, but this was apparently not true in your case.  I don't
> >> know how this could be the case given that f2fs implements extended
> >> attributes, and I would have thought you would have known that when
> >> testing that feature.
> >>
> >>> I shared some motivation when replying to Darrick's feedback [1], but yes,
> >>> it was not enough for all heads-up. The problem started that some speicific
> >>> application needs as many high-order pages as possible mostly for reads. So,
> >>> I thought we can turn on large folio on the specific files per hints. One way
> >>> for the hints was using immutable bit, but it turned out it's very hard to
> >>> manage disabling the bit whenever deleting the files. Along with limited
> >>> ioctl() and requiring inode eviction to manage large folio activation, I had
> >>> to implement this path.
> >>>
> >>> [1] https://lore.kernel.org/lkml/aeA5C8byIpXWla7f@google.com/
> >>
> >> Actually, you still haven't explained your use case, at least, not
> >> well enough for me to understand what you are trying to do.
> >>
> >> So an application wants a particular file to use as many high-order
> >> pages as possible.  Why?  What sort of guarantees do you need to
> >> provide?  What happens if they can't be provided?  What happens if a
> >> possibly malicious, or at least gready, application uses this
> >> interface to grab a lot of high-order pages?
> >>
> >> >From your patch:
> >>
> >> 1. setxattr(file, "user.fadvise", &value, sizeof(unsigned int), 0)
> >>  -> register the inode number for large folio
> >> 2. chmod(0400, file)
> >>  -> make Read-Only
> >> 3. open()
> >>  -> f2fs_iget() with large folio
> >> 4. open(WRITE), mkwrite on mmap, chmod(WRITE)
> >>  -> return error
> >> 5. iput() and open()
> >>  -> goto #3
> >> 6. unlink
> >>  -> deregister the inode number
> >>
> >> Why should making the file read-only matter?  And when you say
> >> "derigster the inode number", why should this be related to deleting
> >> the inode?
> >>
> >> This is an interface which seems to be very specific to your use case.
> >> What if those requirements change over time?  What if you want pull in
> >> a file without making it be read-only?  And what if you want to
> >> release the large-order pages without deleting the file?
> > 
> > Let me try to write more details, helped with Gemini.
> 
> [as an interested reader:]
> 
> If this idea is so good, why shouldn't it be done in the VFS/MM so that
> other filesystems could do the same thing instead of just in f2fs?

Thanks for the feedback. I'm really open, but just trying to understand it's
good or not. If it's so bad at all, I'd be really ready to drop it even the
ioctl approach, even though I already prepared its implementation.

>
> 
> -- 
> ~Randy
> 

  reply	other threads:[~2026-05-26  4:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260409134538.3692605-1-jaegeuk@kernel.org>
     [not found] ` <adhPZxtbZxgU-37v@google.com>
2026-04-14  8:02   ` [PATCH v2] f2fs: another way to set large folio by remembering inode number Christoph Hellwig
2026-04-15 16:44     ` Jaegeuk Kim
2026-04-15 17:15       ` Matthew Wilcox
2026-04-15 22:02         ` Jaegeuk Kim
2026-04-15 23:49           ` Darrick J. Wong
2026-04-16  1:19             ` Jaegeuk Kim
2026-05-21  8:51         ` Christoph Hellwig
2026-05-21 15:57           ` Theodore Tso
2026-05-21 17:42             ` Matthew Wilcox
2026-05-22  3:59               ` Jaegeuk Kim
2026-05-22 12:55                 ` Matthew Wilcox
2026-05-22 14:04                   ` [f2fs-dev] " Jaegeuk Kim
2026-05-25  5:34                     ` Christoph Hellwig
2026-05-26  1:21                       ` Jaegeuk Kim
2026-05-26  2:31                         ` Matthew Wilcox
2026-05-26  3:47                           ` Jaegeuk Kim
2026-05-25  5:34               ` Christoph Hellwig
2026-05-22  3:32             ` [f2fs-dev] " Jaegeuk Kim
2026-05-22  3:53               ` Eric Biggers
2026-05-22  4:02                 ` Jaegeuk Kim
2026-05-22 10:01                 ` Christian Brauner
2026-05-22 14:11               ` Theodore Tso
2026-05-22 17:08                 ` Jaegeuk Kim
2026-05-22 22:41                   ` Theodore Tso
2026-05-26  1:10                     ` Jaegeuk Kim
2026-05-26  2:35                       ` Matthew Wilcox
2026-05-26  3:34                         ` Jaegeuk Kim
2026-05-26  3:35                       ` Randy Dunlap
2026-05-26  4:12                         ` Jaegeuk Kim [this message]
2026-05-26 13:42                       ` Theodore Tso
2026-05-25  5:37               ` Christoph Hellwig
2026-05-22  9:59             ` Christian Brauner
2026-04-15 16:41   ` Jaegeuk Kim

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=ahUdsKSVV65qSvDm@google.com \
    --to=jaegeuk@kernel.org \
    --cc=akailash@google.com \
    --cc=christian@brauner.io \
    --cc=hch@infradead.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rdunlap@infradead.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.org \
    /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