Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1035510ioo; Thu, 26 May 2022 23:11:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk3hxHwC6glueG1pWW4eHdrORhDzXkqgj3ZwPs8FovapHnQH9VhRaVOvij7BR3oIwH1ORc X-Received: by 2002:a05:6a00:138e:b0:518:86b6:5214 with SMTP id t14-20020a056a00138e00b0051886b65214mr29583635pfg.38.1653631885417; Thu, 26 May 2022 23:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653631885; cv=none; d=google.com; s=arc-20160816; b=Fozm2MfUSg1g1H0djzPWmmdOEKIZoRpuZksocH+EKyqn2ptT6aCdy8530bQXkGME3A lvIOr/sj7wuk3tIq42u5GX8fQulwyXqaT3D2DRSqDzhsKEKNVwRBKpefqogqvGFH7Wkj bePVsZOmFTpmmrUdzzIDcFP4p5BTrqVphl+T0TGKddysUVnS+407wL4t4E/4hzLzjLsU XJEYa8ksrCRAMdKAvI8MvdQ9jt6w0SJcx0Gi9LPsn9rXjwSmFP7d59HLDnhCb72DbqE4 1XrXRuTdMEPy2DpIYccuKJXSS2nN7Ryiqz6AM8aITTlV5gvmKoC9oN7qFd4W43lJQxqj txLw== 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=n4FbTyF6vC/P2sWnAyjgY11ovU7sdAsTaP8IbDopZG0=; b=dMDJm25MDjBcPC+6XFbsNCJFtLotKnA9oZDAqLwP9hthesRlsBWNyUHwcHIwvLYyIJ YXcS2bH50oaZFH0KmIzzXe0S8ZKSblWC8uPvakVreuNeJ9RoPde1wL12sjze+18KfPet XYK1lnLfdYWvnpcYTPO4lasCyqpndZZRVCOAZvo0tyE0nOKFkX2YWH9uuUV3KDDJZdof X/TiFkuWtO8vhv5DISfWZr7FgE9AAVI62OqqgvxDDMeVW58GUW/HKYOdG9t/wmRRKthb I5hyxHdHP15G/AHNBHY4amt5oJ6ogvUkrOAFs6Er7x1Q4WpYbszE/Vg3sT3JNWc0V5pi STWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dAiKp5Jh; 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 z17-20020aa78891000000b005180f251cd5si4797867pfe.184.2022.05.26.23.11.10; Thu, 26 May 2022 23:11:25 -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=dAiKp5Jh; 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 S1345832AbiEZBz1 (ORCPT + 99 others); Wed, 25 May 2022 21:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240584AbiEZBzZ (ORCPT ); Wed, 25 May 2022 21:55:25 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DFD8ABF79; Wed, 25 May 2022 18:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653530124; x=1685066124; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1pfebO5CWIzGouQot/Szo2SSK2J1j3dTVROMYETyiwQ=; b=dAiKp5JhVHCxputtWeQ02yyJbYwp6LTmbdLr4RP7xDchV/dMzs7OyjMr SkQMLwYQqo8dZ8tQpErjkqRga2dsENylXUr46r2OlLQDaJw+LmnXTGKx3 7LjyCK2PWjmdgDsozZWHJBAgPpLbLqlhiZbIBeBmla1UGooD3x+Mv0jI7 bBZjmomkoyx1kxa3xrnd1fVf9e7CRscGUW6Rjy/z0aKSruNw5cxFc7b/a UMV2trXUZYJExU57g1UX1N90S+QBWgOyUnZtqzwXoGX3wl9d1S1Mv1QW1 mR6pt6xJKb7+ox6vtkIAPc9E2Edv4J7DhhFf7+TIbGpjNuJeOWauFU5pG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="271564491" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="271564491" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 18:55:24 -0700 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="527137344" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 18:55:15 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Cleanup RCU urgency state for offline CPU Date: Thu, 26 May 2022 09:55:12 +0800 Message-Id: <20220526015512.2218046-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.8 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,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 an RCU grace period starts and at this time the CPU is in the process of going offline, if the RCU gp-fqs occurs during the time period when the CPU has passed the stop-machine but has not yet entered the idle loop, and this CPU have not report quiescent state yet, its urgent flags maybe is set, for example due to cbovld is true, but this CPUs rcu urgent flags is not cleanup in rcu_report_dead() when report qs. however for CPU that have been report qs, its rcu urgent flags should cleanup, so add rcu_disable_urgency_upon_qs() in rcu_report_dead() when CPU report qs. 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 02233b17cce0..6a01a48fe56d 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4536,6 +4536,7 @@ void rcu_report_dead(unsigned int cpu) rdp->rcu_ofl_gp_flags = READ_ONCE(rcu_state.gp_flags); if (rnp->qsmask & mask) { /* RCU waiting on outgoing CPU? */ /* Report quiescent state -before- changing ->qsmaskinitnext! */ + rcu_disable_urgency_upon_qs(rdp); rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags); raw_spin_lock_irqsave_rcu_node(rnp, flags); } -- 2.25.1