All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] two nits for path lookup
@ 2025-04-16 22:16 Mateusz Guzik
  2025-04-16 22:16 ` [PATCH 1/2] fs: touch up predicts in inode_permission() Mateusz Guzik
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Mateusz Guzik @ 2025-04-16 22:16 UTC (permalink / raw)
  To: brauner; +Cc: torvalds, viro, jack, linux-kernel, linux-fsdevel, Mateusz Guzik

since path looku is being looked at, two extra nits from me:

1. some trivial jump avoidance in inode_permission()

2. but more importantly avoiding a memory access which is most likely a
cache miss when descending into devcgroup_inode_permission()

the file seems to have no maintainer fwiw

anyhow I'm confident the way forward is to add IOP_FAST_MAY_EXEC (or
similar) to elide inode_permission() in the common case to begin with.
There are quite a few branches which straight up don't need execute.
On top of that btrfs has a permission hook only to check for MAY_WRITE,
which in case of path lookup is not set. With the above flag the call
will be avoided.

Mateusz Guzik (2):
  fs: touch up predicts in inode_permission()
  device_cgroup: avoid access to ->i_rdev in the common case in
    devcgroup_inode_permission()

 fs/namei.c                    | 10 +++++-----
 include/linux/device_cgroup.h |  7 ++++---
 2 files changed, 9 insertions(+), 8 deletions(-)

-- 
2.48.1


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

end of thread, other threads:[~2025-04-17  9:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 22:16 [PATCH 0/2] two nits for path lookup Mateusz Guzik
2025-04-16 22:16 ` [PATCH 1/2] fs: touch up predicts in inode_permission() Mateusz Guzik
2025-04-16 22:16 ` [PATCH 2/2] device_cgroup: avoid access to ->i_rdev in the common case in devcgroup_inode_permission() Mateusz Guzik
2025-04-16 22:35 ` [PATCH 0/2] two nits for path lookup Mateusz Guzik
2025-04-16 22:39 ` Linus Torvalds
2025-04-17  8:13 ` Christian Brauner
2025-04-17  9:04 ` Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.