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 C39A7C433F5 for ; Sat, 12 Mar 2022 13:34:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbiCLNf6 (ORCPT ); Sat, 12 Mar 2022 08:35:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiCLNf5 (ORCPT ); Sat, 12 Mar 2022 08:35:57 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 084A460EE; Sat, 12 Mar 2022 05:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=d7N9wsNuqkZgK1+eKcOkZTC3C9GRGbNq5Ad3wwuX278=; b=JAgaT3p5mES5x2vTc50l81A/DB EfXJ8ZAn7+PI9x974nNSvog0QkLWoGopkOCd7o7eTeEaaBNbP2v3QilphZ2Rl/SGRB8mVQfV0Ffpj OMEG9fkNHugB0DJ7/oHB/HiP984qdWzoySy9d2q+zRTLdUTzKySOyuzUyID2IhePt/k/CFTrHSJ+q CAg0hfpNXy4Xd/4j9C+34pNiNr/j5MBP8Kq/lsIad/5QH2Ygn7PYm1i84BIpyeRJ6gZNid+ke9wIv BEWXD5rAG4q9Csv1MRUZ7qf4zPX60fwuCOsBAxjFQtoRy8PwYwkXkYrYCwgcAcBawTnfDy427BEOT x3Xa8Upw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nT1tN-000BDr-Mm; Sat, 12 Mar 2022 13:34:45 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1DB8F987D0D; Sat, 12 Mar 2022 14:34:45 +0100 (CET) Date: Sat, 12 Mar 2022 14:34:45 +0100 From: Peter Zijlstra To: Chengming Zhou Cc: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com, Linux Kernel Functional Testing , syzbot+16e3f2c77e7c5a0113f9@syzkaller.appspotmail.com, Zhouyi Zhou Subject: Re: [PATCH linux-next] cgroup: fix suspicious rcu_dereference_check() usage warning Message-ID: <20220312133445.GA28086@worktop.programming.kicks-ass.net> References: <20220305034103.57123-1-zhouchengming@bytedance.com> <20220312121913.GA28057@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220312121913.GA28057@worktop.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 12, 2022 at 01:19:13PM +0100, Peter Zijlstra wrote: > On Sat, Mar 05, 2022 at 11:41:03AM +0800, Chengming Zhou wrote: > > task_css_set_check() will use rcu_dereference_check() to check for > > rcu_read_lock_held() on the read-side, which is not true after commit > > dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock"). This > > commit drop explicit rcu_read_lock(), change to RCU-sched read-side > > critical section. So fix the RCU warning by adding check for > > rcu_read_lock_sched_held(). > > > > Fixes: dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock") > > Reported-by: Linux Kernel Functional Testing > > Reported-by: syzbot+16e3f2c77e7c5a0113f9@syzkaller.appspotmail.com > > Tested-by: Zhouyi Zhou > > Signed-off-by: Chengming Zhou > > Thanks, I'll go stick this in sched/core so it's in the same branch that > caused the problem. FWIW I never saw this patch because it doesn't instantly look like a patch I should be interested in. It's classified as 'for-next' and I don't run -next, sfr does that. Then it's tagged as cgroup, which I also don't do. Nowhere does that look like a patch that wants to go in sched/core and fixes a cpuacct issue. On top of that, I still don't agree with this, I really think rcu_dereference_check() itself should be changed.