summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-09-26 15:44:30 +0200
committerChristian Brauner <brauner@kernel.org>2026-09-26 15:47:41 +0200
commit57088a37b2e4d194a2ae5027134b780a36acd900 (patch)
tree7c0612b2db47c004c736817153aa60b98f2efb8b /tools/perf/scripts/python/stackcollapse.py
parent02587a4af82adccaef8e3b3624b4e7f1c401632d (diff)
downloadlinux-57088a37b2e4d194a2ae5027134b780a36acd900.tar.gz
linux-57088a37b2e4d194a2ae5027134b780a36acd900.zip
fs: put the old fs_struct before the old namespaces in unshare()
unshare(CLONE_NEWNS) always copies the fs_struct and copy_mnt_ns() points root and pwd of that copy into the new mount namespace. The old fs_struct pins the old root and pwd until ksys_unshare() frees it at the end and switch_task_namespaces() will already put the old mount namespace before. This causes pointless work in user namespaces because the copied mounts are locked and stay connected. Switch and free the fs_struct before switching the namespaces. The old root and pwd are wasted while their mount namespace is still alive which also keeps both puts on the mntput() fast path. setns() already does this right as it updates root and pwd before the namespaces are switched. Link: https://patch.msgid.link/20260926-work-mount-fixes-2-v1-7-f357abf3d17b@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions