summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2004-09-07 17:50:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-07 17:50:33 -0700
commit94486dbdabdd094868c8746a66501bfd3fb05ff0 (patch)
tree1d6fdf8fe26078ef3363a14b17852390f9d4d37a /include/linux
parent5c689659b4056c0b4f70d10654d2c713fe2cf3d6 (diff)
[PATCH] fix f_version optimization for get_tgid_list
The kernel contains an optimization that skips the linked list walk in get_tgid_list for the common case of sequential accesses. Unfortunately the optimization is buggy (missing NULL pointer check for the result of find_task_by_pid) and broken (actually - broken twice: the tgid value that is stored in f_version is always 0 because tgid is overwritten when the string is created and additionally the common case is not filldir < 0, it's running out of nr_tgids). The attached patch fixes these bugs. Roger Luethi <rl@hellgate.ch> ran a benchmark: test: top -d 0 -b -n 10 > /dev/null ==> 2.6.8 <== real 0m19.092s user 0m5.013s sys 0m12.622s ==> 2.6.8 + patch-tgid-bugfixes <== real 0m10.062s user 0m5.042s sys 0m4.111s Signed-Off-By: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions