Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp83102rwl; Tue, 4 Apr 2023 19:24:18 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJVrqIXrNUokiyMLG2rWMaXg8J0Vn6htrdnttyC5GewfPzxFv9krf8i4+wAGOCRQ5WsqXO X-Received: by 2002:a17:90b:1c07:b0:23d:3761:6087 with SMTP id oc7-20020a17090b1c0700b0023d37616087mr4999644pjb.1.1680661458173; Tue, 04 Apr 2023 19:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680661458; cv=none; d=google.com; s=arc-20160816; b=lR5BtYQAkJ75NktT9M3FjKynD+1o2s2Pzq3l/U4kSKUPc+mU5lv4poaCcNvKvVD5pq aFbdBrQXZDI+ipoLJW/Z1teDd2dWop6+picIM5XnSPhyt+hJ4NaYPBmXYAokpuQ81cHl X1UGBXeB9emxMLrf79rLhfUpijYNLzoMVTTALFxku6IOyHVdWeuuYcE6CmljeIbxWS2z o1MZCBr8//HX72LXHRBijf+6usMO0c9lxNa5rewgx40xol3C2w5pHKhrWedRoFHfO1Zd Fom+MxN+HcFZgVLE5JpRnfrNTsECE++p3KZdbNHee1bKl7D9B9NAZlYeSJsGH6PlkXAq pXag== 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=VRakZFwjEoADJ6abGb5AaOI6UzhcYVOaoTaOuaLa+dM=; b=XLlquoH5aP7MAr10UI7wcflkIy9wq8vp/SYm3FSY5fxQlQZ7jDWATlHNOYXgx28oh/ 8Lz7BG47/sq6X53tMiFY8YaeCMbQL7nJAMM9T9M7Kjn6g7PWZpOp7FMaA0oiG3z57ptM dDmxP/YRIwdZi5v8DvjDAtix90l7pryr2D4bzoutv5ob8BAN8uRPaL1gfekY7aAzA7Z0 78hAQGj0jaDcspCWC0wsShnKXl4dtCuYDZ2l/gumbR6LuOWP2pdyEDWxSfq/T7xWPuZ9 BjmzyqpQctWb/uyZk9AwCLjpnBxYWDMlNCPdj108hEsdkcPh0xUgLSSJPRCtEswk51qk SZbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mhUkZy75; 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 12-20020a17090a08cc00b002404d7fdf5bsi459905pjn.116.2023.04.04.19.24.06; Tue, 04 Apr 2023 19:24:18 -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=mhUkZy75; 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 S236696AbjDECNZ (ORCPT + 99 others); Tue, 4 Apr 2023 22:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236202AbjDECNY (ORCPT ); Tue, 4 Apr 2023 22:13:24 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D794224; Tue, 4 Apr 2023 19:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680660800; x=1712196800; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mmL48LghRvNIccOP+XTDg1agIHo//2sNs+v9zg/WcTA=; b=mhUkZy75hQqo6gekgZJTx1BcMiCd5mgnnz+KR4uprqRgs8MhoAT0DkmS 9NiUwefC58Xx4jSkkntEQiILaH7zHHlOkhNiuUBuekYjeRthrbBcKbp0n gU7KpEE3MpgX7kLtPJvKJ+wu0QgVGz/7nvN+jSURBZQWawqE17rohKyIK w+noHGNO1/NQE8Yj8O0n1Yt5vI02ARiKNORplLOdnT7v+RbXVCzkC9xdq pANhTUM4Z1bXZH/ZPbHRqY6VzBTngsGddWpJXcPqBWS36g3qV3tMnWuxt GJ44hmglmJzwEz90Qp4FEe7XW9DWexNTHpcS5cdVQ5NWpcEN7B58fpKHr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="428637835" X-IronPort-AV: E=Sophos;i="5.98,319,1673942400"; d="scan'208";a="428637835" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 19:13:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="830198297" X-IronPort-AV: E=Sophos;i="5.98,319,1673942400"; d="scan'208";a="830198297" Received: from ubuntu.bj.intel.com ([10.238.155.108]) by fmsmga001.fm.intel.com with ESMTP; 04 Apr 2023 19:13:17 -0700 From: Zqiang To: urezki@gmail.com, paulmck@kernel.org, frederic@kernel.org, joel@joelfernandes.org, qiang1.zhang@intel.com Cc: qiang.zhang1211@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done Date: Wed, 5 Apr 2023 10:13:59 +0800 Message-Id: <20230405021359.606321-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 This commit make debug_rcu_bhead_unqueue() be invoked with check the bnode structure's->snap is done in kvfree_rcu_bulk(). Signed-off-by: Zqiang --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 3461fc2640b9..17b5d115aec1 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2943,8 +2943,8 @@ kvfree_rcu_bulk(struct kfree_rcu_cpu *krcp, unsigned long flags; int i; - debug_rcu_bhead_unqueue(bnode); if (!WARN_ON_ONCE(!poll_state_synchronize_rcu_full(&bnode->gp_snap))) { + debug_rcu_bhead_unqueue(bnode); rcu_lock_acquire(&rcu_callback_map); if (idx == 0) { // kmalloc() / kfree(). trace_rcu_invoke_kfree_bulk_callback( -- 2.32.0