From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: xiaolei wang <xiaolei.wang@windriver.com>,
Lucas Stach <l.stach@pengutronix.de>,
linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com,
airlied@gmail.com, daniel@ffwll.ch
Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] drm/etnaviv: Request pages from DMA32 zone on addressing_limited
Date: Sat, 2 Nov 2024 23:24:31 +0800 [thread overview]
Message-ID: <06a4c8d0-a443-458b-82a5-ff90efc47ec0@linux.dev> (raw)
In-Reply-To: <49288307-a98d-460d-88d5-e92f23a31a46@windriver.com>
Hi,
I forget to mention that the commit title should be "on addressing limited devices",
the underscore between the last two words is not necessary. It's a typo when reply
email.
On 2024/10/1 20:32, xiaolei wang wrote:
>
>
> On 10/1/24 20:17, Lucas Stach wrote:
>> CAUTION: This email comes from a non Wind River email account!
>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>
>> Hi Xiaolei,
>>
>> Am Dienstag, dem 03.09.2024 um 10:08 +0800 schrieb Xiaolei Wang:
>>> Remove __GFP_HIGHMEM when requesting a page from DMA32 zone,
>>> and since all vivante GPUs in the system will share the same
>>> DMA constraints, move the check of whether to get a page from
>>> DMA32 to etnaviv_bind().
>>>
>>> Fixes: b72af445cd38 ("drm/etnaviv: request pages from DMA32 zone when needed")
>>> Suggested-by: Sui Jingfeng<sui.jingfeng@linux.dev>
>>> Signed-off-by: Xiaolei Wang<xiaolei.wang@windriver.com>
>>> ---
>>>
>>> change log
>>>
>>> v1:
>>> https://patchwork.kernel.org/project/dri-devel/patch/20240806104733.2018783-1-xiaolei.wang@windriver.com/
>>>
>>> v2:
>>> Modify the issue of not retaining GFP_USER in v1 and update the commit log.
>>>
>>> v3:
>>> Use "priv->shm_gfp_mask = GFP_USER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;"
>>> instead of
>>> "priv->shm_gfp_mask = GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;"
>> I don't understand this part of the changes in the new version. Why
>> should we drop the HIGHMEM bit always and not only in the case where
>> dma addressing is limited? This seems overly restrictive.
>
> Makes sense, thanks for your reminder, I will drop the HIGHMEM bit
> when the next version has address limit
>
> if (dma_addressing_limited(gpu->dev)) {
> priv->shm_gfp_mask |= GFP_DMA32;
> priv->shm_gfp_mask &= ~__GFP_HIGHMEM;
> }
>
> thanks
>
> xiaolei
>
>> Regards,
>> Lucas
>>
>>> and move the check of whether to get a page from DMA32 to etnaviv_bind().
>>>
>>> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 10 +++++++++-
>>> drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 8 --------
>>> 2 files changed, 9 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>>> index 6500f3999c5f..8cb2c3ec8e5d 100644
>>> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>>> @@ -536,7 +536,15 @@ static int etnaviv_bind(struct device *dev)
>>> mutex_init(&priv->gem_lock);
>>> INIT_LIST_HEAD(&priv->gem_list);
>>> priv->num_gpus = 0;
>>> - priv->shm_gfp_mask = GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
>>> + priv->shm_gfp_mask = GFP_USER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
>>> +
>>> + /*
>>> + * If the GPU is part of a system with DMA addressing limitations,
>>> + * request pages for our SHM backend buffers from the DMA32 zone to
>>> + * hopefully avoid performance killing SWIOTLB bounce buffering.
>>> + */
>>> + if (dma_addressing_limited(dev))
>>> + priv->shm_gfp_mask |= GFP_DMA32;
>>>
>>> priv->cmdbuf_suballoc = etnaviv_cmdbuf_suballoc_new(drm->dev);
>>> if (IS_ERR(priv->cmdbuf_suballoc)) {
>>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>>> index 7c7f97793ddd..5e753dd42f72 100644
>>> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>>> @@ -839,14 +839,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
>>> if (ret)
>>> goto fail;
>>>
>>> - /*
>>> - * If the GPU is part of a system with DMA addressing limitations,
>>> - * request pages for our SHM backend buffers from the DMA32 zone to
>>> - * hopefully avoid performance killing SWIOTLB bounce buffering.
>>> - */
>>> - if (dma_addressing_limited(gpu->dev))
>>> - priv->shm_gfp_mask |= GFP_DMA32;
>>> -
>>> /* Create buffer: */
>>> ret = etnaviv_cmdbuf_init(priv->cmdbuf_suballoc, &gpu->buffer,
>>> PAGE_SIZE);
--
Best regards,
Sui
next prev parent reply other threads:[~2024-11-02 15:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 2:08 [PATCH v3] drm/etnaviv: Request pages from DMA32 zone on addressing_limited Xiaolei Wang
2024-09-11 9:37 ` Sui Jingfeng
2024-09-11 17:35 ` Christian Gmeiner
2024-10-01 12:17 ` Lucas Stach
2024-10-01 12:32 ` xiaolei wang
2024-11-02 15:24 ` Sui Jingfeng [this message]
2024-11-02 15:31 ` Sui Jingfeng
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=06a4c8d0-a443-458b-82a5-ff90efc47ec0@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=airlied@gmail.com \
--cc=christian.gmeiner@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=xiaolei.wang@windriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.