linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] cheaper MAY_EXEC handling for path lookup
@ 2025-11-07 14:21 Mateusz Guzik
  2025-11-07 14:21 ` [PATCH v3 1/3] fs: speed up path lookup with cheaper handling of MAY_EXEC Mateusz Guzik
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Mateusz Guzik @ 2025-11-07 14:21 UTC (permalink / raw)
  To: brauner
  Cc: viro, jack, linux-kernel, linux-fsdevel, linux-ext4, tytso,
	torvalds, josef, linux-btrfs, Mateusz Guzik

Commit message in patch 1 says it all.

In short, MAY_WRITE checks are elided.

This obsoletes the idea of pre-computing if perm checks are necessary as
that turned out to be too hairy. The new code has 2 more branches per
path component compared to that idea, but the perf difference for
typical paths (< 6 components) was basically within noise. To be
revisited if someone(tm) removes other slowdowns.

Instead of the pre-computing thing I added IOP_FASTPERM_MAY_EXEC so that
filesystems like btrfs can still avoid the hard work.

v3:
- drop the pre-computation idea and inline the perm check
- add IOP_FASTPERM_MAY_EXEC for filesystems with ->permission hooks so
  that they can also take advantage of it

Mateusz Guzik (3):
  fs: speed up path lookup with cheaper handling of MAY_EXEC
  btrfs: utilize IOP_FASTPERM_MAY_EXEC
  fs: retire now stale MAY_WRITE predicts in inode_permission()

 fs/btrfs/inode.c   | 12 +++++++++++-
 fs/namei.c         | 47 ++++++++++++++++++++++++++++++++++++++++++----
 include/linux/fs.h | 13 +++++++------
 3 files changed, 61 insertions(+), 11 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-11 11:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 14:21 [PATCH v3 0/3] cheaper MAY_EXEC handling for path lookup Mateusz Guzik
2025-11-07 14:21 ` [PATCH v3 1/3] fs: speed up path lookup with cheaper handling of MAY_EXEC Mateusz Guzik
2025-11-10  9:32   ` Jan Kara
2025-11-10  9:46     ` Mateusz Guzik
2025-11-10 10:13       ` Jan Kara
2025-11-10 12:42         ` Mateusz Guzik
2025-11-11  9:41   ` Christian Brauner
2025-11-11 10:51     ` Mateusz Guzik
2025-11-11 11:47       ` Mateusz Guzik
2025-11-07 14:21 ` [PATCH v3 2/3] btrfs: utilize IOP_FASTPERM_MAY_EXEC Mateusz Guzik
2025-11-10 15:40   ` David Sterba
2025-11-07 14:21 ` [PATCH v3 3/3] fs: retire now stale MAY_WRITE predicts in inode_permission() Mateusz Guzik
2025-11-10 10:15   ` Jan Kara
2025-11-11  9:42 ` [PATCH v3 0/3] cheaper MAY_EXEC handling for path lookup Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).