From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbbJXFrS (ORCPT ); Sat, 24 Oct 2015 01:47:18 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:59782 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbbJXFrQ (ORCPT ); Sat, 24 Oct 2015 01:47:16 -0400 Message-ID: <1445665618.2395.12.camel@decadent.org.uk> Subject: Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes From: Ben Hutchings To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Shaohua Li , Johannes Weiner , Michal Hocko , Andrew Morton , Linus Torvalds Date: Sat, 24 Oct 2015 14:46:58 +0900 In-Reply-To: <20151023174519.845601158@linuxfoundation.org> References: <20151023174519.086915553@linuxfoundation.org> <20151023174519.845601158@linuxfoundation.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-nQWY0iaOtf3WozsWjPvQ" X-Mailer: Evolution 3.18.1-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 220.118.178.92 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-nQWY0iaOtf3WozsWjPvQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-10-23 at 10:45 -0700, Greg Kroah-Hartman wrote: > 4.2-stable review patch.=C2=A0=C2=A0If anyone has any objections, please = let me know. >=20 > ------------------ >=20 > From: Shaohua Li >=20 > commit 424cdc14138088ada1b0e407a2195b2783c6e5ef upstream. >=20 > page_counter_memparse() returns pages for the threshold, while > mem_cgroup_usage() returns bytes for memory usage.=C2=A0=C2=A0Convert the > threshold to bytes. >=20 > Fixes: 3e32cb2e0a12b6915 ("memcg: rename cgroup_event to mem_cgroup_event= "). > Signed-off-by: Shaohua Li > Cc: Johannes Weiner > Acked-by: Michal Hocko > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds > Signed-off-by: Greg Kroah-Hartman >=20 > --- > =C2=A0mm/memcontrol.c |=C2=A0=C2=A0=C2=A0=C2=A01 + > =C2=A01 file changed, 1 insertion(+) >=20 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3687,6 +3687,7 @@ static int __mem_cgroup_usage_register_e > =C2=A0> > ret =3D page_counter_memparse(args, "-1", &threshold); > =C2=A0> > if (ret) > =C2=A0> > > return ret; > +> > threshold <<=3D PAGE_SHIFT; > =C2=A0 > =C2=A0> > mutex_lock(&memcg->thresholds_lock); > =C2=A0 mem_cgroup_usage() returns a u64 and I think that=C2=A0the types of threshold and mem_cgroup_threshold::threshold also need be changed to u64 to avoid overflow on large 32-bit systems. Ben. --=20 Ben Hutchings Beware of bugs in the above code; I have only proved it correct, not tried it. - Donald Knuth --=-nQWY0iaOtf3WozsWjPvQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUAVisbUue/yOyVhhEJAQoD4A/9G5f4vfoHyI+UQ0ValkfmJ50hx9I5yUw4 +63x1Gy9Q8po753nZpd3kLom1vNSa7I5P9Sl09757wOyM3poXv6CpRT2MGj8w+f9 5tkxKI/o67vJ4hYhTYM6VVfqidHuDqcXH7zFxgEFmzooAgLM0lMkp0HkJJRZbRIC 6TEFozbdH453nlHVcz6XTmdCXAZUo+GQoy3M31yBtD6CYMx4gULOUHu0k19DAlvO UW+GyYvwVxHA1oIbdxhA2tPRrJazZQthyyFyWHpTn6e6plhGgd36OFAyDRFroO7I Z5Tz+jxxULMWT4sU2o+tzkSPddU9Y+5fUDSE3T5Ikou505M1t0yg+8N1HSeqJcNm F1sUk63/vtIX107qyp0zziTw3KKEvjzVFayegJ22xlqUafftIiI/8oJ/b7TR9V83 LDgtPiw5Gm7qtEBAIGeaExjTA05fgF46NTVJpN/TMxKbxCxinqmDDdts/DaAe3xz GcSG8RdSSrZ0/59OBRanKDSHz2c5dCfeHg3048uAMB/QbIGZWQzxAkSpB2b9esUK hd35SkZ4XYvZuCimDOhzg2Zdq5rIOWqIQEyprs1R90QF8jNsp12cVzwETrMiozD5 YCILOq5YrND7IPD3UtbJbCoqcaflUuJY1eSXwrAcdKkotBjzRz3FYE4RkC2Ov0LU Q4QC7uPJltM= =fTt8 -----END PGP SIGNATURE----- --=-nQWY0iaOtf3WozsWjPvQ--