linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] memcg: share event counter rather than duplicate
Date: Fri, 12 Feb 2010 17:51:33 +0900	[thread overview]
Message-ID: <20100212175133.7d0cfdb4.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <cc557aab1002120049v28322a29sbe11d7f049806115@mail.gmail.com>

On Fri, 12 Feb 2010 10:49:45 +0200
"Kirill A. Shutemov" <kirill@shutemov.name> wrote:

> On Fri, Feb 12, 2010 at 10:19 AM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Fri, 12 Feb 2010 10:07:25 +0200
> > "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> >
> >> On Fri, Feb 12, 2010 at 8:48 AM, KAMEZAWA Hiroyuki
> >> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> >> > Memcg has 2 eventcountes which counts "the same" event. Just usages are
> >> > different from each other. This patch tries to reduce event counter.
> >> >
> >> > This patch's logic uses "only increment, no reset" new_counter and masks for each
> >> > checks. Softlimit chesk was done per 1000 events. So, the similar check
> >> > can be done by !(new_counter & 0x3ff). Threshold check was done per 100
> >> > events. So, the similar check can be done by (!new_counter & 0x7f)
> >>
> >> IIUC, with this change we have to check counter after each update,
> >> since we check
> >> for exact value.
> >
> > Yes.
> >> So we have to move checks to mem_cgroup_charge_statistics() or
> >> call them after each statistics charging. I'm not sure how it affects
> >> performance.
> >>
> >
> > My patch 1/2 does it.
> >
> > But hmm, move-task does counter updates in asynchronous manner. Then, there are
> > bug. I'll add check in the next version.
> >
> > Maybe calling update_tree and threshold_check at the end of mova_task is
> > better. Does thresholds user take care of batched-move manner in task_move ?
> > Should we check one by one ?
> 
> No. mem_cgroup_threshold() at mem_cgroup_move_task() is enough.
> 
> But... Is task moving a critical path? If no, It's, probably, cleaner to check
> everything at mem_cgroup_charge_statistics().
> 
The trouble is charge_statistics() is called under lock_page_cgroup() and 
I don't want to call something heavy under it.
(And I'm not very sure calling charge_statitics it without lock-page-cgroup is
 dangerous or not. (I think it has some race.)
 But if there is race, it's very difficult one. So, I leave it as it is.)

Maybe, my next one will be enough simple one. Thank you for review.

Regards,
-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>

  reply	other threads:[~2010-02-12  8:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  6:44 [PATCH 0/2] memcg patches around event counting...softlimit and thresholds KAMEZAWA Hiroyuki
2010-02-12  6:47 ` [PATCH 1/2] memcg : update softlimit and threshold at commit KAMEZAWA Hiroyuki
2010-02-12  7:33   ` Daisuke Nishimura
2010-02-12  7:42     ` KAMEZAWA Hiroyuki
2010-02-12  6:48 ` [PATCH 2/2] memcg: share event counter rather than duplicate KAMEZAWA Hiroyuki
2010-02-12  7:40   ` Daisuke Nishimura
2010-02-12  7:41     ` KAMEZAWA Hiroyuki
2010-02-12  7:46   ` Kirill A. Shutemov
2010-02-12  7:46     ` KAMEZAWA Hiroyuki
2010-02-12  8:07   ` Kirill A. Shutemov
2010-02-12  8:19     ` KAMEZAWA Hiroyuki
2010-02-12  8:49       ` Kirill A. Shutemov
2010-02-12  8:51         ` KAMEZAWA Hiroyuki [this message]
2010-02-12  9:05 ` [PATCH 0/2] memcg patches around event counting...softlimit and thresholds v2 KAMEZAWA Hiroyuki
2010-02-12  9:06   ` [PATCH 1/2] memcg: update threshold and softlimit at commit v2 KAMEZAWA Hiroyuki
2010-02-12  9:09   ` [PATCH 2/2] memcg : share event counter rather than duplicate v2 KAMEZAWA Hiroyuki
2010-02-12 11:48     ` Daisuke Nishimura
2010-02-15  0:19       ` KAMEZAWA Hiroyuki
2010-03-09 23:15         ` Andrew Morton
2010-02-15 10:57     ` Kirill A. Shutemov
2010-02-16  0:16       ` 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=20100212175133.7d0cfdb4.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kirill@shutemov.name \
    --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