From: Raphael S. Carvalho Date: Tue, 30 Apr 2013 22:28:26 +0000 (-0700) Subject: kernel/pid.c: improve flow of a loop inside alloc_pidmap. X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~88^2~30 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8db049b3d666b3676ff4a976e03c14de302bf9fa;p=pandora-kernel.git kernel/pid.c: improve flow of a loop inside alloc_pidmap. find_next_offset() searches for an available "cleaned bit" in the respective pid bitmap (page), so returns the offset if found, otherwise it returns a value equals to BITS_PER_PAGE. For example, suppose find_next_offset didn't find any available bit, so there's no purpose to call mk_pid (Wasteful Cpu Cycles). Therefore, I found it could be better to call mk_pid after the checking (offset < BITS_PER_PAGE) returned sucessfully! Another point: If (offset < BITS_PER_PAGE) results in a "failure", then mk_pid would be called again afterwards. [akpm@linux-foundation.org: simplify code] Signed-off-by: Raphael S. Carvalho Cc: "Eric W. Biederman" Cc: Serge Hallyn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed