summaryrefslogtreecommitdiffstats
path: root/kernel/mutex.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-12-06 20:36:54 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:34 -0800
commit51de4d90852ba4cfa5743594ec4a7f158b52dc43 (patch)
tree27ee40313c79c3c5fa2ef86fc059cf991c92e8e2 /kernel/mutex.c
parent68062b86fc0f480b806d270a8278709a5a41bb67 (diff)
downloadblackbird-op-linux-51de4d90852ba4cfa5743594ec4a7f158b52dc43.tar.gz
blackbird-op-linux-51de4d90852ba4cfa5743594ec4a7f158b52dc43.zip
[PATCH] taskstats: use nla_reserve() for reply assembling
Currently taskstats_user_cmd()/taskstats_exit() do: 1) allocate stats 2) fill stats 3) make a temporary copy on stack (236 bytes) 4) copy that copy to skb 5) free stats With the help of nla_reserve() we can operate on skb->data directly, thus avoiding all these steps except 2). So, before this patch: // copy *stats to skb->data int mk_reply(skb, ..., struct taskstats *stats); fill_pid(stats); mk_reply(skb, ..., stats); After: // return a pointer to skb->data struct taskstats *mk_reply(skb, ...); stat = mk_reply(skb, ...); fill_pid(stats); Shrinks taskatsks.o by 162 bytes. A stupid benchmark (send one million TASKSTATS_CMD_ATTR_PID) shows the real user sys before: 4.02 0.06 3.96 4.02 0.04 3.98 4.02 0.04 3.97 after: 3.86 0.08 3.78 3.88 0.10 3.77 3.89 0.09 3.80 but this looks suspiciously good. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Jay Lan <jlan@sgi.com> Cc: Thomas Graf <tgraf@suug.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/mutex.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud