[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 12 Dec 2008 10:08:18 +0100
From: Tim Blechmann <tim@...ngt.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: rostedt@...dmis.org, linux-kernel@...r.kernel.org,
linux-rt-users@...r.kernel.org, mingo@...e.hu, tglx@...utronix.de
Subject: Re: [PATCH] [RT] avoid preemption in memory controller code
> > 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@...ngt.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@...ngt.org
http://tim.klingt.org
Silence is only frightening to people who are compulsively
verbalizing.
William S. Burroughs
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists