From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, containers@lists.osdl.org,
balbir@linux.vnet.ibm.com, yamamoto@valinux.co.jp
Subject: Re: [PATCH] memory cgroup enhancements take 4 [5/8] add status accounting function for memory cgroup
Date: Thu, 1 Nov 2007 09:29:56 +0900 [thread overview]
Message-ID: <20071101092956.489798fb.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20071031151234.4fcb42b2.akpm@linux-foundation.org>
At first, thank you for review.
On Wed, 31 Oct 2007 15:12:34 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> > +static inline void __mem_cgroup_stat_add(struct mem_cgroup_stat *stat,
> > + enum mem_cgroup_stat_index idx, int val)
> > +{
> > + int cpu = smp_processor_id();
> > + preempt_disable();
> > + stat->cpustat[cpu].count[idx] += val;
> > + preempt_enable();
> > +}
>
> This is clearly doing smp_processor_id() in preemptible code. (or the
> preempt_disable() just isn't needed). I fixed it up.
>
Thanks,
> Please ensure that you test with all runtime debugging options enabled -
> you should have seen a warning here.
>
Sorry, I'll take care.
> > +/*
> > + * For accounting under irq disable, no need for increment preempt count.
> > + */
> > +static inline void __mem_cgroup_stat_add_safe(struct mem_cgroup_stat *stat,
> > + enum mem_cgroup_stat_index idx, int val)
> > +{
> > + int cpu = smp_processor_id();
> > + stat->cpustat[cpu].count[idx] += val;
> > +}
>
> There's a wild amount of inlining in that file. Please, just don't do it -
> inline is a highly specialised thing and is rarely needed.
>
> When I removed the obviously-wrong inline statements, the size of
> mm/memcontrol.o went from 3823 bytes down to 3495.
>
> It also caused this:
>
> mm/memcontrol.c:65: warning: '__mem_cgroup_stat_add' defined but not used
>
> so I guess I'll just remove that.
>
ok. I'll add again if it is needed again.
Thanks,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-11-01 0:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 10:22 [PATCH] memory cgroup enhancements take 4 [0/8] intro KAMEZAWA Hiroyuki
2007-10-31 10:24 ` [PATCH] memory cgroup enhancements take 4 [1/8] fix zone handling in try_to_free_mem_cgroup_page KAMEZAWA Hiroyuki
2007-10-31 10:25 ` [PATCH] memory cgroup enhancements take 4 [2/8] force_empty interface for dropping all account in empty cgroup KAMEZAWA Hiroyuki
2007-10-31 10:28 ` [PATCH] memory cgroup enhancements take 4 [3/8] remember "a page is charged as page cache" KAMEZAWA Hiroyuki
2007-10-31 10:29 ` [PATCH] memory cgroup enhancements take 4 [4/8] remember "a page is on active list of cgroup or not" KAMEZAWA Hiroyuki
2007-10-31 10:30 ` [PATCH] memory cgroup enhancements take 4 [5/8] add status accounting function for memory cgroup KAMEZAWA Hiroyuki
2007-10-31 22:12 ` Andrew Morton
2007-11-01 0:29 ` KAMEZAWA Hiroyuki [this message]
2007-10-31 10:31 ` [PATCH] memory cgroup enhancements take 4 [6/8] add memory.stat file KAMEZAWA Hiroyuki
2007-10-31 10:32 ` [PATCH] memory cgroup enhancements take 4 [7/8] add pre dstroy handler KAMEZAWA Hiroyuki
2007-10-31 10:32 ` [PATCH] memory cgroup enhancements take 4 [8/8] implicit force empty at rmdir() KAMEZAWA Hiroyuki
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=20071101092956.489798fb.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=linux-mm@kvack.org \
--cc=yamamoto@valinux.co.jp \
/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