Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6912730rwb; Tue, 15 Nov 2022 05:26:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4G3G0n7htvqdjTWPNR/QMGgiRlMi/3ufqIYUOFHbZPkP6ZyMsodarRgthYKMH6Ri0MFviy X-Received: by 2002:a17:902:c44c:b0:186:b91b:17f6 with SMTP id m12-20020a170902c44c00b00186b91b17f6mr4134352plm.23.1668518775615; Tue, 15 Nov 2022 05:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668518775; cv=none; d=google.com; s=arc-20160816; b=d0k8w7kgaugyjGiyDArteYVpvP6AmugN1R00gP9KbpTTs5GycceWNv0/DlOrB2Mk+C n2gBlkaCF2DPlYHY+HHXs2fEB1J+0dGH+5kmjVYAxivT0yADHl43LzXnRbNidjRNL2zr wF9lIEymIUFeUlGE1cthnBiIBtlexdbMa/ZNo3EKm6EBckrsnZ+nhFFOppzShqtLA/sr I51OzVUKfFOMvNmV3o1VV0IW27haHJgk07lYvxxuVTIubJf5eRqz9ghAQFFnWTn1dy5e 7Ysx94RyxCHv1a6GTEYozacSlj0LctIwpJ5U+RABdm7wBS6Xde/N4EO00fpfIu8IugI1 7cCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6Min09Rk12NgZBMgljA0Dt7ol1SuIA2cq3o6DzrFJAU=; b=tOwqE/ZtSLs6M44LPiyzbEY5FOlbd5G/kHyXNzR9voAhymAk1zqBEZCkdTFEzJ9ZIf /EgFQCN96FYXor11hRKdoNwjVe2XTNHPKPnlV0FB63cr81iQ3MhXwPwqEUMoEVY0+VPd 3j+hMGOegMjAmVL5J+LxLpYmk0gCN3bZrMeMDYE0Zr7bKQkCu5pJ6an5CaSe+WFSns0N ho3W923Wjy39hJWHZXHbiSNPBqQAyBF8AVcpL1HuJYyecJyY3IRgXQrA23Ky1v2W5dHP x3OGm0gD4HdZdELIv9N1lUKFhRRRrKRSH+G/I+Lkqk0t0hfWsEnQQ6+mEY4ekqJliiKy H9jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HtIx8PUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a631c4a000000b00470092473ffsi11825328pgm.421.2022.11.15.05.26.03; Tue, 15 Nov 2022 05:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HtIx8PUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230192AbiKONNz (ORCPT + 89 others); Tue, 15 Nov 2022 08:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232222AbiKONNp (ORCPT ); Tue, 15 Nov 2022 08:13:45 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6554B1D2; Tue, 15 Nov 2022 05:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668518019; x=1700054019; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KJFXj3YWKvBgdKbZAu8eoga4jTJKbrFgb7rok5iDpxA=; b=HtIx8PUnM7oNMLWloO2Yg3latnTs7KgnJOSzZT6+9kW2Lr+Cv+7HVLrQ qJuV1ULwqyYCapdtI+LYAITqsDud4XPS83bsXWBHo2WEH4cI3KcLbKRjk et5JWV2kmKo3sgAzlPff7Gq2+xMEeHOh1VJ2Pe5ib8yHvGoeNfHydcUHk kiZy4MvnvXgjj+AvY2jU1mfBJF5Z16vyHOnm9nb9MNrHppnBu7b8dpXHR EsSHSNwuSIeixGzS6yWDDK0q2btRU/64oDZ0WDiCDFGEQybrlilQuJGOC JKzBzxbIvHdwTB4ZO99G0JD7YiV6azABaXhlEFNyydQqlrbO6aEPBz8zW Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="309875258" X-IronPort-AV: E=Sophos;i="5.96,166,1665471600"; d="scan'208";a="309875258" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2022 05:13:31 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="744586943" X-IronPort-AV: E=Sophos;i="5.96,166,1665471600"; d="scan'208";a="744586943" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.129]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2022 05:13:28 -0800 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org, joel@joelfernandes.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Avoid invalid wakeup for rcuc kthreads in RCU_KTHREAD_OFFCPU status Date: Tue, 15 Nov 2022 21:19:26 +0800 Message-Id: <20221115131926.3409974-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For CONFIG_PREEMPT_RT=y kernel, the "use_softirq=0" will be set, the RCU_SOFTIRQ processing is moved to per-CPU rcuc kthreads which created by smpboot_register_percpu_thread(). when CPU is going offline, the corresponding rcu_data.rcu_cpu_kthread_status is set RCU_KTHREAD_OFFCPU, and the rcuc kthreads enter TASK_PARKED state, kthreads in TASK_PARKED state only accept kthread_unpark() to wakeup. Therefore, This commit avoid invoke wake_up_process() to rcuc kthreads in TASK_PARKED state. Signed-off-by: Zqiang --- kernel/rcu/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 3ccad468887e..49dd87356851 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2375,7 +2375,8 @@ static void rcu_wake_cond(struct task_struct *t, int status) * If the thread is yielding, only wake it when this * is invoked from idle */ - if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current))) + if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current)) && + status != RCU_KTHREAD_OFFCPU) wake_up_process(t); } -- 2.25.1