From: Yunsheng Lin <linyunsheng@huawei.com>
To: Alexander Duyck <alexander.duyck@gmail.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Mina Almasry <almasrymina@google.com>, <davem@davemloft.net>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Liang Chen <liangchen.linux@gmail.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jesper Dangaard Brouer <hawk@kernel.org>
Subject: Re: [PATCH net-next v7 1/6] page_pool: frag API support for 32-bit arch with 64-bit DMA
Date: Fri, 25 Aug 2023 17:40:43 +0800 [thread overview]
Message-ID: <5aae00a4-42c0-df8b-30cb-d47c91cf1095@huawei.com> (raw)
In-Reply-To: <CAKgT0UeSOBbXohq1rZ3YsB4abB_-5ktkLtYbDKTah8dvaojruA@mail.gmail.com>
On 2023/8/24 2:00, Alexander Duyck wrote:
> On Wed, Aug 23, 2023 at 7:25 AM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Wed, 23 Aug 2023 11:03:31 +0800 Yunsheng Lin wrote:
>>> On 2023/8/22 23:38, Jakub Kicinski wrote:
>>>> On Tue, 22 Aug 2023 17:21:35 +0800 Yunsheng Lin wrote:
>>>>> As the CONFIG_PHYS_ADDR_T_64BIT seems to used widely in x86/arm/mips/powerpc,
>>>>> I am not sure if we can really make the above assumption.
>>>>>
>>>>> https://elixir.free-electrons.com/linux/v6.4-rc6/K/ident/CONFIG_PHYS_ADDR_T_64BIT
>>>>
>>>> Huh, it's actually used a lot less than I anticipated!
>>>>
>>>> None of the x86/arm/mips/powerpc systems matter IMHO - the only _real_
>>>
>>> Is there any particular reason that you think that the above systems does
>>> not really matter?
>>
>> Not the systems themselves but the combination of a 32b arch with
>> an address space >16TB. All those arches have 64b equivalent, seems
>> logical to use the 64b version for a system with a large address space.
>> If we're talking about a system which ends up running Linux.
>>
>>> As we have made a similar wrong assumption about those arches before, I am
>>> really trying to be more cautious about it.
>>>
>>> I searched through the web, some seems to be claiming that "32-bits is DEAD",
>>> I am not sure if there is some common agreement among the kernel community,
>>> is there any previous discussion about that?
>>
>> My suspicion/claim is that 32 + PAGE_SHIFT should be enough bits for
>> any 32b platform.
>
> One additional thing we could consider would be to simply look at
> having page_pool enforce a DMA mask for the device to address any
> cases where we might not be able to fit the address. Then in the
> unlikely event that somebody is running a 32b system with over 16
> terabytes of RAM. With that the DMA subsystem would handle it for us
> and we wouldn't have to worry so much about it.
It seems there is a API to acquire the DMA mask used by the device:
https://elixir.free-electrons.com/linux/v6.4-rc6/source/include/linux/dma-mapping.h#L434
Is it possible to use that to check if DMA mask used by the device is
within 32 + PAGE_SHIFT limit, if yes, we use jakub's proposal to reduce
reduce the dma address bit, if no, we fail the page_pool creation?
> .
>
next prev parent reply other threads:[~2023-08-25 9:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 10:01 [PATCH net-next v7 0/6] introduce page_pool_alloc() related API Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 1/6] page_pool: frag API support for 32-bit arch with 64-bit DMA Yunsheng Lin
2023-08-17 13:57 ` Ilias Apalodimas
2023-08-17 16:15 ` Jakub Kicinski
2023-08-17 16:59 ` Ilias Apalodimas
2023-08-17 23:57 ` Jakub Kicinski
2023-08-18 6:12 ` Ilias Apalodimas
2023-08-18 8:59 ` Yunsheng Lin
2023-08-18 21:51 ` Jakub Kicinski
2023-08-21 8:38 ` Ilias Apalodimas
2023-08-21 11:15 ` Ilias Apalodimas
2023-08-21 12:18 ` Yunsheng Lin
2023-08-21 18:35 ` Jakub Kicinski
2023-08-22 9:21 ` Yunsheng Lin
2023-08-22 15:38 ` Jakub Kicinski
2023-08-22 18:30 ` Alexander Duyck
2023-08-22 18:58 ` Alexander Duyck
2023-08-23 3:03 ` Yunsheng Lin
2023-08-23 14:25 ` Jakub Kicinski
2023-08-23 18:00 ` Alexander Duyck
2023-08-25 9:40 ` Yunsheng Lin [this message]
2023-08-26 0:08 ` Jakub Kicinski
2023-08-28 14:50 ` Alexander Duyck
2023-08-28 15:38 ` Jakub Kicinski
2023-08-29 11:58 ` Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 2/6] page_pool: unify frag_count handling in page_pool_is_last_frag() Yunsheng Lin
2023-08-16 11:30 ` Ilias Apalodimas
2023-08-16 12:42 ` Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 3/6] page_pool: remove PP_FLAG_PAGE_FRAG Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 4/6] page_pool: introduce page_pool[_cache]_alloc() API Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 5/6] page_pool: update document about frag API Yunsheng Lin
2023-08-16 10:01 ` [PATCH net-next v7 6/6] net: veth: use newly added page pool API for veth with xdp Yunsheng Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5aae00a4-42c0-df8b-30cb-d47c91cf1095@huawei.com \
--to=linyunsheng@huawei.com \
--cc=aleksander.lobakin@intel.com \
--cc=alexander.duyck@gmail.com \
--cc=almasrymina@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=liangchen.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®