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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB624C54E64 for ; Thu, 28 Mar 2024 11:32:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3EF2F60C31; Thu, 28 Mar 2024 11:32:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nIaj7BjwYyd1; Thu, 28 Mar 2024 11:32:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0A83C60710 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1711625533; bh=mSo7DhF7mzZKKcMy8syjlrux0lEHXlKps9+TIGRsmWk=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=n88WGmQ8r1T/1qfqr+PCU57ElXbFNrXBDCt9Jh2p5jYL5Nnk4pwtqxJ4JJr3gSofw +SF+hkr8EfJ4Kep+c+tkYgubjTKfGnNUtup1JHsT6OfdLQ0TihbezCAcNTR8P+/ExV h2ZY17AhJID4/eBP6S3zcA6erzIFZKSG7xxcdVVC1GXCVUbMGCc8FBDaHK5r3NzQTQ qM5O/rHTjjT4+/aBueXsW0Yz74wfcwjkimhBujffWhzS4GbcVg88Xaqo4mnwTlysws FZ44jcW5EWvAZ4bbt2lfLOwQ3AxibvmfahnfQkDjIzSvPXWd+8IxE4GV97MQq3Rt+4 Z3/xVVXZ/gIkA== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 0A83C60710; Thu, 28 Mar 2024 11:32:13 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id F323C1BF37A for ; Thu, 28 Mar 2024 11:32:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id ED4B4400D1 for ; Thu, 28 Mar 2024 11:32:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id peubYpWp_s03 for ; Thu, 28 Mar 2024 11:32:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org BC05C401CE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BC05C401CE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp2.osuosl.org (Postfix) with ESMTPS id BC05C401CE for ; Thu, 28 Mar 2024 11:32:08 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 93F0161477; Thu, 28 Mar 2024 11:32:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82B50C433F1; Thu, 28 Mar 2024 11:32:04 +0000 (UTC) Date: Thu, 28 Mar 2024 11:32:02 +0000 From: Simon Horman To: Jakub Kicinski Message-ID: <20240328113202.GH403975@kernel.org> References: <20240327040213.3153864-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240327040213.3153864-1-kuba@kernel.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711625527; bh=s1Kbht052+Q3EYXLA3+hm7ApiGwdjm7g8WW19YP5C6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qwh6Uk3ZRyOSlz/Or4Da1ULl71LQUnrLGlaxQA8U0S3NRmJIEUBeqhwBJlb57Rzd3 w6KhpDYV/AhkKd0OshpY7KcSxVZkJvfq51/esQwWZ4OT8GVZv1SzySiBibc4jsoRaa Vqy8pavoaz/X9xRer/fc7ZBsJO4IpEfU9i5VkWS+DdekYDj6R0Wvggb7SFkKnnf+J+ hCw8WWm2G9kogAd9gFDQoZje26shpas497IwDnXODo30bfFXoW0IacEC7DzCV3Tf0z g+MSODMq8aBtznJIVmQd7mQ93qGQixuH+875jjBKKkD3P/uA9wIo5nOVjUpgUElVr8 K3UT7/jzDXxhA== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qwh6Uk3Z Subject: Re: [Intel-wired-lan] [PATCH net-next v2] net: remove gfp_mask from napi_alloc_skb() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: siyanteng@loongson.cn, netdev@vger.kernel.org, alexandre.torgue@foss.st.com, Alexander Lobakin , edumazet@google.com, joabreu@synopsys.com, anthony.l.nguyen@intel.com, mcoquelin.stm32@gmail.com, intel-wired-lan@lists.osuosl.org, pabeni@redhat.com, davem@davemloft.net, alexs@kernel.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Mar 26, 2024 at 09:02:12PM -0700, Jakub Kicinski wrote: > __napi_alloc_skb() is napi_alloc_skb() with the added flexibility > of choosing gfp_mask. This is a NAPI function, so GFP_ATOMIC is > implied. The only practical choice the caller has is whether to > set __GFP_NOWARN. But that's a false choice, too, allocation failures > in atomic context will happen, and printing warnings in logs, > effectively for a packet drop, is both too much and very likely > non-actionable. > > This leads me to a conclusion that most uses of napi_alloc_skb() > are simply misguided, and should use __GFP_NOWARN in the first > place. We also have a "standard" way of reporting allocation > failures via the queue stat API (qstats::rx-alloc-fail). > > The direct motivation for this patch is that one of the drivers > used at Meta calls napi_alloc_skb() (so prior to this patch without > __GFP_NOWARN), and the resulting OOM warning is the top networking > warning in our fleet. > > Reviewed-by: Alexander Lobakin > Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C02B82A1AA for ; Thu, 28 Mar 2024 11:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711625527; cv=none; b=OpJmAdYk2P+w+r+gSqwXmpjHFcXL+RrNSsB3J5kTjrehaBZVzzvJdv8t9u6JNLET10uOg1fDLKiz4syUFkL+/MtbXFah2l+k8m/dCFw3myBadjlTa+mKnZ2TI28ttryJYNeGfdg1p3Sg+W21ZH8Dx2P/wVF1Ipbsr857LjDagH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711625527; c=relaxed/simple; bh=s1Kbht052+Q3EYXLA3+hm7ApiGwdjm7g8WW19YP5C6M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TkkuQMbZNAxb8EG+bvR3yRKMMlWKjTY38ncnUqp9dmYqoE+C8Ze14sSAtuynyF3tNxs2fns2lqmQtKEH1BWaIqAYRxovrfsEKpZ4FxRqkS6o2doJQ0N+R8H98fRNRbm9dB8TE2BFygYscJYNsogeIbwH6aafDb52R52YMPMuXwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qwh6Uk3Z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qwh6Uk3Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82B50C433F1; Thu, 28 Mar 2024 11:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711625527; bh=s1Kbht052+Q3EYXLA3+hm7ApiGwdjm7g8WW19YP5C6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qwh6Uk3ZRyOSlz/Or4Da1ULl71LQUnrLGlaxQA8U0S3NRmJIEUBeqhwBJlb57Rzd3 w6KhpDYV/AhkKd0OshpY7KcSxVZkJvfq51/esQwWZ4OT8GVZv1SzySiBibc4jsoRaa Vqy8pavoaz/X9xRer/fc7ZBsJO4IpEfU9i5VkWS+DdekYDj6R0Wvggb7SFkKnnf+J+ hCw8WWm2G9kogAd9gFDQoZje26shpas497IwDnXODo30bfFXoW0IacEC7DzCV3Tf0z g+MSODMq8aBtznJIVmQd7mQ93qGQixuH+875jjBKKkD3P/uA9wIo5nOVjUpgUElVr8 K3UT7/jzDXxhA== Date: Thu, 28 Mar 2024 11:32:02 +0000 From: Simon Horman To: Jakub Kicinski Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, Alexander Lobakin , alexs@kernel.org, siyanteng@loongson.cn, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, intel-wired-lan@lists.osuosl.org Subject: Re: [PATCH net-next v2] net: remove gfp_mask from napi_alloc_skb() Message-ID: <20240328113202.GH403975@kernel.org> References: <20240327040213.3153864-1-kuba@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240327040213.3153864-1-kuba@kernel.org> On Tue, Mar 26, 2024 at 09:02:12PM -0700, Jakub Kicinski wrote: > __napi_alloc_skb() is napi_alloc_skb() with the added flexibility > of choosing gfp_mask. This is a NAPI function, so GFP_ATOMIC is > implied. The only practical choice the caller has is whether to > set __GFP_NOWARN. But that's a false choice, too, allocation failures > in atomic context will happen, and printing warnings in logs, > effectively for a packet drop, is both too much and very likely > non-actionable. > > This leads me to a conclusion that most uses of napi_alloc_skb() > are simply misguided, and should use __GFP_NOWARN in the first > place. We also have a "standard" way of reporting allocation > failures via the queue stat API (qstats::rx-alloc-fail). > > The direct motivation for this patch is that one of the drivers > used at Meta calls napi_alloc_skb() (so prior to this patch without > __GFP_NOWARN), and the resulting OOM warning is the top networking > warning in our fleet. > > Reviewed-by: Alexander Lobakin > Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman