Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4314869rdh; Tue, 28 Nov 2023 19:18:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYOskDCRB/GIuq7/shMkKsefjCikpeo8CvyxVLcG9/MpHnufpDkj1zhBupkcA37lUp2pzx X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr16685860oti.5.1701227889058; Tue, 28 Nov 2023 19:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701227889; cv=none; d=google.com; s=arc-20160816; b=rJ1UbodISwH8i3//eaqsKfk6WXuZ0fZLTUYu4toozaJRNJ5pXyCcQIrqNIQK5F5TSk vtHVDNU5aKtfd3QXr5P1DTQudqLtdH0MXiyNz+lV+NAqj/Z/jmyX9BdfckC24FgMqjLA W7WRSSw0O1gPsaGKhvzFaEIG4i5CTjUrpzhoqmE+zyQOGfxEqMg317Y8xxLsmnTN72Mv dii4xPbpWRFQrxro7tmmM8NdDkLLZIShf1fNHqhF3BagRYp6HqbEc6PHqyg7pfvgVgRF uCrNVsuB4yqrWuXSxWIHSd+UBzXGukmO84wCRCU1gXzAGj+/gxzh5y2TQhbQNplDonWH mHkA== 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=sDruUW+Rg9ZDAYA8azFwQZxwfwD46D/YCkzH2tinxH0=; fh=BiSQsy1FPS17+N+TxJH9cVe9Q5wZPUtka4Ua5XbelDc=; b=ylUjyKUFQXXssrKfeKONqGvALPtBbAds/4vBEn9UQC5K86v7H0rGYprxwD5mfxFsu9 zcePcZfaColazGnsW7P4rN4/fLAF0bIILBR04nxbccBvPZLp+BRN3352fhJuwE4fk4Tw eiZ8VbX3/1+6mESscrwas0DkXAluuufWY/mBGTp7b4ZzOZom6ofNiBzidWWg+ATokCTT W3GcIKaKeD9KmfbQausWw6BxVs4Czb0yIoboMQ++7hB6y6P+qJKvkNUeB5CjKgTgR+rM 39cUZlDHnVisRo4k5T6EFqL9bAa/JeD+tRM8OaSJu/3+ofQgIJliR/G9TS+bjfFdFbCc gsFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q3-20020a631f43000000b005898db9d676si13084051pgm.260.2023.11.28.19.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:18:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 26BE8804486C; Tue, 28 Nov 2023 19:18:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376782AbjK2DRt (ORCPT + 99 others); Tue, 28 Nov 2023 22:17:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbjK2DRs (ORCPT ); Tue, 28 Nov 2023 22:17:48 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9F6219AD; Tue, 28 Nov 2023 19:17:53 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Sg4Cc5t3JzShPM; Wed, 29 Nov 2023 11:13:32 +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.35; Wed, 29 Nov 2023 11:17:51 +0800 Subject: Re: [PATCH net-next v5 03/14] page_pool: avoid calling no-op externals when possible To: Alexander Lobakin , Christoph Hellwig CC: Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexander Duyck , David Christensen , Jesper Dangaard Brouer , Ilias Apalodimas , Paul Menzel , , , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni References: <20231124154732.1623518-1-aleksander.lobakin@intel.com> <20231124154732.1623518-4-aleksander.lobakin@intel.com> <6bd14aa9-fa65-e4f6-579c-3a1064b2a382@huawei.com> From: Yunsheng Lin Message-ID: <534e7752-38a9-3e7e-cb04-65789712fb66@huawei.com> Date: Wed, 29 Nov 2023 11:17:50 +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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 19:18:06 -0800 (PST) On 2023/11/27 22:32, Alexander Lobakin wrote: > > Chris, any thoughts on a global flag for skipping DMA syncs ladder? It seems there was one already in the past: https://lore.kernel.org/netdev/7c55a4d7-b4aa-25d4-1917-f6f355bd722e@arm.com/T/ > >> >> >>> +static inline bool page_pool_set_dma_addr(const struct page_pool *pool, >>> + struct page *page, >>> + dma_addr_t addr) >>> { >>> + unsigned long val = addr; >>> + >>> + if (unlikely(!addr)) { >>> + page->dma_addr = 0; >>> + return true; >>> + } >> >> The above seems unrelated change? > > Related. We use page_put_set_dma_addr() to clear ::dma_addr as well > (grep for it in page_pool.c). In this case, we don't want > dma_need_sync() to be called as we explicitly pass zero. This check > zeroes the field and exits as quickly as possible. The question seems to be about if we need to ensure the LSB of page->dma_addr is not set when page_pool releases a page back to page allocator? > In case with the call mentioned above, zero is a compile-time constant > there, so that this little branch will be inlined with the rest dropped. >