From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: Shailabh Nagar <nagar@watson.ibm.com>,
Balbir Singh <balbir@in.ibm.com>, Jay Lan <jlan@sgi.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] taskstats_tgid_alloc: optimization
Date: Fri, 27 Oct 2006 03:21:46 +0400 [thread overview]
Message-ID: <20061026232146.GA529@oleg> (raw)
Every subthread (except first) does unneeded kmem_cache_alloc/kmem_cache_free.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- STATS/include/linux/taskstats_kern.h~4_alloc 2006-10-27 01:28:31.000000000 +0400
+++ STATS/include/linux/taskstats_kern.h 2006-10-27 01:39:10.000000000 +0400
@@ -32,6 +32,9 @@ static inline void taskstats_tgid_alloc(
struct taskstats *stats;
unsigned long flags;
+ if (sig->stats != NULL)
+ return;
+
stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
if (!stats)
return;
reply other threads:[~2006-10-26 23:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061026232146.GA529@oleg \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=jlan@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nagar@watson.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox