Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10826164rwp; Fri, 21 Jul 2023 05:42:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGUY55rFovh8YdeXiEq3aOH0UGC/SoQfACIMUquEqTGD/tEyFSpfMo8uinJoM8leJ8DOjMf X-Received: by 2002:aa7:d1d9:0:b0:51b:c714:a2a1 with SMTP id g25-20020aa7d1d9000000b0051bc714a2a1mr1422310edp.7.1689943355483; Fri, 21 Jul 2023 05:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689943355; cv=none; d=google.com; s=arc-20160816; b=yiNkYCPqlC3N2ZfB/8ORwvZ5U5HmrRvWwDfmmb3wgj8dCkA22shUZa9yvApBatIvwI 9GfFfwAx1mTAEzCGqjH/RC3sBsN7sI+BfYhkiyvKWKFDIuOE45yLWaJe9Qx7LU2lUpDQ ygGUlt5WTFdexgy11DNEmzSoSY7s/lEIB3Z0JSYyHUGU3MT2nHO+LlTla5VJeArX2sOr 7Uf5doCL66+UxqBKrVnRg/LiabNDaeybeWVj/3FTHcmE67HrxkLl8x/pGFL5T0UZ/RCC B2qQiFTwz/BgSTr+eWLgYL9ly94sRWntaq3x0XbKU4GGgIznpd/oXN4qzH8gB+ul2Dcb IQsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ZPL94wRJgD8E9VEZl2rkkQqNDHzzKKf4ePxKJsuW2MQ=; fh=XiZuoG/3UZvmFZB6qJTGO8WbEIC+bJTs9aJyxpxZGLE=; b=Ep8dGoYD4hyj18KtMx+IfgVfhTWeyg/zP/pKEifZuGewfLohyQADjU5EVq7lMkknVZ aWKzxbeJpvoLxU1L6XuP+9DMD8RKJbCM0jfjINEP9B4fUQUzSnrMGr3ZzbLHzupLmD9t bb9UL7ASRLa+owF7okRNwSFiclp/SWrda7M4rBOH8YGs9CuM3C6aDWJJujDediTiEGg/ IgkrHYmV5NXK/vfUq8uWFnYNT26cKmQFz5UUmDtOotoMaXonocBjF+yokudu6AD6ZtR3 5adQD8WhAJp7n6ZDQTt9YysGhVljxsR6a4U77xl9jqjiJzHp3EvVTJZh5hxMj6yWNXVg P8gw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020aa7ce03000000b00521d1c34b1bsi2118759edv.189.2023.07.21.05.42.10; Fri, 21 Jul 2023 05:42:35 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbjGULxj (ORCPT + 99 others); Fri, 21 Jul 2023 07:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbjGULxi (ORCPT ); Fri, 21 Jul 2023 07:53:38 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56262130; Fri, 21 Jul 2023 04:53:36 -0700 (PDT) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R6nvC73z1zHqR9; Fri, 21 Jul 2023 19:51:03 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 21 Jul 2023 19:53:33 +0800 Subject: Re: [PATCH RFC net-next v2 7/7] net: skbuff: always try to recycle PP pages directly when in softirq To: Jakub Kicinski , Alexander Lobakin CC: "David S. Miller" , Eric Dumazet , Paolo Abeni , Maciej Fijalkowski , Larysa Zaremba , Alexander Duyck , Jesper Dangaard Brouer , Ilias Apalodimas , , References: <20230714170853.866018-1-aleksander.lobakin@intel.com> <20230714170853.866018-10-aleksander.lobakin@intel.com> <20230718174042.67c02449@kernel.org> <20230719135150.4da2f0ff@kernel.org> <48c1d70b-d4bd-04c0-ab46-d04eaeaf4af0@intel.com> <20230720101231.7a5ff6cd@kernel.org> <8e65c3d3-c628-2176-2fc2-a1bc675ad607@intel.com> <20230720110027.4bd43ee7@kernel.org> <988fc62d-2329-1560-983a-79ff5653a6a6@intel.com> <20230720122015.1e7efc21@kernel.org> <20230720124647.413363d5@kernel.org> From: Yunsheng Lin Message-ID: <406885ee-8dd0-1654-ec13-914ed8986c24@huawei.com> Date: Fri, 21 Jul 2023 19:53:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20230720124647.413363d5@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 2023/7/21 3:46, Jakub Kicinski wrote: > On Thu, 20 Jul 2023 21:33:40 +0200 Alexander Lobakin wrote: >>> We can as well check >>> (in_softirq() && !irqs_disabled() && !in_hardirq()) >>> ? >> >> Yes, something like that. Messy, but I see no other options... >> >> So, I guess you want to add an assertion to make sure that we're *not* >> in this: >> >> in_hardirq() || irqs_disabled() >> >> Does this mean that after it's added, my patch is sane? :p > > Well... it's acceptable. Make sure you add a good, informative > but concise comment :) > Does it mean ptr_ring_produce_any() is needed in page_pool_recycle_in_ring() too? As it is assumed that page pool API can be called in the context with irqs_disabled() || in_hardirq(), and force recylcling happens in the prt_ring. Isn't it conflit with the below patch? as the below patch assume page pool API can not be called in the context with irqs_disabled() || in_hardirq(): [PATCH net-next] page_pool: add a lockdep check for recycling in hardirq Or am I missing something obvious here?