[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yh6QqEFTxUuDEst2@bombadil.infradead.org>
Date: Tue, 1 Mar 2022 13:31:20 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Shakeel Butt <shakeelb@...gle.com>,
Colin Ian King <colin.king@...onical.com>,
NeilBrown <neilb@...e.de>, Vasily Averin <vvs@...tuozzo.com>,
Vlastimil Babka <vbabka@...e.cz>,
Michal Hocko <mhocko@...e.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Linux MM <linux-mm@...ck.org>, netdev@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Tejun Heo <tj@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Eric Dumazet <edumazet@...gle.com>,
Kees Cook <keescook@...omium.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>, linux-kernel@...r.kernel.org,
kernel@...nvz.org
Subject: Re: [PATCH RFC] net: memcg accounting for veth devices
On Tue, Mar 01, 2022 at 01:25:16PM -0800, Luis Chamberlain wrote:
> diff --git a/kernel/ucount.c b/kernel/ucount.c
> index 4f5613dac227..980ffaba1ac5 100644
> --- a/kernel/ucount.c
> +++ b/kernel/ucount.c
> @@ -238,6 +238,8 @@ struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid,
> long max;
> tns = iter->ns;
> max = READ_ONCE(tns->ucount_max[type]);
> + if (atomic_long_read(&iter->ucount[type]) > max/16)
> + cond_resched();
> if (!atomic_long_inc_below(&iter->ucount[type], max))
> goto fail;
You can of course ignore this, it was just a hack to try to avoid
a soft lockup on the workqueues.
Luis
Powered by blists - more mailing lists