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 D120CC433F5 for ; Fri, 20 May 2022 16:38:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 495ED6B0071; Fri, 20 May 2022 12:38:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 446E86B0072; Fri, 20 May 2022 12:38:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C3826B0073; Fri, 20 May 2022 12:38:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1CC196B0071 for ; Fri, 20 May 2022 12:38:17 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E0F901AC0 for ; Fri, 20 May 2022 16:38:16 +0000 (UTC) X-FDA: 79486678992.13.A346E53 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf13.hostedemail.com (Postfix) with ESMTP id 084772001A for ; Fri, 20 May 2022 16:37:51 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id n10so8499683pjh.5 for ; Fri, 20 May 2022 09:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=hoJZvnIpBTxSS+NvK5QFvGTIhA7+7bok5vtz0bhr51E=; b=i70QAriHRCuKmzqDL3P9nf1UtjVDnyiDgyTqJejByjqv/L8Kv1qoTJQXvGLfk70yvX Oq3Fn4ev9BUK1uwAZzvEgD4JwT4kzpzK/KOTDjiKOA4MGKhFTP998zIlGF6Q0mDo8FBc C5VZyhc0chgc8CkuGh/ftwdYcYIhwnIArBem+dV6nAYKmnDexobMoUrcreDmtIgqwY5n 6kpZoGoU/Cn3ZIJtUS/GZn055YuHPA9mfo195ydq3JYInViEg2HV7BrceTXCH8FpP80r xgp9J//goYt1UVD3v1rooCPMmARZ5Ugzm5kOXiik8xylkkOCDax0Fcgdl7NB/oDaxPuU nHuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=hoJZvnIpBTxSS+NvK5QFvGTIhA7+7bok5vtz0bhr51E=; b=tj1nKePiBhsvwaB4l3F0DU/SUEXi2NnI8IkFzdSZUAEnjkbuQ++Kiv+Ymfe/w6gHcx 3fhxo127iURIqS1zbl8n0mX8KZQx9F0HuSR6zdO9ApTbGe07KLs5wh6JGJ0tfhtKDdaI GAUqS8BagTkpG2RdqpxbOxxDgchO1He5FfC6lvOOmW6MyJJEigy3hyBQwQkQN8WM63rk /uIZbblOww4jx8SHwv4achax6F/lXucnYvjluQ5huloo0uqBIsR4R9CCuEdRWCdXane4 HIjO+4ptf7Fbn1PDXaGi4/tIZ3EMAsaW4OZTlwbcNbErxjYOhoII7JUglZ8rsFkP7i8S U7TA== X-Gm-Message-State: AOAM530pfWal2s+HhL9vKDpxgET+2g7lu3yJMxqZu65ivWlvoIBnJEMF yIf7hCpwU60rB2vd6JLh49hBRg== X-Google-Smtp-Source: ABdhPJxzeHy0Jx00QELFfKUnZJ0Mg5mXTsPynx9erbgaKfJ+ckKpAhM3gTGkP0NvpYb65lyR1YbV+Q== X-Received: by 2002:a17:902:8683:b0:161:e5a5:e388 with SMTP id g3-20020a170902868300b00161e5a5e388mr7046393plo.167.1653064694972; Fri, 20 May 2022 09:38:14 -0700 (PDT) Received: from [192.168.254.17] ([50.39.160.154]) by smtp.gmail.com with ESMTPSA id s2-20020a17090a1c0200b001dd16b86fc0sm2106194pjs.19.2022.05.20.09.38.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 09:38:13 -0700 (PDT) Message-ID: <489592f6-b783-7bdb-2cc8-0c8e35ebc674@linaro.org> Date: Fri, 20 May 2022 09:38:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] cgroup: don't queue css_release_work if one already pending Content-Language: en-US To: Tejun Heo Cc: Hillf Danton , Michal Koutny , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzbot+e42ae441c3b10acf9e9d@syzkaller.appspotmail.com 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> From: Tadeusz Struk In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 084772001A X-Stat-Signature: spp5sjq8bb5a3g7dmr31w46x3mutrsu5 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=i70QAriH; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf13.hostedemail.com: domain of tadeusz.struk@linaro.org designates 209.85.216.43 as permitted sender) smtp.mailfrom=tadeusz.struk@linaro.org X-Rspam-User: X-HE-Tag: 1653064671-446190 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 5/20/22 01:13, 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 paths. > > Hmm... wouldn't the extra reference keep release from happening? > >> Will this help if there would be two WQs, one for the css_release path >> and one for the rcu_work? >> >> 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? I think it will help to solve the list corruption issue: list_add corruption. prev->next should be next (ffff8881f705c060), but was ffff888113123870. (prev=ffff888113123870). ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:28! as this is a result of enqueuing the same css->destroy_work onto the same WQ, one on the rcu path and one on the css_release path. I will prototype it today and test with syzbot. -- Thanks, Tadeusz