Message ID | 20230405021359.606321-1-qiang1.zhang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp19984vqo; Tue, 4 Apr 2023 19:51:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZPSRdX6w3jTnvfi5iZ9EojaFfqhusjV1miglwpLuEHhfYiiO7q4CcyT3KinJRmmaCLAuda X-Received: by 2002:a17:903:294e:b0:1a2:2091:ee8b with SMTP id li14-20020a170903294e00b001a22091ee8bmr4336156plb.10.1680663091095; Tue, 04 Apr 2023 19:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680663091; cv=none; d=google.com; s=arc-20160816; b=CGN4pofMBeRf71ZRlJNMPfPLPUoIibKrDx0kICgbABZrD0m+2jjDK4H29mIcLXmzMM LamUd2frp3fqW/EL/n1wBNvRjfYIWxhfmeXLlsRYAoHgG3pe2W8Hksmn9GEBioJiHwRY h5+5FpVT1xqNKXAOXf8g4Fhoq6bcirAHNW50vJUeqLofLloNoJWEwTXhlQAZCtphDjd7 7Y50EMQ59i//8BgRo2hY3EjA0PQx5tZ0y58urxexzYM9ZUalwX03qFviDjZPLXbqEyfh //dfk6KvxgQTLv1jUsf1SUyRL0I7LOuEDsvPusBM38OjQPQpoXIixqYpdscJ4tWHq297 M/hQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902b10f00b0019cd71b56cbsi11103907plr.522.2023.04.04.19.51.00; Tue, 04 Apr 2023 19:51:31 -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 S236712AbjDECNZ (ORCPT <rfc822;lkml4gm@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <qiang1.zhang@intel.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762302981460916536?= X-GMAIL-MSGID: =?utf-8?q?1762302981460916536?= |
Series |
rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done
|
|
Commit Message
Zqiang
April 5, 2023, 2:13 a.m. UTC
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 <qiang1.zhang@intel.com>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Apr 05, 2023 at 10:13:59AM +0800, Zqiang wrote: > 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 <qiang1.zhang@intel.com> > --- > 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 > Since we leak, looks like correct to me: Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com> -- Uladzislau Rezki
On Wed, Apr 05, 2023 at 04:45:27PM +0200, Uladzislau Rezki wrote: > On Wed, Apr 05, 2023 at 10:13:59AM +0800, Zqiang wrote: > > 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 <qiang1.zhang@intel.com> > > --- > > 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 > > > Since we leak, looks like correct to me: > > Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com> Queued for v6.5, thank you both! Thanx, Paul
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(