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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 389EFC433F5 for ; Fri, 20 May 2022 23:49:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78F716B0071; Fri, 20 May 2022 19:49:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73F1F6B0072; Fri, 20 May 2022 19:49:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62DF06B0073; Fri, 20 May 2022 19:49:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 554436B0071 for ; Fri, 20 May 2022 19:49:14 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id DCCA9801CE for ; Fri, 20 May 2022 23:49:08 +0000 (UTC) X-FDA: 79487764776.14.F66FDF3 Received: from r3-18.sinamail.sina.com.cn (r3-18.sinamail.sina.com.cn [202.108.3.18]) by imf18.hostedemail.com (Postfix) with SMTP id 811E31C000A for ; Fri, 20 May 2022 23:48:51 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.249.57.134]) by sina.com (172.16.97.35) with ESMTP id 628828C10001B1AB; Fri, 21 May 2022 07:48:18 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 86644915073798 From: Hillf Danton To: Tejun Heo Cc: Tadeusz Struk , Michal Koutny , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzbot+e42ae441c3b10acf9e9d@syzkaller.appspotmail.com Subject: Re: [PATCH] cgroup: don't queue css_release_work if one already pending Date: Sat, 21 May 2022 07:48:54 +0800 Message-Id: <20220520234854.2639-1-hdanton@sina.com> In-Reply-To: References: <20220412192459.227740-1-tadeusz.struk@linaro.org> <20220414164409.GA5404@blackbody.suse.cz> <20220422100400.GA29552@blackbody.suse.cz> <20220519112319.2455-1-hdanton@sina.com> <25fb057a-077f-b601-dcb7-130071c733db@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.18 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none X-Rspam-User: X-Stat-Signature: z3xoy4eimdan3duxwf3ahowzeru8z88t X-Rspamd-Queue-Id: 811E31C000A X-Rspamd-Server: rspam01 X-HE-Tag: 1653090531-407827 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, 19 May 2022 22:13:47 -1000 Tejun Heo wrote: > On Thu, May 19, 2022 at 04:26:51PM -0700, Tadeusz Struk wrote: > > On 5/19/22 04:23, Hillf Danton wrote: > > > On Wed, 18 May 2022 09:48:21 -0700 Tadeusz Struk wrote: > > > > On 4/22/22 04:05, Michal Koutny wrote: > > > > > On Thu, Apr 21, 2022 at 02:00:56PM -1000, Tejun Heo wrote: > > > > > > If this is the case, we need to hold an extra reference to be put by the > > > > > > css_killed_work_fn(), right? > > > > > > That put could trigger INIT_WORK in css_release() and warning [1] > > > on init active (active state 0) object OTOH as the same > > > css->destroy_work is used in both kill and release pathes. > > Hmm... wouldn't the extra reference keep release from happening? Hm...Hm... have difficulty following up given the risk of memleak without release. > > > Will this help if there would be two WQs, one for the css_release path > > and one for the rcu_work? Unlikely as adding one more queue does not help INIT_WORK. Hillf > > > > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c > > index adb820e98f24..a4873b33e488 100644 > > --- a/kernel/cgroup/cgroup.c > > +++ b/kernel/cgroup/cgroup.c > > @@ -124,6 +124,7 @@ DEFINE_PERCPU_RWSEM(cgroup_threadgroup_rwsem); > > * which may lead to deadlock. > > */ > > static struct workqueue_struct *cgroup_destroy_wq; > > +static struct workqueue_struct *cgroup_destroy_rcu_wq; > > I don't understand why this would help. Care to elaborate? > > Thanks. > > -- > tejun