Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4659686iob; Sun, 8 May 2022 20:58:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQq73eTIKhCCqI3GczLIOZHfR/z+XbHUT4Il6xruPvtxJ3YpZSFYG6ExXQb2mAFyqYChMG X-Received: by 2002:a17:90b:4c10:b0:1dc:8289:7266 with SMTP id na16-20020a17090b4c1000b001dc82897266mr24494436pjb.190.1652068704619; Sun, 08 May 2022 20:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652068704; cv=none; d=google.com; s=arc-20160816; b=VDlkd78tHn5U1aWHHNoaUjD/R5oUkX+jiuEzeMLUPCluox47gdNnSx03ukmIlMk1H0 ZmBTmmiUFZfgfuoj2f+w1WTkVBSrr7i/TNumwDpyNKRPH8Fj3j/GnzjAYlo8DZ1kuYV5 X71N2tKkuokp/3o+AU2F2ea7GjTKFsjMKeLM7a7KxNsmltRJLXA/c3fEZqs0zMyTa+yL i4KuDhlr4vw8znUaZR+1v4FcyesY6a+qIuCB2en2/NLD2Ij8YMzhhAOpxtVGSRNdMw1d RAS8fLdZeFl2MHKJv69iEBD/SFCzRWA7NBWYDlj7Ck+JUjBPnZ+0I1xGq9SElUmqAb3Z 4CpA== 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=TqhH9KC7nloScaeNLFLoTBjncM21OTA1I3deB4iLsWo=; b=u0kuiqjHHD8+jSZy6iSLMhfxnuMBJRDHkodWalxaLrworl8AYABMdg9Azs33HEkkGJ /UFKvlojoclwh0WHdnj15t83rj7MfjMbfNNpmZdMapV/OF3YhzO7CQWLQuZMPJ66u5bw 5AjLECE/PqCdKo5n4LMtwL315pTG1fVJP9nom+7G9aOqjrbFdqsr5wobkc8LPwQPXz08 MIn46L4Ajpp+VLPjGiAYKPzxS3e/5dw4A4H+PFFfvPeErKehXp6YE6X0a92G3TzmCvzg gSFIRw+QGHC78OXPKpHAGhsKIDHRFL+CbUt8IFgZDw6LYqVh/IExpcC2LII/jr1S86u4 gd0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqTAWosl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u6-20020a170903124600b00153b32092adsi8566508plh.158.2022.05.08.20.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:58:24 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqTAWosl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2DCA4A1454; Sun, 8 May 2022 20:56:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381172AbiEEQDR (ORCPT + 99 others); Thu, 5 May 2022 12:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239474AbiEEQDQ (ORCPT ); Thu, 5 May 2022 12:03:16 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A28515A3; Thu, 5 May 2022 08:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651766377; x=1683302377; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=4xPb5hYDEuqAvEmIzib3MGbfqSg4B/cO3p6boPn/ylU=; b=BqTAWosly3ieVB3EZ002q1J4C6FzRvEhir7aYD3yAz0ULz7ABCIUvE2K gPoHyCMbH46bfeCHIJ2IIYI9Rww/tkEkLM2BxtnahN95GJTNgRiEpc1bA aCX3YIUZiTRd9OkD6B7EL6NbahdpEMmTJSUJ10IX4e9yyej54zvTITZK6 bRh6Uvi5iVdA/FzIuvCjIS7ODRxKJH97RGyD0z+ekqEVp/oQIoD5Fwt+P YN2SPXyTu3tNNekoZWHMwYxDpvndODyT1VXixRPqBSw1Sfd8wXD94GZ/K 4D+2hguwzUuJCZLhwRGunUT83PEV44jKg/PunNEhpj7pZ+c125e1izWDw w==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="267756537" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="267756537" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 08:52:27 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="585394297" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 08:52:26 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Add rnp->cbovldmask check in rcutree_migrate_callbacks() Date: Thu, 5 May 2022 23:52:36 +0800 Message-Id: <20220505155236.1559619-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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Currently, the rnp's cbovlmask is set in call_rcu(). when CPU going offline, the outgoing CPU's callbacks is migrated to target CPU, the number of callbacks on the my_rdp may be overloaded, if overload and there is no call_rcu() call on target CPU for a long time, the rnp's cbovldmask is not set in time. in order to fix this situation, add check_cb_ovld_locked() in rcutree_migrate_callbacks() to help CPU more quickly reach quiescent states. Signed-off-by: Zqiang --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9dc4c4e82db6..bcc5876c9753 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4577,6 +4577,7 @@ void rcutree_migrate_callbacks(int cpu) needwake = needwake || rcu_advance_cbs(my_rnp, my_rdp); rcu_segcblist_disable(&rdp->cblist); WARN_ON_ONCE(rcu_segcblist_empty(&my_rdp->cblist) != !rcu_segcblist_n_cbs(&my_rdp->cblist)); + check_cb_ovld_locked(my_rdp, my_rnp); if (rcu_rdp_is_offloaded(my_rdp)) { raw_spin_unlock_rcu_node(my_rnp); /* irqs remain disabled. */ __call_rcu_nocb_wake(my_rdp, true, flags); -- 2.25.1