Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4310376ybc; Fri, 22 Nov 2019 00:22:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxDNWZY7PpMMGgtdOLVmVA7YJ/0RE6dr0hGuP0WLrAW1Gz/cX0SA2hR/HvlbcAHHwxv8dUJ X-Received: by 2002:adf:f005:: with SMTP id j5mr15971061wro.295.1574410949623; Fri, 22 Nov 2019 00:22:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574410949; cv=none; d=google.com; s=arc-20160816; b=gSlKfyZRr+F3lh7ijj49ZSo5G7K+0g7mGdnXvEG1V+fhqlGYoSxBqzKFWvUADw/vSN NSYMkK0v/T6Y/KY2dSwPOHT6k8XdkWTz6yTiyB38mZ4wmG/pvJTu/TC1kAawRoOG/bdz KwBx3nZdO0WbWuc74wlTsPnq4qwY5vzmwu5h2qXm3m4khkoYXWB7+crjWdlvw4sP8e98 DOQ3JBqgCBoDxC1AGh07S0zt4+xMBWOjYumOHXCYeSfaaV4EFHM8inCR9YJY9s72QIQK zZKTfL/8B0iwst+2HqAjIvPi7Mj+IZHuT8/prr/yMEnCj5OHdymh2pip6xsnrQ5C3+HX Bd4w== 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=oPT3v6LUVVcOVXi+g802WzoqdgMO1VqYXbBWJl6TUYI=; b=mj+d1Lywv4RfqTgJE3uoZ3qQFlqVGbaztSbc2cbYVDsXY6epx39kzlYn/6C8iwsi8X EzpohPRZQ3SsdG+OXBGC6SxZx0+JizTc9pfE1jRi7ytIv6DhlpiLoLPD2tfmas+ewIUC +RcGor9AtjFu6LHvpMlTqRr2Fa0HOJrBgM5eObS56bNo8MFDHtftuL4CkoOHL1l4L2eu lSF1q+O4dh70UNvRyVw8stUZGCCe93ux9MIz4WNvlZi4CTLIwnwgcoMVA77kL4qOtfcN gj49287jyZtgIaLQzCkaClwM+xalgSIqIRlcFbLXJHUxY9xkr9YC+xlRtn9xf43B36Z9 WXLw== 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 d10si4066114edp.264.2019.11.22.00.22.05; Fri, 22 Nov 2019 00:22:29 -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 S1726775AbfKVIUG (ORCPT + 99 others); Fri, 22 Nov 2019 03:20:06 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36618 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbfKVIUG (ORCPT ); Fri, 22 Nov 2019 03:20:06 -0500 Received: by mail-wr1-f68.google.com with SMTP id z3so7519615wru.3; 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=l8PfjEiBknhJLccXhUb9oQ5ay4+RKcqgUFyDqcQXRpOXr7TajTIEw5PDmUWDTOkuO/ CCYYk0/CFR9C4uNsypVTyYjKmwcJxnC8+WDVV8APMfp7vS2jATvYs2kknrJjy+atxlnx 2QtkYPLn+ttq6pkwqBFpwHMSIYJwF9thDjGGGCC1gdJln0x1iUTqipf0c3E5Lq0eggOY dU6wXYwZ9n6pispuF/A43AXqCQGXUtqaFFO79Hr5lks9JDT+uLE7JgtiJi3nMM2zwfFW sFubgXykJIjS3V/BNnq53knhVienGSi1JbkONV8/YyjpiKu38aI1LG910lT14G1S4AxR +WMQ== X-Gm-Message-State: APjAAAUAsJ1+NkopRFU52eQzSHKuDbhfg9i5fMdT/oQFdcq/r31u8/mn DDyR6xgH6RS8rBcMrRQB0Z8= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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