From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0708C43334 for ; Sun, 26 Jun 2022 01:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233781AbiFZB4O (ORCPT ); Sat, 25 Jun 2022 21:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233613AbiFZB4N (ORCPT ); Sat, 25 Jun 2022 21:56:13 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 966F913CF6; Sat, 25 Jun 2022 18:56:12 -0700 (PDT) Date: Sat, 25 Jun 2022 18:56:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656208570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bjZI8DTIvucVtX5WQZE5x3xoKYG/ekTnBVDG7567Nww=; b=vBWYqIw/oxs4LrYOucwfyC44hX5VSaebHW971hVyDMn4SEhSuSadnHtg1E+KN4TGyCzs+z F3S9YtDszUv1h9nslGbXgumAJzW5MRY9w5oYa8exaPjre30t7l24VyPOJ07n3IC4FsnYVH qgisoDutY8/3V8XvFjIsNgz7E4Ru4eU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org Subject: Re: [PATCH RFC] memcg: notify about global mem_cgroup_id space depletion Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 25, 2022 at 05:04:27PM +0300, Vasily Averin wrote: > Currently host owner is not informed about the exhaustion of the > global mem_cgroup_id space. When this happens, systemd cannot > start a new service, but nothing points to the real cause of > this failure. > > Signed-off-by: Vasily Averin > --- > mm/memcontrol.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d4c606a06bcd..5229321636f2 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -5317,6 +5317,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) > 1, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL); > if (memcg->id.id < 0) { > error = memcg->id.id; > + pr_notice_ratelimited("mem_cgroup_id space is exhausted\n"); > goto fail; > } Hm, in this case it should return -ENOSPC and it's a very unique return code. If it's not returned from the mkdir() call, we should fix this. Otherwise it's up to systemd to handle it properly. I'm not opposing for adding a warning, but parsing dmesg is not how the error handling should be done. Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: Re: [PATCH RFC] memcg: notify about global mem_cgroup_id space depletion Date: Sat, 25 Jun 2022 18:56:04 -0700 Message-ID: References: Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656208570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bjZI8DTIvucVtX5WQZE5x3xoKYG/ekTnBVDG7567Nww=; b=vBWYqIw/oxs4LrYOucwfyC44hX5VSaebHW971hVyDMn4SEhSuSadnHtg1E+KN4TGyCzs+z F3S9YtDszUv1h9nslGbXgumAJzW5MRY9w5oYa8exaPjre30t7l24VyPOJ07n3IC4FsnYVH qgisoDutY8/3V8XvFjIsNgz7E4Ru4eU= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vasily Averin Cc: Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , kernel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Morton , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Vlastimil Babka , Muchun Song , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Sat, Jun 25, 2022 at 05:04:27PM +0300, Vasily Averin wrote: > Currently host owner is not informed about the exhaustion of the > global mem_cgroup_id space. When this happens, systemd cannot > start a new service, but nothing points to the real cause of > this failure. > > Signed-off-by: Vasily Averin > --- > mm/memcontrol.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d4c606a06bcd..5229321636f2 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -5317,6 +5317,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) > 1, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL); > if (memcg->id.id < 0) { > error = memcg->id.id; > + pr_notice_ratelimited("mem_cgroup_id space is exhausted\n"); > goto fail; > } Hm, in this case it should return -ENOSPC and it's a very unique return code. If it's not returned from the mkdir() call, we should fix this. Otherwise it's up to systemd to handle it properly. I'm not opposing for adding a warning, but parsing dmesg is not how the error handling should be done. Thanks!