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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 Mar 2016 12:19:31 +0300
From:	Vladimir Davydov <vdavydov@...tuozzo.com>
To:	Michal Hocko <mhocko@...nel.org>,
	Johannes Weiner <hannes@...xchg.org>
CC:	Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
	<cgroups@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<kernel-team@...com>
Subject: Re: [PATCH] mm: memcontrol: reclaim and OOM kill when shrinking
 memory.max below usage

On Fri, Mar 11, 2016 at 09:18:25AM +0100, Michal Hocko wrote:
> On Thu 10-03-16 15:50:14, Johannes Weiner wrote:
...
> > @@ -5037,9 +5040,36 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
> >  	if (err)
> >  		return err;
> >  
> > -	err = mem_cgroup_resize_limit(memcg, max);
> > -	if (err)
> > -		return err;
> > +	xchg(&memcg->memory.limit, max);
> > +
> > +	for (;;) {
> > +		unsigned long nr_pages = page_counter_read(&memcg->memory);
> > +
> > +		if (nr_pages <= max)
> > +			break;
> > +
> > +		if (signal_pending(current)) {
> 
> Didn't you want fatal_signal_pending here? At least the changelog
> suggests that.

I suppose the user might want to interrupt the write by hitting CTRL-C.

Come to think of it, shouldn't we restore the old limit and return EBUSY
if we failed to reclaim enough memory?

> 
> > +			err = -EINTR;
> > +			break;
> > +		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ