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]
Message-Id: <20201130121956.d03efaa95d3112d0b91291d6@linux-foundation.org>
Date:   Mon, 30 Nov 2020 12:19:56 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Dmitry Osipenko <digetx@...il.com>
Cc:     Alex Shi <alex.shi@...ux.alibaba.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Shakeel Butt <shakeelb@...gle.com>,
        Roman Gushchin <guro@...com>,
        Lorenzo Stoakes <lstoakes@...il.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
        Yafang Shao <laoar.shao@...il.com>,
        Wei Yang <richard.weiyang@...il.com>,
        linux-kernel@...r.kernel.org,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] mm/memcg: bail out early when !memcg in
 mem_cgroup_lruvec

On Mon, 30 Nov 2020 22:44:11 +0300 Dmitry Osipenko <digetx@...il.com> wrote:

> > From: Alex Shi <alex.shi@...ux.alibaba.com>
> > Date: Wed, 25 Nov 2020 14:06:33 +0800
> > Subject: [PATCH v2] mm/memcg: bail out early when !memcg in mem_cgroup_lruvec
> > 
> > Sometime, we use NULL memcg in mem_cgroup_lruvec(memcg, pgdat)
> > so we could get out early in the situation to avoid useless checking.
> > 
> > Polished as Andrew Morton's suggestion.
> > 
> > --- a/include/linux/memcontrol.h
> > +++ b/include/linux/memcontrol.h
> > @@ -610,20 +610,17 @@ mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid)
> >  static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
> >  					       struct pglist_data *pgdat)
> >  {
> > -	struct mem_cgroup_per_node *mz;
> >  	struct lruvec *lruvec;
> >  
> > -	if (mem_cgroup_disabled()) {
> > +	if (mem_cgroup_disabled() || !memcg) {
> >  		lruvec = &pgdat->__lruvec;
> > -		goto out;
> > -	}
> > +	} else {
> > +		struct mem_cgroup_per_node *mz;
> >  
> > -	if (!memcg)
> > -		memcg = root_mem_cgroup;
> > +		mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
> > +		lruvec = &mz->lruvec;
> > +	}
> >  
> > -	mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
> > -	lruvec = &mz->lruvec;
> > -out:
> >  	/*
> >  	 * Since a node can be onlined after the mem_cgroup was created,
> >  	 * we have to be prepared to initialize lruvec->pgdat here;
> > 
> 
> Hi,
> 
> This patch causes a hard lock on one of my ARM32 devices using today's
> linux-next, please fix.

Thanks.

This is unexpected.  I assume you've confirmed that reverting this
change from linux-next fixes things?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ