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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EDC0C433EF for ; Wed, 25 May 2022 16:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245431AbiEYQPL (ORCPT ); Wed, 25 May 2022 12:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245443AbiEYQO7 (ORCPT ); Wed, 25 May 2022 12:14:59 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B82AB8BE0; Wed, 25 May 2022 09:14:58 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B29D51F45B; Wed, 25 May 2022 16:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1653495296; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nveNkbQd0lCAXKeId3LcmC7N6UTtx563GjLwBF9X3SM=; b=IqhqwHV+le8KctKpt3p8cJ+ogCgAU4pKENhjX5Pv9JiWbXpf195OZuQCuuaL/71y7/p9qq Kf09Y01qolu5EvvwJFMPsy/pMLgibwaAAOagge4fmclEhR8S3HlHpHh4ddog+TuFDht1mY n4qnfke5MirTxUxXRHLUwQFkJ39v7Ds= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7DF7513487; Wed, 25 May 2022 16:14:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id minBHQBWjmL8IAAAMHmgww (envelope-from ); Wed, 25 May 2022 16:14:56 +0000 Date: Wed, 25 May 2022 18:14:55 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tejun Heo , Zefan Li , Johannes Weiner , Bui Quang Minh , Tadeusz Struk Subject: Re: [PATCH 2/2] cgroup: Use separate work structs on css release path Message-ID: <20220525161455.GA16134@blackbody.suse.cz> References: <20220525151517.8430-1-mkoutny@suse.com> <20220525151517.8430-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: <20220525151517.8430-3-mkoutny@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 25, 2022 at 05:15:17PM +0200, Michal Koutný wrote: > // ref=1: only base reference > kill_css() > css_get() // fuse, ref+=1 == 2 > percpu_ref_kill_and_confirm > // ref -= 1 == 1: kill base references > [via rcu] > css_killed_ref_fn == refcnt.confirm_switch > queue_work(css->destroy_work) (1) > [via css->destroy_work] > css_killed_work_fn == wq.func > offline_css() // needs fuse > css_put // ref -= 1 == 0: de-fuse, was last > ... > percpu_ref_put_many > css_release > queue_work(css->destroy_work) (2) > [via css->destroy_work] > css_release_work_fn == wq.func Apologies, this is wrong explanation. (I thought this explains why Tadeusz's patch with double get/put didn't fix it (i.e. any number wouldn't help with the explanation above).) But the above is not correct. I've looked at the stack trace [1] and the offending percpu_ref_put_many is called from an RCU callback percpu_ref_switch_to_atomic_rcu(), so I can't actually see why it drops to zero there... Regards, Michal