The patch titled Subject: kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix has been added to the -mm tree. Its filename is kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix simplify code Cc: Raphael S. Carvalho <raphael.scarv@xxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/pid.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff -puN kernel/pid.c~kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix kernel/pid.c --- a/kernel/pid.c~kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix +++ a/kernel/pid.c @@ -183,15 +183,19 @@ static int alloc_pidmap(struct pid_names break; } if (likely(atomic_read(&map->nr_free))) { - do { + for ( ; ; ) { if (!test_and_set_bit(offset, map->page)) { atomic_dec(&map->nr_free); set_last_pid(pid_ns, last, pid); return pid; } offset = find_next_offset(map, offset); - } while (offset < BITS_PER_PAGE && - (pid = mk_pid(pid_ns, map, offset)) < pid_max); + if (offset >= BITS_PER_PAGE) + break; + pid = mk_pid(pid_ns, map, offset); + if (pid >= pid_max) + break; + } } if (map < &pid_ns->pidmap[(pid_max-1)/BITS_PER_PAGE]) { ++map; _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are linux-next.patch linux-next-git-rejects.patch arch-alpha-kernel-systblss-remove-debug-check.patch i-need-old-gcc.patch include-linux-res_counterh-needs-errnoh.patch signal-always-clear-sa_restorer-on-execve-fix.patch kernel-signalc-use-__arch_has_sa_restorer-instead-of-sa_restorer.patch timer_list-convert-timer-list-to-be-a-proper-seq_file.patch timer_list-convert-timer-list-to-be-a-proper-seq_file-v3-fix.patch drivers-usb-dwc3-ep0c-fix-sparc64-build.patch mm.patch mm-shmemc-remove-an-ifdef.patch include-linux-mmzoneh-cleanups.patch include-linux-mmzoneh-cleanups-fix.patch drop_caches-add-some-documentation-and-info-messsge.patch memcg-debugging-facility-to-access-dangling-memcgs-fix.patch kernel-smpc-cleanups.patch get_maintainer-use-filename-only-regex-match-for-tegra-fix.patch epoll-trim-epitem-by-one-cache-line-on-x86_64-fix.patch binfmt_elfc-use-get_random_int-to-fix-entropy-depleting.patch rtc-ds1307-long-block-operations-bugfix.patch hfsplus-fix-warnings-in-fs-hfsplus-bfindc-in-function-hfs_find_1st_rec_by_cnid-fix.patch kexec-use-min_t-to-simplify-logic-fix.patch kernel-pidc-improve-flow-of-a-loop-inside-alloc_pidmap-fix.patch pid_namespacec-h-simplify-defines-fix.patch drivers-net-rename-random32-to-prandom_u32-fix.patch aio-kiocb_cancel-fix.patch wait-add-wait_event_hrtimeout-fix.patch aio-use-cancellation-list-lazily-fix-fix.patch aio-give-shared-kioctx-fields-their-own-cachelines-fix.patch generic-dynamic-per-cpu-refcounting-fix.patch generic-dynamic-per-cpu-refcounting-sparse-fixes-fix.patch generic-dynamic-per-cpu-refcounting-doc-fix.patch aio-dont-include-aioh-in-schedh-fix.patch aio-dont-include-aioh-in-schedh-fix-fix.patch aio-dont-include-aioh-in-schedh-fix-3.patch aio-dont-include-aioh-in-schedh-fix-3-fix.patch aio-dont-include-aioh-in-schedh-fix-3-fix-fix.patch aio-kill-ki_retry-fix.patch block-aio-batch-completion-for-bios-kiocbs-fix.patch block-aio-batch-completion-for-bios-kiocbs-fix-fix.patch block-aio-batch-completion-for-bios-kiocbs-fix-fix-fix.patch block-aio-batch-completion-for-bios-kiocbs-fix-fix-fix-fix-fix-fix.patch debugging-keep-track-of-page-owners-fix-2-fix.patch debugging-keep-track-of-page-owners-fix-2-fix-fix-fix.patch journal_add_journal_head-debug.patch kernel-forkc-export-kernel_thread-to-modules.patch mutex-subsystem-synchro-test-module.patch slab-leaks3-default-y.patch put_bh-debug.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html