From: Tim Blechmann <tim@klingt.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org,
linux-rt-users@vger.kernel.org, mingo@elte.hu,
tglx@linutronix.de
Subject: Re: [PATCH] [RT] avoid preemption in memory controller code
Date: Fri, 12 Dec 2008 10:08:18 +0100 [thread overview]
Message-ID: <1229072898.6629.24.camel@thinkpad> (raw)
In-Reply-To: <20081212101731.6034a554.kamezawa.hiroyu@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]
> > the lru_lock of struct mem_group_per_zone is used to avoid preemption
> > during the mem_cgroup_charge_statistics function. this does not work
> > correctly, when CONFIG_PREEMPT_RT is enabled.
> > therefore, the preemption is disabled using the preempt_disable_rt macro
> > in these cases.
> >
> > Signed-off-by: Tim Blechmann <tim@klingt.org>
>
> Sorry, memcg's code this function in mmotm kernel is now, following.
> Please give me advice if some more thinking is necessary for RT.
using get_cpu/put_cpu, the preemption is disabled ... so mmotm should
not require any changes. my patch would only be required for an
rt-patch, based on a current kernel version ...
instead of applying my patch, one could also use the specific part of
mmotm for the RT tree ...
tim
> static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
> struct page_cgroup *pc,
> bool charge)
> {
> int val = (charge)? 1 : -1;
> struct mem_cgroup_stat *stat = &mem->stat;
> struct mem_cgroup_stat_cpu *cpustat;
> int cpu = get_cpu();
>
> cpustat = &stat->cpustat[cpu];
> if (PageCgroupCache(pc))
> __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_CACHE, val);
> else
> __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_RSS, val);
>
> if (charge)
> __mem_cgroup_stat_add_safe(cpustat,
> MEM_CGROUP_STAT_PGPGIN_COUNT, 1);
> else
> __mem_cgroup_stat_add_safe(cpustat,
> MEM_CGROUP_STAT_PGPGOUT_COUNT, 1);
> put_cpu();
> }
--
tim@klingt.org
http://tim.klingt.org
Silence is only frightening to people who are compulsively
verbalizing.
William S. Burroughs
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-12-12 9:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <preempt_enable_rt();>
2008-12-11 19:00 ` [PATCH] [RT] avoid preemption in memory controller code Tim Blechmann
2008-12-12 1:17 ` KAMEZAWA Hiroyuki
2008-12-12 9:08 ` Tim Blechmann [this message]
2008-12-08 14:34 Tim Blechmann
2008-12-08 16:42 ` Steven Rostedt
2008-12-08 17:07 ` Tim Blechmann
2008-12-08 17:23 ` Steven Rostedt
2008-12-09 1:13 ` Li Zefan
2008-12-09 1:32 ` 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=1229072898.6629.24.camel@thinkpad \
--to=tim@klingt.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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