alistair23-linux/arch
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
..
alpha libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
arc Merge branch 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-11-15 10:14:11 -08:00
arm ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
arm64 ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
blackfin This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08:00
c6x DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
cris pci-v4.15-changes 2017-11-15 15:01:28 -08:00
frv Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
h8300 mm, arch: remove empty_bad_page* 2017-11-15 18:21:03 -08:00
hexagon A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
ia64 pci-v4.15-changes 2017-11-15 15:01:28 -08:00
m32r m32r: fix endianness constraints 2017-11-15 18:21:00 -08:00
m68k A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
metag DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
microblaze DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
mips libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
mn10300 bug: define the "cut here" string in a single place 2017-11-17 16:10:01 -08:00
nios2 DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
openrisc kmemcheck: remove annotations 2017-11-15 18:21:04 -08:00
parisc libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
powerpc pid: replace pid bitmap implementation with IDR API 2017-11-17 16:10:03 -08:00
riscv RISC-V Port for Linux 4.15 v9 2017-11-15 10:49:15 -08:00
s390 First batch of KVM changes for 4.15 2017-11-16 13:00:24 -08:00
score License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
sh sh/boot: add static stack-protector to pre-kernel 2017-11-17 16:10:00 -08:00
sparc Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
tile mm: remove cold parameter from free_hot_cold_page* 2017-11-15 18:21:06 -08:00
um Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
unicore32 kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2017-11-15 18:21:04 -08:00
x86 xen: features and fixes for v4.15-rc1 2017-11-16 13:06:27 -08:00
xtensa libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
.gitignore
Kconfig bpf: Revert bpf_overrid_function() helper changes. 2017-11-11 18:24:55 +09:00