BPF List
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Naohiro Aota <naohiro.aota@wdc.com>,
	viro@zeniv.linux.org.uk, brauner@kernel.org, cem@kernel.org,
	hch@lst.de, djwong@kernel.org, dgc@kernel.org, jack@suse.cz,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	dlemoal@kernel.org, Hans Holmberg <hans.holmberg@wdc.com>,
	Anuj Gupta <anuj20.g@samsung.com>,
	Kanchan Joshi <joshi.k@samsung.com>
Subject: Re: [PATCH 0/6] xfs: BPF data placement policy for zoned file systems
Date: Tue, 1 Dec 2026 10:15:28 +0100	[thread overview]
Message-ID: <20261201091528.GA27736@lst.de> (raw)
In-Reply-To: <DN94O5A0VHG4.20DQ0YGD1VAAA@gmail.com>

On Tue, Dec 01, 2026 at 04:56:50AM +0000, Alexei Starovoitov wrote:
> You waited since ALPSS to send this?
> Sorry, but the whole thing is an overkill if 'hint' is the only goal. 
> Here is a much simpler alternative:

I have no idea how you think this helps?

>   SEC("lsm/file_open")

Requiring LSM privileges for hints is not helpful.

>
>   int BPF_PROG(set_hint, struct file *file)
>   {
>           struct dentry *dentry = file->f_path.dentry;
>           struct key key = {
>                   .dev = dentry->d_sb->s_dev,
>                   .dir = dentry->d_parent->d_inode->i_ino,

FYI, ->d_parent dereferences aren't stable.

>           };
>           u64 *hint;
> 
>           if (!(file->f_mode & FMODE_WRITE))
>                   return 0;
>           hint = bpf_map_lookup_elem(&hints, &key);
>           if (hint)
>                   bpf_file_set_write_hint(file, *hint);

This assumes you want to set hints on specific and not relative
path, and encodes a really bad and mostly broken ABI in a userspace
ABI due to the shared maps.  But even with that you can't easily
match for cgroup ID and other bits in here.  And for anything we'd
want to deploy the concept of a shared map with an implicit ABI
is just a nightmare.


      reply	other threads:[~2026-12-01  9:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  4:34 [PATCH 0/6] xfs: BPF data placement policy for zoned file systems Naohiro Aota
2026-12-01  4:34 ` [PATCH 1/6] fs: add fs_dp BPF struct_ops for file data placement Naohiro Aota
2026-12-01  4:45   ` sashiko-bot
2026-12-01  4:34 ` [PATCH 2/6] bpf: allow fs_dp struct_ops programs to call FS kfuncs Naohiro Aota
2026-12-01  4:34 ` [PATCH 3/6] xfs: add BPF data placement hook at file open Naohiro Aota
2026-12-01  4:49   ` sashiko-bot
2026-12-01  4:34 ` [PATCH 4/6] xfs: add ioctls to select a BPF data placement policy Naohiro Aota
2026-12-01  4:34 ` [PATCH 5/6] xfs: bind a BPF data placement policy to a project ID Naohiro Aota
2026-12-01  4:34 ` [PATCH 6/6] xfs: let XFS_IOC_{SET,GET}_DP_OPS act on " Naohiro Aota
2026-12-01  4:37 ` [PATCH 1/2] fs_dp: let a policy pick a write stream Naohiro Aota
2026-12-01  4:37   ` [PATCH 2/2] xfs: bind write streams along with a data placement policy Naohiro Aota
2026-12-01  4:56 ` [PATCH 0/6] xfs: BPF data placement policy for zoned file systems Alexei Starovoitov
2026-12-01  9:15   ` Christoph Hellwig [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=20261201091528.GA27736@lst.de \
    --to=hch@lst.de \
    --cc=alexei.starovoitov@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hans.holmberg@wdc.com \
    --cc=jack@suse.cz \
    --cc=joshi.k@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=viro@zeniv.linux.org.uk \
    /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