linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch 1/2] mm, counters: remove task argument to sync_mm_rss and __sync_task_rss_stat
Date: Wed, 7 Mar 2012 17:11:55 -0800	[thread overview]
Message-ID: <20120307171155.f9bb71b6.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1203061919260.21806@chino.kir.corp.google.com>

On Tue, 6 Mar 2012 19:21:39 -0800 (PST)
David Rientjes <rientjes@google.com> wrote:

> -static void __sync_task_rss_stat(struct task_struct *task, struct mm_struct *mm)
> +static void __sync_task_rss_stat(struct mm_struct *mm)
>  {
>  	int i;
>  
>  	for (i = 0; i < NR_MM_COUNTERS; i++) {
> -		if (task->rss_stat.count[i]) {
> -			add_mm_counter(mm, i, task->rss_stat.count[i]);
> -			task->rss_stat.count[i] = 0;
> +		if (current->rss_stat.count[i]) {
> +			add_mm_counter(mm, i, current->rss_stat.count[i]);
> +			current->rss_stat.count[i] = 0;
>  		}
>  	}
> -	task->rss_stat.events = 0;
> +	current->rss_stat.events = 0;
>  }

hm, with my gcc it's beneficial to cache `current' in a local.  But
when I tried that, Weird Things happened, because gcc has gone and
decided to inline __sync_task_rss_stat() into its callers.  I don't see
how that could have been the right thing to do.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-03-08  1:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07  3:21 [patch 1/2] mm, counters: remove task argument to sync_mm_rss and __sync_task_rss_stat David Rientjes
2012-03-07  3:21 ` [patch 2/2] mm, counters: fold __sync_task_rss_stat into sync_mm_rss David Rientjes
2012-03-08  5:41   ` KAMEZAWA Hiroyuki
2012-03-08  1:11 ` Andrew Morton [this message]
2012-03-08  1:40   ` [patch 1/2] mm, counters: remove task argument to sync_mm_rss and __sync_task_rss_stat David Rientjes
2012-03-08  2:09     ` Andrew Morton
2012-03-08  5:40 ` 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=20120307171155.f9bb71b6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).