lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 27 Oct 2015 11:31:43 +0100
From:	Michal Hocko <mhocko@...nel.org>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Shaohua Li <shli@...com>, Johannes Weiner <hannes@...xchg.org>,
	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 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@...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

Powered by Openwall GNU/*/Linux Powered by OpenVZ