Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2844640pxp; Tue, 22 Mar 2022 07:09:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzODvME249YHgyMgrtkzQYdeScioH21LtygmAVC3UZJZdLW6oE78RlGxtfBi+yOjj4bPWP+ X-Received: by 2002:a05:6402:362:b0:419:2b6d:a662 with SMTP id s2-20020a056402036200b004192b6da662mr14933767edw.54.1647958148139; Tue, 22 Mar 2022 07:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647958148; cv=none; d=google.com; s=arc-20160816; b=gBmHuUq+dnh3sRj080/JUc3yjXyBkY5vaT/KITUIpgWG90vSlFIZY3wfeSuh9CvItQ l8sIrOp/6TW0DUqXhGs6ZKI60+Qk6ZlBd33WZkMzEIjbO9jyrjO0YnPFq6UT8TYln8fd hTS3BwakFebrKtsr5DXFGRtInPHEPMWGftM+LHWArAAyvJcXDZdIO9b3In4kUTc0eBOP fOSCURMSf6GOyoS4O5FKzCsC36+ZDo7JPmH19U2k5+l42079deFIISZJNTFcMFfkyEIx ZFUVac4gmn6e7qyWjN6rFaLTBOcwSRQIFb6ILXGUTywghL0ACZlvINhqTpJo+5fi1vv8 VKPA== 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=PjN7q8WxBIeHgSX0e7A0g/Wdcyld4OMBH7Mp33A36MY=; b=Uui9W5zH/qnTFf+cdeNhYpfgbCLn0WGLBX5jidZp6W0IdvKcZGUDmgETSGquiTto8E ulnF9whYSN3e676+c4P/m9RKXBeQcWBNujQjh+OHjO96I20lDf9eksfld9EUPLItiC4Q mvyM/gVmNWeKN2RR1Ni1P+i/BV5yIVJQ30TCtRICGxLqX94fbHXRcpMb6VNUt7VOrNVo OLq6UTVU3GApDBtH088wBc7I4CQyDD4xyGoXpFDrVSK/YqboUev1EkbCFDV3jtc11xKC cDUzi/csCKViY+OsRLVDXUxxi+oQ/oyPK8EiG0tUhGnHVOJUbNIDjT5b+aLCXUyE8wYp aAcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dZs5xOzU; 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 c28-20020a1709063f1c00b006df76385ba5si11772252ejj.69.2022.03.22.07.08.40; Tue, 22 Mar 2022 07:09:08 -0700 (PDT) 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=dZs5xOzU; 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 S235317AbiCVNS5 (ORCPT + 99 others); Tue, 22 Mar 2022 09:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235269AbiCVNSq (ORCPT ); Tue, 22 Mar 2022 09:18:46 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C45FD64712; Tue, 22 Mar 2022 06:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647955038; x=1679491038; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dAcxrMAdYGWi8WSTjO6a3fMaU21hxA6oy2q2nk6xPPc=; b=dZs5xOzUCW1TpjMvTbS9UluzpgVIuu5dS4IVYTVQVUIkR7kZeLk1+xdn hv0Ya2wwNO4IZop33ERGUfYTjI+DQxF3y7X0BbBqIQ3rjtND0Hh402u8f rleea1KXPdeAY2WyuYcPRZCyz6EeOrjOrgH/DB+KIyWeqt34taim7xDjN kRFJ7tBJPYC0KYa+KQ2MJ2JfqHeyQNuh6tdkg4MyaOp/Ne8RS0akYoqbV RU2OlQLJGBuHBJex/XcsRim1R4MhPZS2yaLDnEyzsfbUF5HHjoxuO0ykE XHmrJJ6T7OO2a0msl/Wup4kBVtQ8yN0u9Gx/rs36+LRCcQktJpRzKUR+R w==; X-IronPort-AV: E=McAfee;i="6200,9189,10293"; a="237755597" X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="237755597" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 06:17:17 -0700 X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="543686431" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 06:17:16 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/2] rcu: Deoffload rdp if rcuop/rcuog kthreads spawn failed Date: Tue, 22 Mar 2022 21:17:51 +0800 Message-Id: <20220322131753.1680329-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=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 When CONFIG_RCU_NOCB_CPU is enabled and 'rcu_nocbs' is set, the rcuop and rcuog kthreads is created. however the rcuop or rcuog kthreads creation may fail, if failed, deoffload the offloaded rdp. --- v1->v2: Invert the locking dependency order between rcu_state.barrier_mutex and hotplug lock. Holding nocb_gp_kthread_mutex, ensure that the nocb_gp_kthread exists. v2->v3: Adjust the position of the nocb_gp_kthread_mutex, in rdp_gp->nocb_gp_kthread check upper lock nocb_gp_kthread_mutex. Do the locking order change in a separate patch. v3->v4: Protect SEGCBLIST_KTHREAD_CB flags clear with rcu_nocb lock. Zqiang(2): rcu: Call rcu_nocb_rdp_deoffload() directly after rcuog/op kthreads spawn failed rcu: Invert the locking dependency order between rcu_state.barrier_mutex and hotplug lock kernel/rcu/tree_nocb.h | 85 ++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 20 deletions(-) -- 2.25.1