diff options
| author | Raphael S. Carvalho <[email protected]> | 2013-04-30 15:28:26 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-04-30 17:04:07 -0700 |
| commit | 8db049b3d666b3676ff4a976e03c14de302bf9fa (patch) | |
| tree | 74d5e5c8e25b451e983e66cb1e2a41cbf8e1b4f1 /scripts/patch-kernel | |
| parent | c75aaa8ed03eb1312ed2990f1a716b2b9cc0df42 (diff) | |
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.
[[email protected]: simplify code]
Signed-off-by: Raphael S. Carvalho <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Serge Hallyn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions