All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Replacing PID bitmap implementation with IDR API
@ 2017-10-09 21:13 Gargi Sharma
  2017-10-09 21:13 ` [PATCH v4 1/2] pid: Replace pid " Gargi Sharma
  2017-10-09 21:13 ` [PATCH v4 2/2] pid: Remove pidhash Gargi Sharma
  0 siblings, 2 replies; 16+ messages in thread
From: Gargi Sharma @ 2017-10-09 21:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: riel, julia.lawall, akpm, mingo, pasha.tatashin, ktkhai, oleg,
	ebiederm, hch, Gargi Sharma

This patch series replaces kernel bitmap implementation of PID allocation
with IDR API. These patches are written to simplify the kernel by replacing custom code with calls to generic code.

The following are the stats for pid and pid_namespace object files
before and after the replacement. There is a noteworthy change between
the IDR and bitmap implementation.

Before
text       data        bss        dec        hex    filename
   8447       3894         64      12405       3075    kernel/pid.o
After
text       data        bss        dec        hex    filename
   3397        304          0       3701        e75    kernel/pid.o

Before
 text       data        bss        dec        hex    filename
   5692       1842        192       7726       1e2e    kernel/pid_namespace.o
After
text       data        bss        dec        hex    filename
   2854        216         16       3086        c0e    kernel/pid_namespace.o

The following are the stats for ps, pstree and calling readdir on /proc
for 10,000 processes.

ps:
        With IDR API    With bitmap
real    0m1.479s        0m2.319s
user    0m0.070s        0m0.060s
sys     0m0.289s        0m0.516s

pstree:
        With IDR API    With bitmap
real    0m1.024s        0m1.794s
user    0m0.348s        0m0.612s
sys     0m0.184s        0m0.264s

proc:
        With IDR API    With bitmap
real    0m0.059s        0m0.074s
user    0m0.000s        0m0.004s
sys     0m0.016s        0m0.016s

---
Changes in v4:
	- Make comments for alloc_pid clearer.
Changes in v3:
        - Replace idr_next with idr_get_cursor().
        - Correct pid_alloc so that find_pid_ns can't
          find not completely allocated pids.
Changes in v2:
        - Removed redundant  IDR function that was introduced
          in the previous patchset.
        - Renamed PIDNS_HASH_ADDING
        - Used idr_for_each_entry_continue()
        - Used idr_find() to lookup pids

Gargi Sharma (2):
  pid: Replace pid bitmap implementation with IDR API
  pid: Remove pidhash

 arch/powerpc/platforms/cell/spufs/sched.c |   2 +-
 fs/proc/loadavg.c                         |   2 +-
 include/linux/init_task.h                 |   1 -
 include/linux/pid.h                       |   2 -
 include/linux/pid_namespace.h             |  18 +--
 init/main.c                               |   3 +-
 kernel/fork.c                             |   2 +-
 kernel/pid.c                              | 245 ++++++------------------------
 kernel/pid_namespace.c                    |  48 ++----
 9 files changed, 68 insertions(+), 255 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-10-11 21:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 21:13 [PATCH v4 0/2] Replacing PID bitmap implementation with IDR API Gargi Sharma
2017-10-09 21:13 ` [PATCH v4 1/2] pid: Replace pid " Gargi Sharma
2017-10-09 23:17   ` Andrew Morton
2017-10-10 11:50     ` Oleg Nesterov
2017-10-10 12:35       ` Gargi Sharma
2017-10-10 14:15         ` Oleg Nesterov
2017-10-10 15:46         ` Rik van Riel
2017-10-10 16:11           ` Gargi Sharma
2017-10-10 17:51             ` Rik van Riel
2017-10-10 13:44       ` Rik van Riel
2017-10-09 21:13 ` [PATCH v4 2/2] pid: Remove pidhash Gargi Sharma
2017-10-11  9:47   ` kbuild test robot
2017-10-11 14:15     ` Rik van Riel
2017-10-11 14:15       ` Rik van Riel
2017-10-11 21:22       ` Luck, Tony
2017-10-11 21:22         ` Luck, Tony

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.