1
0
Fork 0
alistair23-linux/arch/powerpc/platforms/cell
Gargi Sharma 95846ecf9d pid: replace pid bitmap implementation with IDR API
Patch series "Replacing PID bitmap implementation with IDR API", v4.

This 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

This patch (of 2):

Replace the current bitmap implementation for Process ID allocation.
Functions that are no longer required, for example, free_pidmap(),
alloc_pidmap(), etc.  are removed.  The rest of the functions are
modified to use the IDR API.  The change was made to make the PID
allocation less complex by replacing custom code with calls to generic
API.

[gs051095@gmail.com: v6]
  Link: http://lkml.kernel.org/r/1507760379-21662-2-git-send-email-gs051095@gmail.com
[avagin@openvz.org: restore the old behaviour of the ns_last_pid sysctl]
  Link: http://lkml.kernel.org/r/20171106183144.16368-1-avagin@openvz.org
Link: http://lkml.kernel.org/r/1507583624-22146-2-git-send-email-gs051095@gmail.com
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-17 16:10:03 -08:00
..
spufs pid: replace pid bitmap implementation with IDR API 2017-11-17 16:10:03 -08:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
axon_msi.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
cbe_powerbutton.c powerpc: Fix up modules that should be including module.h 2011-10-31 19:30:38 -04:00
cbe_regs.c powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
cbe_thermal.c powerpc/cell: cbe_thermal.c: Cleaning up a variable is of the wrong type 2014-06-24 14:05:59 +10:00
cell.h powerpc/cell: Move controller ops from ppc_md to controller_ops 2015-04-11 20:49:17 +10:00
cpufreq_spudemand.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/loadavg.h> 2017-03-02 08:42:27 +01:00
interrupt.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
interrupt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iommu.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
pervasive.c powerpc/cbe: Do not process external or decremeter interrupts from sreset 2017-04-28 21:02:25 +10:00
pervasive.h powerpc/cell: Cleanup sysreset_hack for IBM cell blades 2008-07-22 10:39:31 +10:00
pmu.c powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
ras.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
ras.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
setup.c powerpc/64: Move 64-bit probe_machine() to later in the boot process 2016-07-21 18:59:22 +10:00
smp.c powerpc/smp: Convert NR_CPUS to nr_cpu_ids 2017-06-28 13:08:16 +10:00
spider-pci.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
spider-pic.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
spu_base.c powerpc/spufs: Fix hash faults for kernel regions 2017-05-25 23:07:44 +10:00
spu_callbacks.c powerpc: Add a proper syscall for switching endianness 2015-03-28 22:03:40 +11:00
spu_manage.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
spu_notify.c powerpc: fix implicit notifier use in converting to export.h 2011-10-31 19:30:41 -04:00
spu_priv1_mmio.c powerpc: remove non-required uses of include <linux/module.h> 2011-10-31 19:30:44 -04:00
spu_priv1_mmio.h [POWERPC] cell: abstract spu management routines 2006-12-04 20:40:39 +11:00
spu_syscalls.c powerpc/cell: Fix compilation with CONFIG_COREDUMP=n 2014-07-11 12:55:05 +10:00