lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From kamezawa.hiroyu@jp ...
DateMon, 28 Jul 2008 17:43:22 +0900 (JST)
SubjectRe: Re: [PATCH 2/2][-mm][resend] memcg limit change shrink usage.
----- 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



\
 
 \ /
  Last update: 2008-07-28 10:59    [from the cache]
©2003-2008