[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110131162448.e791f0ae.akpm@linux-foundation.org>
Date: Mon, 31 Jan 2011 16:24:48 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Johannes Weiner <hannes@...xchg.org>
Cc: kamezawa.hiroyu@...fujitsu.com, nishimura@....nes.nec.co.jp,
balbir@...ux.vnet.ibm.com, minchan.kim@...il.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 2/3] memcg: prevent endless loop when charging huge
pages to near-limit group
On Tue, 1 Feb 2011 01:04:55 +0100
Johannes Weiner <hannes@...xchg.org> wrote:
> Maybe it would be better to use res_counter_margin(cnt) >= wanted
> throughout the code.
yup.
> --- a/include/linux/res_counter.h
> +++ b/include/linux/res_counter.h
> @@ -182,6 +182,14 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt)
> return ret;
> }
>
> +/**
> + * res_counter_check_margin - check if the counter allows charging
> + * @cnt: the resource counter to check
> + * @bytes: the number of bytes to check the remaining space against
> + *
> + * Returns a boolean value on whether the counter can be charged
> + * @bytes or whether this would exceed the limit.
> + */
> static inline bool res_counter_check_margin(struct res_counter *cnt,
> unsigned long bytes)
> {
mem_cgroup_check_margin() needs some lipstick too.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists