Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9295421ybl; Fri, 17 Jan 2020 09:29:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwADYSUaS1IT2/xCXNpShjIJAGko7Tctob8t3woHfIDYrOrUe7xa2QW87CI5RCVE55rjT51 X-Received: by 2002:aca:2210:: with SMTP id b16mr4089379oic.32.1579282163421; Fri, 17 Jan 2020 09:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579282163; cv=none; d=google.com; s=arc-20160816; b=WJD65RR3VyfAo5kard9AVisW2b3AEoTHoKVKM0yPdeGPnl23ljgx4Jvqhn0wnW81Yv 2SEgp+QwGkPu1ZyZ8+I2dAucLDNduv3PpaxBoFaFKU/fadvpbm2DPTvCns1ftscEh7/v TnGCX7ELuzGWNtYqv2JkKMP7F1iCYjNeyJ4dlybJtSvzjo6X6aHe/suLPsj3VXR2DjuB VAJWY/jGZAhtG7KSWZGBYHdvJ72kppwnrG3nIwnhxDQpGYcRDmudNKqw2c01mJLKlAeG 4sFFlLZ6Lrb+Ssb95g+gicNW/1yvNSS3HCw0UvqE6paWCGHgYetmdzyJhvgcgIqHGBI1 4y7Q== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YJBe+PR1JTzkbV6VdX/ClFM8UuTfYuVGKNcb10Up+LM=; b=F4hBGMzvnkBPv40GvEjnfQsWP1SISRDlBs+d6SnQCOdyQNTdyLcxAb3IhEDsJhcLan FHqKZ/OtquxeIjrgVBBePcuAX/jkl6iQlvQV4vrdtfh1kDDrCqsozI5vMdOJQYT04bwW XaTXzD7INNrn3Vj07GZALigflOYN6eE5/19X0txXvpHGcN87wT/kYkAdnI3Ku8TNhtUZ 1G+l7EwwM5POHFvKhTImyT2vBwqtoFAB5OIpEsFkiCuPLfVib3ciFY1bzdoquZ7jl1VF rgDlG6pll3fJKqILD1iBp99F8JKW1FqBx9p7zTIDcCkWvxU1k5pVEy+so0LxERsySDye 2EaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DbHiqO+e; 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 c19si15687835otn.7.2020.01.17.09.29.11; Fri, 17 Jan 2020 09:29:23 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DbHiqO+e; 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 S1728765AbgAQR2K (ORCPT + 99 others); Fri, 17 Jan 2020 12:28:10 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:44003 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgAQR2K (ORCPT ); Fri, 17 Jan 2020 12:28:10 -0500 Received: by mail-qt1-f195.google.com with SMTP id d18so22328496qtj.10; Fri, 17 Jan 2020 09:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=YJBe+PR1JTzkbV6VdX/ClFM8UuTfYuVGKNcb10Up+LM=; b=DbHiqO+e6kYuR6bMRUFqkRzJXzREnc/t8WeVUwNtwBq0US0ALqFtfBS3k8Ar5PzFae jpbiR7Ax+NvFzgNUZfzP6b4KBWdJJ8us7/sDH5Tiro8mnHYZM1bos9P/GDhAcxVHXG4b +CqRW+gbtb40Tq4JQ9+XfDuAtGc8xx7XWoPbLCDa9sXO0xSMc54OuWYlMPO3hMfg3xGs R6SRfw70eNBH9z1vinkvQf3Pkmv//DOGZzpDO/JeaaQZKfMlTJoC34/zqw6bnCacSApd hf6+skAgQQBrKH5W5od7c18HNBincCZTYsXdKlpO3ehhcjXZitzgNqPGCAFsoZlAoM4q MvUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YJBe+PR1JTzkbV6VdX/ClFM8UuTfYuVGKNcb10Up+LM=; b=dlGsDK2AVaRbvusaEwWxDibqJoeiK/AU65ivacLnjYcLGTxCD6VYhitgt2zmk+hptR MfK5Oi0TydvTAPAOfCqkA0RFxuYxHppwz0DY3K8zZDAOCrmo2XSvJ/m+pMI6IwnGzJ3y SGRJWwfxMcy8YdtctsVJvBwnB9dEEBhgpnYmAGhMnJEpQXDOwCUNl/gq5CnEuzmoJL0k /yqZPr8pRF7NKkW8KEjAUO3/EY5/P912PucbXcLVztykPCI9Xb68AjnO9Vpc8aFwyRYI jyGDqZvtzS6wVXn4eLQ8CGW9qjlt4QVINVasnkVXUJv4QvU1qyJFmUCOCtS6vNzRb+1Q jRLg== X-Gm-Message-State: APjAAAWFfcXNO2Ha9g7lMIHhylEmtT4DU5RLAyl3XBSPtrOy+d9nyvEq YV5glm5kx1vtcdMj/2m6AGU= X-Received: by 2002:aed:2150:: with SMTP id 74mr8430727qtc.323.1579282089045; Fri, 17 Jan 2020 09:28:09 -0800 (PST) Received: from localhost ([2620:10d:c091:500::1:7d10]) by smtp.gmail.com with ESMTPSA id r37sm13251937qtj.44.2020.01.17.09.28.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2020 09:28:08 -0800 (PST) Date: Fri, 17 Jan 2020 09:28:06 -0800 From: Tejun Heo To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: cgroups@vger.kernel.org, Johannes Weiner , Li Zefan , alex.shi@linux.alibaba.com, guro@fb.com, kernel-team@android.com, linger.lee@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, shuah@kernel.org, tomcherry@google.com Subject: Re: [PATCH 2/3] cgroup: Iterate tasks that did not finish do_exit() Message-ID: <20200117172806.GK2677547@devbig004.ftw2.facebook.com> References: <20200116043612.52782-1-surenb@google.com> <20200117151533.12381-1-mkoutny@suse.com> <20200117151533.12381-3-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200117151533.12381-3-mkoutny@suse.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 04:15:32PM +0100, Michal Koutn? wrote: > PF_EXITING is set earlier than actual removal from css_set when a task > is exitting. This can confuse cgroup.procs readers who see no PF_EXITING > tasks, however, rmdir is checking against css_set membership so it can > transitionally fail with EBUSY. > > Fix this by listing tasks that weren't unlinked from css_set active > lists. > It may happen that other users of the task iterator (without > CSS_TASK_ITER_PROCS) spot a PF_EXITING task before cgroup_exit(). This > is equal to the state before commit c03cd7738a83 ("cgroup: Include dying > leaders with live threads in PROCS iterations") but it may be reviewed > later. Yeah, this looks fine to me. Any chance you can order this before the clean up so that we can mark it for -stable. Thanks. -- tejun