[Devel] Re: [PATCH 04/10] memcg: disable local interrupts in lock_page_cgroup()

KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Wed Oct 6 19:17:43 PDT 2010


On Thu, 7 Oct 2010 10:54:56 +0900
Daisuke Nishimura <nishimura at mxp.nes.nec.co.jp> wrote:

> On Thu, 7 Oct 2010 09:35:45 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu at jp.fujitsu.com> wrote:
> 
> > On Wed, 6 Oct 2010 09:15:34 +0900
> > Minchan Kim <minchan.kim at gmail.com> wrote:
> > 
> > > First of all, we could add your patch as it is and I don't expect any
> > > regression report about interrupt latency.
> > > That's because many embedded guys doesn't use mmotm and have a
> > > tendency to not report regression of VM.
> > > Even they don't use memcg. Hmm...
> > > 
> > > I pass the decision to MAINTAINER Kame and Balbir.
> > > Thanks for the detail explanation.
> > > 
> > 
> > Hmm. IRQ delay is a concern. So, my option is this. How do you think ?
> > 
> > 1. remove local_irq_save()/restore() in lock/unlock_page_cgroup().
> >    yes, I don't like it.
> > 
> > 2. At moving charge, do this:
> > 	a) lock_page()/ or trylock_page()
> > 	b) wait_on_page_writeback()
> > 	c) do move_account under lock_page_cgroup().
> > 	c) unlock_page()
> > 
> > 
> > Then, Writeback updates will never come from IRQ context while
> > lock/unlock_page_cgroup() is held by move_account(). There will be no race.
> > 
> hmm, if we'll do that, I think we need to do that under pte_lock in
> mem_cgroup_move_charge_pte_range(). But, we can't do wait_on_page_writeback()
> under pte_lock, right? Or, we need re-organize current move-charge implementation.
> 
Nice catch. I think releaseing pte_lock() is okay. (and it should be released)

IIUC, task's css_set() points to new cgroup when "move" is called. Then,
it's not necessary to take pte_lock, I guess.
(And taking pte_lock too long is not appreciated..)

I'll write a sample patch today.

Thanks,
-Kame








> Thanks,
> Daisuke Nishimura.
> 

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list