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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76439C2BA80 for ; Tue, 7 Apr 2020 03:09:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3A988206B8 for ; Tue, 7 Apr 2020 03:09:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xcERT+75" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A988206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DAEA78E0068; Mon, 6 Apr 2020 23:09:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D38208E0062; Mon, 6 Apr 2020 23:09:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C74758E0068; Mon, 6 Apr 2020 23:09:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id A504C8E0062 for ; Mon, 6 Apr 2020 23:09:18 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 70F38801A1F0 for ; Tue, 7 Apr 2020 03:09:18 +0000 (UTC) X-FDA: 76679577996.09.peace20_8b6e086f38f12 X-HE-Tag: peace20_8b6e086f38f12 X-Filterd-Recvd-Size: 3326 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Apr 2020 03:09:17 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14089206B8; Tue, 7 Apr 2020 03:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586228957; bh=IleEH8eUZ5JNfdhU/wE6VftnmIBw+VC0F2ldmg3Eoiw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xcERT+75MvTw7CvyJeByWC4lkA7YLH66V3D4Jr+XixJvacQ5XVL4GCKJXiOGhBVlD ULluyo9cH/n0nwPvyH/pyXMI1WimnEF0m9zB4I9xeIdDIlZhVaVw50bDpCLXnuEltz ukzRJyi4wJ5dXZWkH4OGXcJO6TeQ00y0nrhOwwS8= Date: Mon, 6 Apr 2020 20:09:16 -0700 From: Andrew Morton To: Yafang Shao Cc: Matthew Wilcox , Johannes Weiner , Michal Hocko , Vladimir Davydov , Linux MM Subject: Re: [PATCH v3] mm, memcg: fix error return value of mem_cgroup_css_alloc() Message-Id: <20200406200916.2623f34403155264d8c8e9e7@linux-foundation.org> In-Reply-To: References: <1586192163-20099-1-git-send-email-laoar.shao@gmail.com> <20200406162343.6ae4b8f74c74bcb84d026471@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 7 Apr 2020 11:02:31 +0800 Yafang Shao wrote: > On Tue, Apr 7, 2020 at 7:23 AM Andrew Morton wrote: > > > > On Tue, 7 Apr 2020 00:56:03 +0800 Yafang Shao wrote: > > > > > When I run my memcg testcase which creates lots of memcgs, I found > > > there're unexpected out of memory logs while there're still enough > > > available free memory. The error log is, > > > mkdir: cannot create directory 'foo.65533': Cannot allocate memory > > > > > > The reason is when we try to create more than MEM_CGROUP_ID_MAX memcgs, an > > > -ENOMEM errno will be set by mem_cgroup_css_alloc(), but the right errno > > > should be -EBUSY "Device or resource busy". That is same with > > > memcg_alloc_cache_id(). > > > > > > As the errno really misled me, we should make it right. After this patch, > > > the error log will be, > > > mkdir: cannot create directory 'foo.65533': Device or resource busy > > > > Thanks. > > > > Was a -stable backport considered? > > I only backported to our kernel version 4.18, but I'm not sure whether > it will apply to -stable or not. > Seems this issue is introduced long time ago. I will try to backport > it to -stable. > Should I try it based on 5.5.y and 5.6.y only ? Or all the LTS kernel > versions ? What I'm asking (of you and of reviewers) is whether this issue is sufficiently serious to require fixing in -stable kernels. The patch merging details can be sorted out later.