Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8716767rwp; Wed, 19 Jul 2023 14:18:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEz4CLSaMlaRcTBVmOOOX65H0gvxRL+a1aSDENosRfw5dVo1nr+RCKN8e1Rrlca+cu72IiN X-Received: by 2002:a05:6a00:228d:b0:672:264c:e8cf with SMTP id f13-20020a056a00228d00b00672264ce8cfmr8016873pfe.7.1689801516655; Wed, 19 Jul 2023 14:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689801516; cv=none; d=google.com; s=arc-20160816; b=XfDKRJiH9RLk6FSnCB5Dwnd5lAa/AVFi4F3ytcXm7ZTunzDQHzRW1AET7xNpfnDt2r 31EVIbwhr/HTMSQ7DKwXvZ5GUbMo3FmWhvTpD8+jkKLSVhl43gy2KheAiiiFP0yU2DNb cjXSBbbP9xYumEHtWbIkSy/ebCWdNZUxlxKw0KZLqNBmO4LpixuGUp7xJGOHHTZTgbdx GbQOzW0qDAI8sw8P51jK6evPEHjt/ZzYvMCpqoAYS5AHtN9Rj+I22skAfOoresjiq8GU CRmZMS1STlteLxMTSCiHLCJkB+gEY434cZqjuZQ9b+GjrwYEIyWB0uq4kGpT3jfMyG7T 1Xvg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9RJuZsDO0oP8moUuhA+fqZqpzv4lFIo6SMf5E7Td1P0=; fh=AKzmLsXZS/AnmGquYecMciHff2P/b3shPdLwpMVWlVI=; b=OO7+uBFP/ifJ9KCteZrX8WloNlYtrsaVjlCvs4r2Y7BnVfscpmGlPhVSQbMHJygMks jhbV/8CukIWeMba9fL9PXfqSTbsQgktumbQcViNnaFlzKk+2G/6fJTtZKG/ycjge5IzF K5U79cmXBR/RZl/+5g16PXdhMokWN/tgeDRrNsuGu1EIc4EHUXyHo4JJo7kR3QgLtUT1 ODH1xLYimP+0j3hjXpGUi/p6MrzGVjlAEL8b9qxqBBYa0am7UErvVFCsZ10EFpnB6Cvz TgEksSg9/p9+3xGoujthIWr/zf9iZB7CEF/JCMzTckj52HawhCF3AloO29XeMGlGbzEl kDFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mp5F+HqN; 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 dc7-20020a056a0035c700b00681695f1f67si4076646pfb.263.2023.07.19.14.18.24; Wed, 19 Jul 2023 14:18:36 -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=mp5F+HqN; 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 S230120AbjGSUwC (ORCPT + 99 others); Wed, 19 Jul 2023 16:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbjGSUv5 (ORCPT ); Wed, 19 Jul 2023 16:51:57 -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 64E721FFA for ; Wed, 19 Jul 2023 13:51:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DBCAC61834 for ; Wed, 19 Jul 2023 20:51:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC22BC433C9; Wed, 19 Jul 2023 20:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689799911; bh=R5thK8MzXZwRF74d2FHPjnura0sN99c4ZZeDzrYKSwU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mp5F+HqNOqjXJTDdywXHW0z9pnTBc98MnAf7a8vhvVxpqq28oAHkeJRUXwIZQP6L8 DVQm0hDbNgrw0f8DhTUqr3U/4ib7oEnZ6/HgcZrCV18jEOq0FzjVeH8CWphtAjIEI4 DI6V3i9qTGAj8YC2iJ79sng2pfupjQcw2jYK6kXjH0h3FBTnequI7uJsiXWu07MuSJ YsvDUj/eErevdSDanuKVwNB/LfVhDNvloJ7X9wRIjLYxWvOG9GhsbvrPdsrE9Vaz3v WlZ4TB+kbPqpp/MOFoNb50WyKrK7Sxco6Cp+3lTuKLcXX7Hl9ZO0/upL53VElALfl2 /8Lf1Mvd0AmVA== Date: Wed, 19 Jul 2023 13:51:50 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Maciej Fijalkowski , Larysa Zaremba , Yunsheng Lin , Alexander Duyck , Jesper Dangaard Brouer , "Ilias Apalodimas" , , Subject: Re: [PATCH RFC net-next v2 7/7] net: skbuff: always try to recycle PP pages directly when in softirq Message-ID: <20230719135150.4da2f0ff@kernel.org> In-Reply-To: References: <20230714170853.866018-1-aleksander.lobakin@intel.com> <20230714170853.866018-10-aleksander.lobakin@intel.com> <20230718174042.67c02449@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, 19 Jul 2023 18:34:46 +0200 Alexander Lobakin wrote: > > What if we got here from netpoll? napi budget was 0, so napi_safe is > > false, but in_softirq() can be true or false. > > If we're on the same CPU where the NAPI would run and in the same > context, i.e. softirq, in which the NAPI would run, what is the problem? > If there really is a good one, I can handle it here. #define SOFTIRQ_BITS 8 #define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT) # define softirq_count() (preempt_count() & SOFTIRQ_MASK) #define in_softirq() (softirq_count()) I don't know what else to add beyond that and the earlier explanation. AFAIK pages as allocated by page pool do not benefit from the usual KASAN / KMSAN checkers, so if we were to double-recycle a page once a day because of a netcons race - it's going to be a month long debug for those of us using Linux in production.