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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 DD955C432C0 for ; Fri, 22 Nov 2019 08:20:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8C2E52070E for ; Fri, 22 Nov 2019 08:20:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C2E52070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C99406B04B4; Fri, 22 Nov 2019 03:20:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C4A026B04B5; Fri, 22 Nov 2019 03:20:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5EFF6B04B6; Fri, 22 Nov 2019 03:20:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 9FC1D6B04B4 for ; Fri, 22 Nov 2019 03:20:05 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 47A9652A6 for ; Fri, 22 Nov 2019 08:20:05 +0000 (UTC) X-FDA: 76183215570.12.women12_75203a0509739 X-HE-Tag: women12_75203a0509739 X-Filterd-Recvd-Size: 3461 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Nov 2019 08:20:04 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id z7so4084366wrl.13 for ; Fri, 22 Nov 2019 00:20:04 -0800 (PST) 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:user-agent; bh=oPT3v6LUVVcOVXi+g802WzoqdgMO1VqYXbBWJl6TUYI=; b=XgBbO9ejsaq0zNb8wW1NY7iqZCbGFFhmuToJ38NxMDwIHuVW5n4piocNsSBNa60hdE +GOw5eSluk3XcoyLemFwIZQpPt70RgSbFpmBK4eKVgsQUS0aDpJLHxBzPRjahNKHMJfk JhgRR57FC238msTtfb7Ak3Azl7i4VSdYSgKgYA7ZkePjM7zRE4x2EL5X9YOP1k8+kDch KX2hfXQemifzPIzubQT2IKYhLpR62o09eod7ErKzwNJnpIiTGy6YyXtcRLik4Qk5CE8W jS7sJFuySIsERUnZvrYVuZ7/tDJjfbLyb1YPTQhByykWwhe84G64aQc6LoKJvzueP67o Cx0Q== X-Gm-Message-State: APjAAAWdhA+sMlFgZd4lR2tn4KIJ9oANW8GsKK8C7PTGalOoG6wZSyuS vynVxHgd+PC+sZ9KHWyLmRs= X-Google-Smtp-Source: APXvYqxCiNaVvdFuGx1EHIvyZ/qVW3RIpS2NmxW8P6HtapWUa9SJQAxcL2KD6HkTcQmn22Ao0CafaA== X-Received: by 2002:a5d:48cf:: with SMTP id p15mr29505wrs.46.1574410803823; Fri, 22 Nov 2019 00:20:03 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id o189sm2740666wmo.23.2019.11.22.00.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 00:20:03 -0800 (PST) Date: Fri, 22 Nov 2019 09:20:02 +0100 From: Michal Hocko To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: Roman Gushchin , "linux-mm@kvack.org" , Andrew Morton , Johannes Weiner , "linux-kernel@vger.kernel.org" , Kernel Team , "stable@vger.kernel.org" , Tejun Heo Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Message-ID: <20191122082002.GP23213@dhcp22.suse.cz> References: <20191106225131.3543616-1-guro@fb.com> <20191113162934.GF19372@blackbody.suse.cz> <20191113170823.GA12464@castle.DHCP.thefacebook.com> <20191121152847.GA14375@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121152847.GA14375@blackbody.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Thu 21-11-19 16:28:47, Michal Koutny wrote: > On Wed, Nov 13, 2019 at 05:08:29PM +0000, Roman Gushchin wrote: > > The thing here is that css_tryget_online() cannot pin the online state, > > so even if returned true, the cgroup can be offline at the return from > > the function. > Adding this for the record. > > The actual offlining happens only from css_killed_ref_fn, which is > percpu_ref_kill_and_confirm confirmation callback. That is only called > after RCU grace period. So, css_tryget_online will pin the online state > _inside_ rcu_read_{,un}lock section. Thanks for the confirmation. Maybe we should start with a trivial patch and document this first. We can go and cleanup bogus users on top. -- Michal Hocko SUSE Labs