[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445665618.2395.12.camel@decadent.org.uk>
Date: Sat, 24 Oct 2015 14:46:58 +0900
From: Ben Hutchings <ben@...adent.org.uk>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org, Shaohua Li <shli@...com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes
On Fri, 2015-10-23 at 10:45 -0700, Greg Kroah-Hartman wrote:
> 4.2-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Shaohua Li <shli@...com>
>
> commit 424cdc14138088ada1b0e407a2195b2783c6e5ef upstream.
>
> page_counter_memparse() returns pages for the threshold, while
> mem_cgroup_usage() returns bytes for memory usage. Convert the
> threshold to bytes.
>
> Fixes: 3e32cb2e0a12b6915 ("memcg: rename cgroup_event to mem_cgroup_event").
> Signed-off-by: Shaohua Li <shli@...com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Acked-by: Michal Hocko <mhocko@...e.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>
> ---
> mm/memcontrol.c | 1 +
> 1 file changed, 1 insertion(+)
>
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3687,6 +3687,7 @@ static int __mem_cgroup_usage_register_e
> > > ret = page_counter_memparse(args, "-1", &threshold);
> > > if (ret)
> > > > return ret;
> +> > threshold <<= PAGE_SHIFT;
>
> > > mutex_lock(&memcg->thresholds_lock);
>
mem_cgroup_usage() returns a u64 and I think that the types of
threshold and mem_cgroup_threshold::threshold also need be changed to
u64 to avoid overflow on large 32-bit systems.
Ben.
--
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists