Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3191999imm; Sun, 29 Jul 2018 12:28:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnYJ6NrZ+8pSQQfpQgVf707g2S/xHA+e6dZoXHm+d9y4vMYGQX4jkYH56zjKCnxRVqT1xc X-Received: by 2002:a17:902:d716:: with SMTP id w22-v6mr13630587ply.98.1532892494220; Sun, 29 Jul 2018 12:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532892494; cv=none; d=google.com; s=arc-20160816; b=lw3tmpz7H4+hGciNWdBSR6sGsksCqdLZ3L38ewWgMJlNkabRIi8pjgIKC3/zL1t0FT 0cQ6Eo5wlmriEEzGjVQE45XYKTuDc4jVCX31ttnig/rfGrL9vBvSxLoxX46OIQVC1PNm dLg3DZJgJ7TJAiBnZ1q86S2xuUZC4yG5pYxKdJoJZ5b/KWYVd6Tyq2kEMq6gjL6NdE/Q C3CBdHsBBHooNppXqQeIm3SsHzEquK7DPiWlzt70ygL9ojzJwYozk/+dFkO844yZLgQq rGzXNddvIQSCbSEiUGM5YIfIlGnR6noU5T6mCWRQd79m/qsIcH3uYZSwhTP8KkHAB4Ek o5UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=g120l+1kg1FvM93625X2HLCbuZ/cj28KpMCzCv6H4kk=; b=oF5gCss8eQh8GZ7flSsmSjSFeRSBT7f9XxzEyBrK+e3UUouYACReWDUZCM8lIbtf2c Js/B+wOqpR81I51eGXcjyp8HqClszbc9s4fturriXvcvWGkvZ/xfI8cJNRQltZppI7uf ajhACNYf6zuEPpJczst4/a5STO3sHxXujWDgU26IEKLNSK4qTBoCoRGcDGU7X2gHfksw wsPMxGrfxyZuVVjNCaq+k+JYtZdZCDnjMQPcstQFz8qG397FUdEIaTqfjNbPkajxb0AH YXXzYIefouLXkJHLFDhEN33QgpzplCuGzBVrTdeVpi13w3ryPgV+rnEDPru9GezZ/Pqs TH3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhfO7xvS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j38-v6si8127899pgj.613.2018.07.29.12.27.46; Sun, 29 Jul 2018 12:28:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhfO7xvS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbeG2U54 (ORCPT + 99 others); Sun, 29 Jul 2018 16:57:56 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45838 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbeG2U54 (ORCPT ); Sun, 29 Jul 2018 16:57:56 -0400 Received: by mail-lj1-f194.google.com with SMTP id w16-v6so4966360ljh.12; Sun, 29 Jul 2018 12:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g120l+1kg1FvM93625X2HLCbuZ/cj28KpMCzCv6H4kk=; b=bhfO7xvSEvOjtMVR0cbM4dUCpJF3zsiWH/xeAfEICI0dpMBdNpxrJdjLI9hbU3pFf8 r4v8H8Nm6DXVyDyqyifWqksTds3nY9GxXdnEfUPEm/gOGbTxb6FGY+qZaiOqg0XPVJ7f D1rFOaqEHXAhkPs1cfR5N92DVcyuv22FBPyG+jPKO8pfPWWKLtCo+ipG2wD64YZZc45a Y3QODYd0A0jHKrVyo8UdZyIw3HY7eLQmpKaLwtLrGUDIVv7/ggMBUf2LJc9f09q90x4w uugweW+4szHy1FsMBR8pKcBTB8hVMNZU5O6Qey3qmbUS7GuTcxRtWfCAflS+ObyDiWd9 WMBw== 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=g120l+1kg1FvM93625X2HLCbuZ/cj28KpMCzCv6H4kk=; b=Y6xwWEqJye9+EcDzXykbcDYu/ppyhWbYvgUyDp9Rg2LC0SRmMa234tGUpyeypOdG0s B/LZbbK/Zp+h057S86t3mfTVPrIVh1j2QwY8kFbfLAduTBEvNuDqONoS0BHJvGy+UQ1q GT0kqvCdv9dlzCk4aRTV0LVAuYqg0V6+YHyDdZWl3pMjoxHKCLYhxqESNNqfHZWRq5om mQpjQYltk+5HesXoD5bk5uc8kybZ5gPtzn82g3AKmRWTvXVVSS/xvQs2sDL++d7VHO+c +ckptn6iHmRzjNHJswhJTkwbCfHwd2XTvzFyhMEHUoISnwp6uYO9nkrXOFYAkE+C3Mrn 1vSA== X-Gm-Message-State: AOUpUlE4g2KQJa0YdzZrewe7xrNPOReLCyl3oQmxWVHVa6yzWboMTF5S RpwwyQBpzfNj0mEvhQZ/HnQ= X-Received: by 2002:a2e:9c0f:: with SMTP id s15-v6mr3962926lji.97.1532892385024; Sun, 29 Jul 2018 12:26:25 -0700 (PDT) Received: from esperanza (81.5.99.119.dhcp.mipt-telecom.ru. [81.5.99.119]) by smtp.gmail.com with ESMTPSA id m71-v6sm1691773lje.84.2018.07.29.12.26.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Jul 2018 12:26:23 -0700 (PDT) Date: Sun, 29 Jul 2018 22:26:21 +0300 From: Vladimir Davydov To: Johannes Weiner Cc: Andrew Morton , Michal Hocko , Kirill Tkhai , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: Remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() failure Message-ID: <20180729192621.py4znecoinw5mqcp@esperanza> References: <20180413112036.GH17484@dhcp22.suse.cz> <6dbc33bb-f3d5-1a46-b454-13c6f5865fcd@virtuozzo.com> <20180413113855.GI17484@dhcp22.suse.cz> <8a81c801-35c8-767d-54b0-df9f1ca0abc0@virtuozzo.com> <20180413115454.GL17484@dhcp22.suse.cz> <20180413121433.GM17484@dhcp22.suse.cz> <20180413125101.GO17484@dhcp22.suse.cz> <20180726162512.6056b5d7c1d2a5fbff6ce214@linux-foundation.org> <20180727193134.GA10996@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180727193134.GA10996@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 27, 2018 at 03:31:34PM -0400, Johannes Weiner wrote: > That said, the lifetime of the root reference on the ID is the online > state, we put that in css_offline. Is there a reason we need to have > the ID ready and the memcg in the IDR before onlining it? I fail to see any reason for this in the code. > Can we do something like this and not mess with the alloc/free > sequence at all? I guess so, and this definitely looks better to me.