Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4772104ybc; Fri, 15 Nov 2019 09:49:21 -0800 (PST) X-Google-Smtp-Source: APXvYqw9mh3mo9qT78R9VoDOm6ZfMF65Tz/GMRZ7qF26p47zXBZ/eZDf6CyuSQo64zAL6CHGbbnU X-Received: by 2002:a17:906:53cc:: with SMTP id p12mr2553439ejo.52.1573840161423; Fri, 15 Nov 2019 09:49:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573840161; cv=none; d=google.com; s=arc-20160816; b=Sh/ITVMaHjwFnSJUcw4oaDc6n/MAUaXyttZdkXbEPZUOx22ghfrfy/0ukOuxxHVC0Y kvN6SG1ei4QhTGD3c9rC9JPCiv/ugWQGs5P7ULKltOKKfaPhV3RBL+ay1NLIil0UBKDf GcinhKgpm09pBD2FPXl53UcyR6hEFW9L5qmko2CUUZPf7C6XSZv3H5/mepT6w0hKrZuo vu7a9LcK390KGKInP9xje5aQ5Cv4DDZ4E9pBF5ROBr8na/Z+q0skpuBlj0XOlpwuztMx n3wRaYBm2olQES353HvWm1fsmINiSPiTwSw5nZ1Y5H9IYdU+pW41JgNNX39qpDhNFH7A XG2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=90H4viFkmkc5MaqIAkQoONaP0YjvWs8WszQFpI8Fhtw=; b=dO5D9T+EpTrPYwaXq3zEt3+y5tPNxNfwcod5mNCO19wlHrvyRliujt7GgjMdIeoAbg M3hoPex2ZeE5U+M1p3kD4lYftgyGuvEkT4y7/yPM3JEOE9eruoQ6ntBBg723p5UFmLN0 I4VfwhJMmBwsY7UVYS8alZgGQV98bzTIZ8MB4vSBJEGj/uCa0Nq9wDQsDf+ACUTDQWdH kI/UaHA52ON6w5pR0jXiGA2LptbtlDFWKlPXqHqoaXFy4dddH/cMr1IZHOq9uHap0mxT ziaooqx3BNeCenCC9w1WgeWU06kmBbijpsOCH2fzMAxZsH1yij9jYcJ1sd9uZDyxrjhc Qe+g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c31si6902098edb.56.2019.11.15.09.48.56; Fri, 15 Nov 2019 09:49:21 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbfKORrY (ORCPT + 99 others); Fri, 15 Nov 2019 12:47:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:34730 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbfKORrY (ORCPT ); Fri, 15 Nov 2019 12:47:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 956CEAFF1; Fri, 15 Nov 2019 17:47:22 +0000 (UTC) Date: Fri, 15 Nov 2019 18:47:21 +0100 From: Michal Hocko To: Tejun Heo Cc: Roman Gushchin , Michal =?iso-8859-1?Q?Koutn=FD?= , "linux-mm@kvack.org" , Andrew Morton , Johannes Weiner , "linux-kernel@vger.kernel.org" , Kernel Team , "stable@vger.kernel.org" Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Message-ID: <20191115174721.GB15216@dhcp22.suse.cz> References: <20191106225131.3543616-1-guro@fb.com> <20191113162934.GF19372@blackbody.suse.cz> <20191113170823.GA12464@castle.DHCP.thefacebook.com> <20191114191657.GN20866@dhcp22.suse.cz> <20191114192018.GJ4163745@devbig004.ftw2.facebook.com> <20191114193340.GA24848@dhcp22.suse.cz> <20191114193736.GL4163745@devbig004.ftw2.facebook.com> <20191115174031.GA15216@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115174031.GA15216@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 15-11-19 18:40:31, Michal Hocko wrote: > On Thu 14-11-19 11:37:36, Tejun Heo wrote: > > Hello, > > > > On Thu, Nov 14, 2019 at 08:33:40PM +0100, Michal Hocko wrote: > > > > It is useful for controlling admissions of new userspace visible uses > > > > - e.g. a tracepoint shouldn't be allowed to be attached to a cgroup > > > > which has already been deleted. > > > > > > I am not sure I understand. Roman says that the cgroup can get offline > > > right after the function returns. How is "already deleted" different > > > from "just deleted"? I thought that the state is preserved at least > > > while the rcu lock is held but my memory is dim here. > > > > It's the same difference as between "opening a file and deleting it" > > and "deleting a file and opening it". > > I am sorry but I do not follow. How can css_tryget_online provide the > same semantic when the css can go offline right after the tryget call > returns so it is effectivelly undistinguishable from the case when the > css was already online before the call was made. s@online@offline@ And reading after myself it turned out to sound differently than I meant. What I wanted to say really is, what is the difference that css_tryget_online really guarantee when the css might go offline right after the call suceeds so more specifically what is the difference between if (css_tryget()) { if (online) DO_SOMETHING } and if (css_tryget_online()) { DO_SOMETHING } both of them are racy and do not provide any guarantee wrt. online state. -- Michal Hocko SUSE Labs