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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82603C1B08C for ; Thu, 15 Jul 2021 03:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6921F61362 for ; Thu, 15 Jul 2021 03:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234487AbhGODxB (ORCPT ); Wed, 14 Jul 2021 23:53:01 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:15014 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231378AbhGODw7 (ORCPT ); Wed, 14 Jul 2021 23:52:59 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GQL034H72zbcqP; Thu, 15 Jul 2021 11:46:43 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 15 Jul 2021 11:49:57 +0800 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_CBC_SHA256) id 15.1.2176.2; Thu, 15 Jul 2021 11:49:57 +0800 Subject: Re: [PATCH rfc v5 2/4] page_pool: add interface to manipulate frag count in page pool To: Alexander Duyck , Jesper Dangaard Brouer CC: David Miller , Jakub Kicinski , Jesper Dangaard Brouer , Russell King - ARM Linux , Marcin Wojtas , , , Salil Mehta , , , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrew Morton , "Peter Zijlstra" , Will Deacon , "Matthew Wilcox" , Vlastimil Babka , , , Peter Xu , "Feng Tang" , Jason Gunthorpe , Matteo Croce , Hugh Dickins , Jonathan Lemon , Alexander Lobakin , "Willem de Bruijn" , , Cong Wang , Kevin Hao , , Marco Elver , Yonghong Song , , , Martin KaFai Lau , , Netdev , LKML , bpf References: <1626255285-5079-1-git-send-email-linyunsheng@huawei.com> <1626255285-5079-3-git-send-email-linyunsheng@huawei.com> <79d9e41c-6433-efe1-773a-4f5e91e8de0f@redhat.com> From: Yunsheng Lin Message-ID: <73ef1add-01df-7783-7982-da9e59c26330@huawei.com> Date: Thu, 15 Jul 2021 11:49:56 +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: dggeme707-chm.china.huawei.com (10.1.199.103) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/14 22:46, Alexander Duyck wrote: > On Wed, Jul 14, 2021 at 3:18 AM Jesper Dangaard Brouer > wrote: >> >> >> >> On 14/07/2021 11.34, Yunsheng Lin wrote: >>> As suggested by Alexander, "A DMA mapping should be page >>> aligned anyway so the lower 12 bits would be reserved 0", >>> so it might make more sense to repurpose the lower 12 bits >>> of the dma address to store the frag count for frag page >>> support in page pool for 32 bit systems with 64 bit dma, >>> which should be rare those days. >> >> Do we have any real driver users with 32-bit arch and 64-bit DMA, that >> want to use this new frag-count system you are adding to page_pool? >> >> This "lower 12-bit use" complicates the code we need to maintain >> forever. My guess is that it is never used, but we need to update and >> maintain it, and it will never be tested. >> >> Why don't you simply reject using page_pool flag PP_FLAG_PAGE_FRAG >> during setup of the page_pool for this case? >> >> if ((pool->p.flags & PP_FLAG_PAGE_FRAG) && >> (sizeof(dma_addr_t) > sizeof(unsigned long))) >> goto reject-setup; >> >> > > That sounds good to me if we want to go that route. It would simplify > this quite a bit since essentially we could just drop these if blocks. Ok, let's wait for a few day to see if there is anyone with 32-bit arch and 64-bit DMA system care enough to use the frag-count support in the page pool. > > Thanks. > > - Alex > . >