From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [BUGFIX][PATCH 1/5] memcg use correct scan number at reclaim
Date: Thu, 12 Mar 2009 09:44:14 +0530 [thread overview]
Message-ID: <20090312041414.GG23583@balbir.in.ibm.com> (raw)
In-Reply-To: <20090312130556.68d03711.kamezawa.hiroyu@jp.fujitsu.com>
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-03-12 13:05:56]:
> On Thu, 12 Mar 2009 09:30:54 +0530
> Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-03-12 12:51:24]:
> >
> > > On Thu, 12 Mar 2009 09:19:18 +0530
> > > Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > >
> > > > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-03-12 09:55:16]:
> > > >
> > > > > Andrew, this [1/5] is a bug fix, others are not.
> > > > >
> > > > > ==
> > > > > From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > > > >
> > > > > Even when page reclaim is under mem_cgroup, # of scan page is determined by
> > > > > status of global LRU. Fix that.
> > > > >
> > > > > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > > > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > > > > ---
> > > > > mm/vmscan.c | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > Index: mmotm-2.6.29-Mar10/mm/vmscan.c
> > > > > ===================================================================
> > > > > --- mmotm-2.6.29-Mar10.orig/mm/vmscan.c
> > > > > +++ mmotm-2.6.29-Mar10/mm/vmscan.c
> > > > > @@ -1470,7 +1470,7 @@ static void shrink_zone(int priority, st
> > > > > int file = is_file_lru(l);
> > > > > int scan;
> > > > >
> > > > > - scan = zone_page_state(zone, NR_LRU_BASE + l);
> > > > > + scan = zone_nr_pages(zone, sc, l);
> > > >
> > > > I have the exact same patch in my patch queue. BTW, mem_cgroup_zone_nr_pages is
> > > > buggy. We don't hold any sort of lock while extracting
> > > > MEM_CGROUP_ZSTAT (ideally we need zone->lru_lock). Without that how do
> > > > we guarantee that MEM_CGRUP_ZSTAT is not changing at the same time as
> > > > we are reading it?
> > > >
> > > Is it big problem ? We don't need very precise value and ZSTAT just have
> > > increment/decrement. So, I tend to ignore this small race.
> > > (and it's unsigned long, not long long.)
> > >
> >
> > The assumption is that unsigned long read is atomic even on 32 bit
> > systems? What if we get pre-empted in the middle of reading the data
> > and don't return back for long? The data can be highly in-accurate.
> > No?
> >
> Hmm, preempt_disable() is appropriate ?
>
> But shrink_zone() itself works on the value which is read at this time and
> dont' take care of changes in situation by preeemption...so it's not problem
> of memcg.
>
You'll end up reclaiming based on old stale data. shrink_zone itself
maintains atomic data for zones.
I think the assumption that unsigned long read is atomic seems quite
reasonable, but I want to validate this across architectures. Anyone
know the correct answer?
--
Balbir
--
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:[~2009-03-12 4:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 0:52 [RFC][PATCH 0/5] memcg softlimit (Another one) v4 KAMEZAWA Hiroyuki
2009-03-12 0:55 ` [BUGFIX][PATCH 1/5] memcg use correct scan number at reclaim KAMEZAWA Hiroyuki
2009-03-12 3:49 ` Balbir Singh
2009-03-12 3:51 ` KAMEZAWA Hiroyuki
2009-03-12 4:00 ` Balbir Singh
2009-03-12 4:05 ` KAMEZAWA Hiroyuki
2009-03-12 4:14 ` Balbir Singh [this message]
2009-03-12 4:17 ` KAMEZAWA Hiroyuki
2009-03-12 7:45 ` KOSAKI Motohiro
2009-03-12 9:45 ` Balbir Singh
2009-03-12 11:23 ` KOSAKI Motohiro
2009-03-12 0:56 ` [RFC][PATCH 2/5] add softlimit to res_counter KAMEZAWA Hiroyuki
2009-03-12 3:54 ` Balbir Singh
2009-03-12 3:58 ` KAMEZAWA Hiroyuki
2009-03-12 4:10 ` Balbir Singh
2009-03-12 4:14 ` KAMEZAWA Hiroyuki
2009-03-12 0:57 ` [RFC][PATCH 3/5] memcg per zone softlimit scheduler core KAMEZAWA Hiroyuki
2009-03-12 0:58 ` [RFC][PATCH 4/5] memcg softlimit_priority KAMEZAWA Hiroyuki
2009-03-12 1:00 ` [RFC][PATCH 5/5] memcg softlimit hooks to kswapd KAMEZAWA Hiroyuki
2009-03-12 3:58 ` Balbir Singh
2009-03-12 4:02 ` KAMEZAWA Hiroyuki
2009-03-12 4:59 ` KAMEZAWA Hiroyuki
2009-03-12 1:01 ` [RFC][PATCH 6/5] softlimit document KAMEZAWA Hiroyuki
2009-03-12 1:54 ` Li Zefan
2009-03-12 2:01 ` KAMEZAWA Hiroyuki
2009-03-12 3:46 ` [RFC][PATCH 0/5] memcg softlimit (Another one) v4 Balbir Singh
2009-03-12 4:39 ` KAMEZAWA Hiroyuki
2009-03-12 5:04 ` Balbir Singh
2009-03-12 5:32 ` KAMEZAWA Hiroyuki
2009-03-12 8:26 ` Balbir Singh
2009-03-12 8:45 ` KAMEZAWA Hiroyuki
2009-03-12 9:53 ` Balbir Singh
2009-03-14 18:52 ` Balbir Singh
2009-03-16 0:10 ` 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=20090312041414.GG23583@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.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