linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kamezawa.hiroyu@jp.fujitsu.com
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org, balbir@linux.vnet.ibm.com, xemul@openvz.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Re: [PATCH 2/2][-mm][resend] memcg limit change shrink usage.
Date: Mon, 28 Jul 2008 17:43:22 +0900 (JST)	[thread overview]
Message-ID: <11498528.1217234602331.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20080722014517.04e88306.akpm@linux-foundation.org>

----- Original Message -----

>On Mon, 14 Jul 2008 17:15:22 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fuji
tsu.com> wrote:
>
>> Shrinking memory usage at limit change.
>
>The above six words are all we really have as a changelog.  It is not
>adequate.
>
I'll add enough description (in this week), sorry,


>> +	while (res_counter_set_limit(&memcg->res, val)) {
>> +		if (signal_pending(current)) {
>> +			ret = -EINTR;
>> +			break;
>> +		}
>> +		if (!retry_count) {
>> +			ret = -EBUSY;
>> +			break;
>> +		}
>> +		progress = try_to_free_mem_cgroup_pages(memcg, GFP_KERNEL);
>> +		if (!progress)
>> +			retry_count--;
>> +	}
>> +	return ret;
>> +}
>
>We could perhaps get away with a basically-unchanglogged patch if the
>code was adequately commented.  But it is not.
>
>What the heck does this function *do*?  Why does it exist?
>
Sorry. I should do so.

>Guys, this is core Linux kernel, not some weekend hack project.  Please
>work to make it as comprehensible and as maintainable as we possibly
>can.
>
>Also, it is frequently a mistake for a callee to assume that the caller
>can use GFP_KERNEL.  Often when we do this we end having to change the
>interface so that the caller passes in the gfp_t.  As there's only one
>caller I guess we can get away with it this time.  For now.
>

Hmm, ok. will rework this and take gfp_t as an argument.

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

  parent reply	other threads:[~2008-07-28  8:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14  8:11 [PATCH 1/2][-mm][resend] res_counter limit change support ebusy KAMEZAWA Hiroyuki
2008-07-14  8:15 ` [PATCH 2/2][-mm][resend] memcg limit change shrink usage KAMEZAWA Hiroyuki
2008-07-22  8:45   ` Andrew Morton
2008-07-28  8:43   ` kamezawa.hiroyu [this message]
2008-07-28  8:53     ` Andrew Morton
2008-07-22  8:40 ` [PATCH 1/2][-mm][resend] res_counter limit change support ebusy Andrew Morton
2008-07-28  8:39 ` kamezawa.hiroyu

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=11498528.1217234602331.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=xemul@openvz.org \
    /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