Skip to content

proc: improve root readdir latency with many threads

Brian Foster linux-fsdevel linux-mm lkml oe-lkp 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 6 repliesIn review
  2. v24 patches 1 replySuperseded
  3. v13 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- Drop radix-tree fixups.
- Convert pid idr usage to xarray.
- Replace tgid radix-tree tag set/lookup to use xarray mark.
v2: https://lore.kernel.org/linux-fsdevel/[email protected]/
- Clean up idr helpers to be more generic.
- Use ->idr_base properly.
- Lift tgid iteration helper into pid.c to abstract tag logic from users.
v1: https://lore.kernel.org/linux-fsdevel/[email protected]/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5pid: replace pidmap_lock with xarray lockkernel/pid.c+40 -391 reply
2/5pid: split cyclic id allocation cursor from idrarch/powerpc/platforms/cell/spufs/sched.c fs/proc/loadavg.c include/linux/pid_namespace.h +2 more+9 -61 reply
3/5pid: switch pid_namespace from idr to xarrayinclude/linux/pid_namespace.h include/linux/threads.h init/main.c +2 more+51 -591 reply
4/5pid: mark pids associated with group leader tasksinclude/linux/pid.h kernel/fork.c kernel/pid.c+46 -31 reply
5/5procfs: use efficient tgid pid search on root readdirfs/proc/base.c+1 -161 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchIan Kent
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] proc: improve root readdir latency with many threads

Hi all,

Here's v3 of the /proc readdir optimization patches. See v1 for the full introductary cover letter.

Most of the feedback received to this point has been around switching the pid code over to use the xarray api instead of the idr. Matt Wilcox posted most of the code to do that. I cleaned it up a bit and posted a standalone series for that here [1], but didn't receive any feedback. Patches 1-3 of this series are essentially a repost of [1].

Patches 4-5 are otherwise mostly the same as v2 outside of switching over to use the xarray bits instead of the idr/radix-tree.

Thoughts, reviews, flames appreciated.

Brian

[1] https://lore.kernel.org/linux-mm/[email protected]/

v3:
- Drop radix-tree fixups.
- Convert pid idr usage to xarray.
- Replace tgid radix-tree tag set/lookup to use xarray mark.
v2: https://lore.kernel.org/linux-fsdevel/[email protected]/
- Clean up idr helpers to be more generic.
- Use ->idr_base properly.
- Lift tgid iteration helper into pid.c to abstract tag logic from users.
v1: https://lore.kernel.org/linux-fsdevel/[email protected]/

Brian Foster (5):
pid: replace pidmap_lock with xarray lock
pid: split cyclic id allocation cursor from idr
pid: switch pid_namespace from idr to xarray
pid: mark pids associated with group leader tasks
procfs: use efficient tgid pid search on root readdir

 arch/powerpc/platforms/cell/spufs/sched.c |   2 +-
 fs/proc/base.c                            |  17 +--
 fs/proc/loadavg.c                         |   2 +-
 include/linux/pid.h                       |   3 +-
 include/linux/pid_namespace.h             |   9 +-
 include/linux/threads.h                   |   2 +-
 init/main.c                               |   3 +-
 kernel/fork.c                             |   2 +-
 kernel/pid.c                              | 177 +++++++++++++---------
 kernel/pid_namespace.c                    |  23 ++-
 10 files changed, 132 insertions(+), 108 deletions(-)
Signature · 1 line
2.37.3