Re: Re: [PATCH 2/2][-mm][resend] memcg limit change shrink usage.

From: kamezawa . hiroyu
Date: Mon Jul 28 2008 - 04:56:23 EST


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

>On Mon, 14 Jul 2008 17:15:22 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxx
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/