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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 88088C2BA1A for ; Tue, 7 Apr 2020 18:10:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2FE2A2076E for ; Tue, 7 Apr 2020 18:10:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="KsNrkHUE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FE2A2076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF8668E0005; Tue, 7 Apr 2020 14:10:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA84F8E0001; Tue, 7 Apr 2020 14:10:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABE4F8E0005; Tue, 7 Apr 2020 14:10:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 920148E0001 for ; Tue, 7 Apr 2020 14:10:17 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 479CF181AEF07 for ; Tue, 7 Apr 2020 18:10:17 +0000 (UTC) X-FDA: 76681848474.19.news95_26b986db2a4d X-HE-Tag: news95_26b986db2a4d X-Filterd-Recvd-Size: 5113 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Apr 2020 18:10:16 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id h14so345514qke.5 for ; Tue, 07 Apr 2020 11:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BCBwJyjKlbP2Q9TSTqAfw3wtTDfyCK8IbxkgMehK8Cs=; b=KsNrkHUE0Aiplh3kNV/qEmx593UgomzrqzGoevUnPlhhsHTsgJ1Z4X0TACgw8Aiu9S O22kp5Az75ZyG4XW2PtQT9FoPFcd6qmkEWrlrc+HdJGoLGDg0wD5K2CUQck+68H9vpSb c0nA3lHqp97iojSKIysjQqq8CgLzEiXTVZSHCrSKq52yhG6kVERT7BreNWfR6ipco6VP L8+N6FXVJMke1fx3NgzmvPhrYXloodPcHBtzh51eWIWyyNAx5dlQdl9mAT5PRj1+/5KG t6e4or8CmBrO/UM6xLWTD//g7iUaHUFNetyk9B2h+N3F77jZeLNlVcYbHzh2aPluWbpw qecg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BCBwJyjKlbP2Q9TSTqAfw3wtTDfyCK8IbxkgMehK8Cs=; b=IK3gTKN8ULmq9ghhTQCbTKX8Ux0510ZdgMficxFAKjXNP7dkL/kgFu/4F3AYjjFsH9 zG/ZVjUxr71pKTeSm7hYS3zsfPPW3yxUp+CyMCaU8U4vClgpkLzNzPWiDr1JXSxWJBH8 iG+rS8vklHLFhF8D+eoBLW7+lfx3t3+FrcNjK8Du0SBx/4SgqtVeIf5zjoUelhb96yGZ qVYScI5zKeZ9Oe7cpINEcd5bQkjHNiK64CmGf2a32TRdAIZIlxxZMMLxScPKWgLWGcSF xGqPIpebcJeaMuU9F8/m3Io2qJUprCbtfgnIuh+INwVCPhTXehca28zOfQlq5DpHsfcE zF1A== X-Gm-Message-State: AGi0PuYPEMTN07L95KsHNybG7TnzFEQQJTCFVec5oHgjDB8EjmX+lvQx TRPZuueNkTFHLc2XVNSb6/95AA== X-Google-Smtp-Source: APiQypJf8b8RU9x7GFdo58Q0mqB7XdGNJXS/pYzX3re1wB+yCOpKyF7ND2GcpxFlumBCoGM9gA3uvg== X-Received: by 2002:a05:620a:48:: with SMTP id t8mr3568872qkt.21.1586283015456; Tue, 07 Apr 2020 11:10:15 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id t11sm3389935qto.75.2020.04.07.11.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 11:10:14 -0700 (PDT) Date: Tue, 7 Apr 2020 14:10:12 -0400 From: Johannes Weiner To: Michal Hocko Cc: Yafang Shao , Andrew Morton , Matthew Wilcox , Vladimir Davydov , Linux MM Subject: Re: [PATCH v3] mm, memcg: fix error return value of mem_cgroup_css_alloc() Message-ID: <20200407181012.GA12461@cmpxchg.org> References: <1586192163-20099-1-git-send-email-laoar.shao@gmail.com> <20200406162343.6ae4b8f74c74bcb84d026471@linux-foundation.org> <20200406200916.2623f34403155264d8c8e9e7@linux-foundation.org> <20200407064329.GB18914@dhcp22.suse.cz> <20200407111017.GN18914@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200407111017.GN18914@dhcp22.suse.cz> 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, Apr 07, 2020 at 01:10:17PM +0200, Michal Hocko wrote: > On Tue 07-04-20 17:31:33, Yafang Shao wrote: > > I checked the explaination about ENOSPC in 73f576c04b94 ("mm: > > memcontrol: fix cgroup creation failure after many small jobs") > > carefully, but I don't a clear idea which one is better now. > > The changelog simply mentioned that without the additional id tracking > the ENOSPC would have been returned from elsewhere. I haven't checked > but I suspect it would be from the cgroup core. This patch just didn't > propagate the idr failure specifically and hid it under the ENOMEM > failure path. I can only speculate why that was the case but I suspect > that Johannes simply didn't consider the distinction important enough. The old -ENOSPC came directly from the memcg css online callback: - if (css->id > MEM_CGROUP_ID_MAX) - return -ENOSPC; And it only became a problem because, on big memory machines (128+G) with a high rate of short-lived jobs, lazily freed cgroups piled up over the course of multiple days and clogged up the ID space. Nobody actually tried to create 64k user-visible cgroups concurrently. It's hard to imagine any machine running that many meaningfully distinct memory consumers in parallel. So I didn't think (and still don't tbh) it matters all that much in practice what we return here. I'm not against changing it back to -ENOSPC. And I agree with Michal it might be better than -EBUSY because of the mkdir() interface. Given how unlikely this is to affect real setups, I don't think this patch is stable material.