Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1131219rwl; Wed, 5 Apr 2023 12:14:34 -0700 (PDT) X-Google-Smtp-Source: AKy350YWwcQ73nnvns/XDjOs20V8pRjeywiegAlnqvni3/FFKcuknE+f9So9SMjPtb59JO0wSt/O X-Received: by 2002:a17:906:a254:b0:933:37f4:2fe0 with SMTP id bi20-20020a170906a25400b0093337f42fe0mr3776681ejb.46.1680722073914; Wed, 05 Apr 2023 12:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680722073; cv=none; d=google.com; s=arc-20160816; b=a0dd0jfkTcQvSzVXMHhsqYXfl/ExLIzzKId+sqJ+WSEJ8EEtMmdLkNsqwdjwvv0msg C0XyKSQAGgmGdrusv8H6hut7plUOpide2RgGHD+jgr7eQgOH9w97H8+nF+TTiz0zRPlw CAaLa8IBaPVmcmJYEEVLdc3xufIdPIggetgemxfQx0J0p2zoar3Z4JpRl2hY+5teIByj NQWtFJ7eAJf2zmt4UAJ484lgWZds+P4aHTGYssl0K40rXy7pg1lqK0xVrAGClCUW29yz ssmDkH8x/J7tEDp3VvH0eoIgzcy+tpRDD3JVzLT1kKOLzf49euP2vbM7dSxXe8h5KZcX nAPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VGLrlZoRUwNIrKIUosBonxwfLcW8lnLyF7kclJeKXZY=; b=DHd24+9YJPp+iH8CE1s+sHsSmV1JcqCH6NMMzU91CTkDxDTRDX+7akusyBwQH+DaLM 3zA8a64d8yZ0EklD2jMNAZysmSuti12D+uIthrlOJtk/cQ1JUjDHq8AXBHzIAq1yn2no rO8PZ0V8OKLmTMcj2AEoAw4jX0KMbqUZPvRMTWxT6lBqDW5KZ0TjfiIArQg0Jmxvzi7k 8FWSXyWE5BViPj6FtgCjtIl4mf9sT2GdbxBMnuOke2SzNfZ+ELu3kEDJE6EfgxN2UJwD BAtkNFzp95HjzTtLb1LLwxCLaMn6wmksU6cWhc+o4dqmz4hBajbLdxqAbp5rqovkXM50 Ylkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=da5fuIPs; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa17-20020a170906edb100b008e3da0ff1b2si12576450ejb.879.2023.04.05.12.13.53; Wed, 05 Apr 2023 12:14:33 -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=@kernel.org header.s=k20201202 header.b=da5fuIPs; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233074AbjDETEK (ORCPT + 99 others); Wed, 5 Apr 2023 15:04:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbjDETEH (ORCPT ); Wed, 5 Apr 2023 15:04:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 899612724; Wed, 5 Apr 2023 12:04:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C1DC627F1; Wed, 5 Apr 2023 19:04:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73F8EC433D2; Wed, 5 Apr 2023 19:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680721444; bh=e4c27EW3p/fchHHTLKK42Yf7bC/xrI/7ZxdOW3nfM9Y=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=da5fuIPsJ0s9oWr938Ig4+fQ2XUwGiOoanj6S82Wqe4CUXULTYHLGowqQkn9UYI49 FiIoefGyr4gqmGYT5x0rMQNRBnBw6jSeqkSvPniUJWVokz8bUCc/bPBD6ujb8IjN5T 37mif5ljtdRlDLbWmBp1hafcsmsECmkCuBiyGb6uu4VmBLFXxiLz/JCgFqhOtZ3GPz 1DRTHkhVJmlJRcCVMiTW5RTgCtt7guYKEjl7QOO6Vdwn819OsXuKZj4iKla086naI1 CDEsHMsN//xaxBDkzaR8m4gVZxOYQXdN13g7q8pRrs8arJbGbyu6+XYbitczpAFxjS g5jV5xRB7ys+A== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 05E4115404B4; Wed, 5 Apr 2023 12:04:04 -0700 (PDT) Date: Wed, 5 Apr 2023 12:04:03 -0700 From: "Paul E. McKenney" To: Uladzislau Rezki Cc: Zqiang , frederic@kernel.org, joel@joelfernandes.org, qiang.zhang1211@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done Message-ID: Reply-To: paulmck@kernel.org References: <20230405021359.606321-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS 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 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 > > --- > > 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) Queued for v6.5, thank you both! Thanx, Paul