From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D8F5C4332F for ; Tue, 8 Nov 2022 03:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbiKHDzb (ORCPT ); Mon, 7 Nov 2022 22:55:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232270AbiKHDza (ORCPT ); Mon, 7 Nov 2022 22:55:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8893813FB1 for ; Mon, 7 Nov 2022 19:55:29 -0800 (PST) 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 2256D6140B for ; Tue, 8 Nov 2022 03:55:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00169C433D6; Tue, 8 Nov 2022 03:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667879728; bh=jfSoGwo546XyLcE1uccBGS6De2TD0dAjfZXKPspZBdw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aGhgILqCEVDt6EWAqsWWrysxlK7H3uEVANEME1KqxgLcyUWVKiSULyjZEfKMDrru6 nUqYggNQAFBr9K4aqvyBpj2ZwL9hUtJsIxx2c1xsLgORGt/XJSYbI7Tyc2cnxR3woq N9IDKbzXcrFUnNnxyC3YD00hIXyPi9Y01dcJekwb6Fj170uYm1dmxnP0jCf7c7yqbC 9G6cZMjSu/2e0jpdqsw3AuUhSJOUsjvhbFWzJEm9DPyLQUpJ/0r2kaGYIZAP1kHvjV 5MhhTVlY4lQnetAICBBGWGrKVYTaaxBlBTHhWaXCAFqYvsNVA6PD3wz+H1Q7hUhTVY lRPbM88bxF7ag== Date: Mon, 7 Nov 2022 19:55:26 -0800 From: Jakub Kicinski To: Jacob Keller Cc: Leon Romanovsky , "Ruhl, Michael J" , "Nguyen, Anthony L" , "davem@davemloft.net" , "pabeni@redhat.com" , "edumazet@google.com" , Kees Cook , "netdev@vger.kernel.org" , "Brandeburg, Jesse" , "intel-wired-lan@lists.osuosl.org" , "G, GurucharanX" Subject: Re: [PATCH net-next 5/6] igb: Do not free q_vector unless new one was allocated Message-ID: <20221107195526.5ef1262e@kernel.org> In-Reply-To: References: <20221104205414.2354973-1-anthony.l.nguyen@intel.com> <20221104205414.2354973-6-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 7 Nov 2022 10:35:14 -0800 Jacob Keller wrote: > > I understand the issue what you are trying to solve, I just don't > > understand your RCU code. I would expect calls to rcu_dereference() > > in order to get q_vector and rcu_assign_pointer() to clear > > adapter->q_vector[v_idx], but igb has none. > > the uses of kfree_rcu were introduced by 5536d2102a2d ("igb: Combine > q_vector and ring allocation into a single function") > > The commit doesn't mention switching from kfree to kfree_rcu and I > suspect that the igb driver is not actually really using RCU semantics > properly. > > The closest explanation is that the get_stats64 function might be > accessing the ring and thus needs the RCU grace period.. but I think > you're right in that we're missing the necessary RCU access macros. Alright, expecting a follow up for this.