Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256673

Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes
Date 2015-10-27 11:40 +0100
Message-ID <qo9PA-455-29@gated-at.bofh.it> (permalink)
References <qmODw-8sm-7@gated-at.bofh.it> <qmPgf-112-53@gated-at.bofh.it> <qmZSh-7YR-5@gated-at.bofh.it> <qnwuR-5ho-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun 25-10-15 17:32:10, Michal Hocko wrote:
> On Sat 24-10-15 14:46:58, Ben Hutchings wrote:
> [...]
> > > --- 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.
> 
> You are absolutely right! I have compltely missed that 3e32cb2e0a12 has
> changed the type as well. Should have noticed that during the review.
> 
> The whole thing is just way too confusing. All the tracking is done in
> page units yet tresholds are in bytes. This only calls for troubles. The
> patch below simply turns thresholds to page units as well. I hope I
> haven't screwed anything, I didn't get to more than compile test it.

OK, I've tested it and it seems working as expected. I will repost to
the linux-mm mailing list.
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.2 00/54] 4.2.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
  [PATCH 4.2 54/54] svcrdma: handle rdma read with a non-zero initial page offset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
  [PATCH 4.2 29/54] ARM: ux500: simplify secondary CPU boot Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
  [PATCH 4.2 25/54] memcg: convert threshold to bytes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
    Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes Ben Hutchings <ben@decadent.org.uk> - 2015-10-24 07:50 +0200
      Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes Michal Hocko <mhocko@kernel.org> - 2015-10-25 17:40 +0100
        Re: [PATCH 4.2 25/54] memcg: convert threshold to bytes Michal Hocko <mhocko@kernel.org> - 2015-10-27 11:40 +0100
  [PATCH 4.2 50/54] rbd: fix double free on rbd_dev->header_name Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
  [PATCH 4.2 28/54] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:30 +0200
  [PATCH 4.2 51/54] timekeeping: Increment clock_was_set_seq in timekeeping_init() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:40 +0200
  [PATCH 4.2 49/54] dm thin: fix missing pool reference count decrement in pool_ctr error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:40 +0200
  Re: [PATCH 4.2 00/54] 4.2.5-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-10-24 00:00 +0200
    Re: [PATCH 4.2 00/54] 4.2.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-24 01:30 +0200
  Re: [PATCH 4.2 00/54] 4.2.5-stable review Guenter Roeck <linux@roeck-us.net> - 2015-10-24 04:10 +0200
    Re: [PATCH 4.2 00/54] 4.2.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-24 15:30 +0200

csiph-web