* [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
@ 2026-07-22 11:01 Robert Mader
2026-07-28 20:20 ` Kasireddy, Vivek
0 siblings, 1 reply; 4+ messages in thread
From: Robert Mader @ 2026-07-22 11:01 UTC (permalink / raw)
To: dri-devel
Cc: Robert Mader, Gerd Hoffmann, Vivek Kasireddy, Sumit Semwal,
Christian König, linux-media, linaro-mm-sig, linux-kernel
As udmabuf increasingly enjoys popularity - being used in projects like
libcamera, Gstreamer, Mesa, KWin and Weston - users more frequently
encounter cases where the current default size limit of 64MB is too low.
Examples include allocating video buffers at a 8K resolution - and even 4K
is affected when using non-subsampled video formats and high bit depths.
In its current form the size limit for individual buffers does not seem to
provide any additional level of protection - such as limiting the amount of
memory a process can pin - as the later can just allocate multiple buffers.
If additional guardrails are desired, they would likely require some kind
accounting not limited to individual buffers.
Therefor let's disable the size limit by default by setting it to the
maximal possible value, INT_MAX.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
Changes in V2:
- Use INT_MAX instead of 0 in order to not change behavior otherwise.
See
https://lore.kernel.org/dri-devel/20260711144814.8205-1-robert.mader@collabora.com/
for a previous attempt to make the value configurable via kconfig - and
in particular
https://lore.kernel.org/dri-devel/6764ca6f-b4d8-4baa-9d27-2ca867ac2d41@amd.com/
for the suggestion and discussion to remove the default limit.
---
drivers/dma-buf/udmabuf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index bced421c0d65..639e93704924 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -20,9 +20,9 @@ static int list_limit = 1024;
module_param(list_limit, int, 0644);
MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit. Default is 1024.");
-static int size_limit_mb = 64;
+static int size_limit_mb = INT_MAX;
module_param(size_limit_mb, int, 0644);
-MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in megabytes. Default is 64.");
+MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in megabytes. Default is INT_MAX.");
struct udmabuf {
pgoff_t pagecount;
--
2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
2026-07-22 11:01 [PATCH v2] dma-buf/udmabuf: Disable the size limit by default Robert Mader
@ 2026-07-28 20:20 ` Kasireddy, Vivek
2026-08-03 15:13 ` Robert Mader
0 siblings, 1 reply; 4+ messages in thread
From: Kasireddy, Vivek @ 2026-07-28 20:20 UTC (permalink / raw)
To: Robert Mader, dri-devel
Cc: Gerd Hoffmann, Sumit Semwal, Christian König, linux-media,
linaro-mm-sig, linux-kernel
Hi Robert,
> Subject: [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
>
> As udmabuf increasingly enjoys popularity - being used in projects like
> libcamera, Gstreamer, Mesa, KWin and Weston - users more frequently
> encounter cases where the current default size limit of 64MB is too low.
> Examples include allocating video buffers at a 8K resolution - and even
> 4K
> is affected when using non-subsampled video formats and high bit
> depths.
>
> In its current form the size limit for individual buffers does not seem to
> provide any additional level of protection - such as limiting the amount
> of
> memory a process can pin - as the later can just allocate multiple
> buffers.
> If additional guardrails are desired, they would likely require some kind
> accounting not limited to individual buffers.
>
> Therefor let's disable the size limit by default by setting it to the
> maximal possible value, INT_MAX.
>
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
>
> ---
>
> Changes in V2:
> - Use INT_MAX instead of 0 in order to not change behavior otherwise.
>
> See
> https://lore.kernel.org/dri-devel/20260711144814.8205-1-
> robert.mader@collabora.com/
> for a previous attempt to make the value configurable via kconfig - and
> in particular
> https://lore.kernel.org/dri-devel/6764ca6f-b4d8-4baa-9d27-
> 2ca867ac2d41@amd.com/
> for the suggestion and discussion to remove the default limit.
> ---
> drivers/dma-buf/udmabuf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
> index bced421c0d65..639e93704924 100644
> --- a/drivers/dma-buf/udmabuf.c
> +++ b/drivers/dma-buf/udmabuf.c
> @@ -20,9 +20,9 @@ static int list_limit = 1024;
> module_param(list_limit, int, 0644);
> MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit.
> Default is 1024.");
>
> -static int size_limit_mb = 64;
> +static int size_limit_mb = INT_MAX;
> module_param(size_limit_mb, int, 0644);
> -MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
> megabytes. Default is 64.");
> +MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
> megabytes. Default is INT_MAX.");
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
If there are no further concerns/questions from anyone, I'll push it to
drm-misc-next soon.
Thanks,
Vivek
>
> struct udmabuf {
> pgoff_t pagecount;
> --
> 2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
2026-07-28 20:20 ` Kasireddy, Vivek
@ 2026-08-03 15:13 ` Robert Mader
2026-08-04 6:22 ` Kasireddy, Vivek
0 siblings, 1 reply; 4+ messages in thread
From: Robert Mader @ 2026-08-03 15:13 UTC (permalink / raw)
To: Kasireddy, Vivek, dri-devel
Cc: Gerd Hoffmann, Sumit Semwal, Christian König, linux-media,
linaro-mm-sig, linux-kernel
On 28.07.26 22:20, Kasireddy, Vivek wrote:
> Hi Robert,
>
>> Subject: [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
>>
>> As udmabuf increasingly enjoys popularity - being used in projects like
>> libcamera, Gstreamer, Mesa, KWin and Weston - users more frequently
>> encounter cases where the current default size limit of 64MB is too low.
>> Examples include allocating video buffers at a 8K resolution - and even
>> 4K
>> is affected when using non-subsampled video formats and high bit
>> depths.
>>
>> In its current form the size limit for individual buffers does not seem to
>> provide any additional level of protection - such as limiting the amount
>> of
>> memory a process can pin - as the later can just allocate multiple
>> buffers.
>> If additional guardrails are desired, they would likely require some kind
>> accounting not limited to individual buffers.
>>
>> Therefor let's disable the size limit by default by setting it to the
>> maximal possible value, INT_MAX.
>>
>> Signed-off-by: Robert Mader <robert.mader@collabora.com>
>>
>> ---
>>
>> Changes in V2:
>> - Use INT_MAX instead of 0 in order to not change behavior otherwise.
>>
>> See
>> https://lore.kernel.org/dri-devel/20260711144814.8205-1-
>> robert.mader@collabora.com/
>> for a previous attempt to make the value configurable via kconfig - and
>> in particular
>> https://lore.kernel.org/dri-devel/6764ca6f-b4d8-4baa-9d27-
>> 2ca867ac2d41@amd.com/
>> for the suggestion and discussion to remove the default limit.
>> ---
>> drivers/dma-buf/udmabuf.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
>> index bced421c0d65..639e93704924 100644
>> --- a/drivers/dma-buf/udmabuf.c
>> +++ b/drivers/dma-buf/udmabuf.c
>> @@ -20,9 +20,9 @@ static int list_limit = 1024;
>> module_param(list_limit, int, 0644);
>> MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit.
>> Default is 1024.");
>>
>> -static int size_limit_mb = 64;
>> +static int size_limit_mb = INT_MAX;
>> module_param(size_limit_mb, int, 0644);
>> -MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
>> megabytes. Default is 64.");
>> +MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
>> megabytes. Default is INT_MAX.");
> Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
>
> If there are no further concerns/questions from anyone, I'll push it to
> drm-misc-next soon.
FTR., we already have a first duplicate :P
https://lore.kernel.org/dri-devel/20260803144120.11524-1-xaver.hugl@kde.org/
>
> Thanks,
> Vivek
>> struct udmabuf {
>> pgoff_t pagecount;
>> --
>> 2.55.0
--
Robert Mader
Consultant Software Developer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v2] dma-buf/udmabuf: Disable the size limit by default
2026-08-03 15:13 ` Robert Mader
@ 2026-08-04 6:22 ` Kasireddy, Vivek
0 siblings, 0 replies; 4+ messages in thread
From: Kasireddy, Vivek @ 2026-08-04 6:22 UTC (permalink / raw)
To: Robert Mader, dri-devel
Cc: Gerd Hoffmann, Sumit Semwal, Christian König, linux-media,
linaro-mm-sig, linux-kernel
> Subject: Re: [PATCH v2] dma-buf/udmabuf: Disable the size limit by
> default
>
> On 28.07.26 22:20, Kasireddy, Vivek wrote:
> > Hi Robert,
> >
> >> Subject: [PATCH v2] dma-buf/udmabuf: Disable the size limit by
> default
> >>
> >> As udmabuf increasingly enjoys popularity - being used in projects
> like
> >> libcamera, Gstreamer, Mesa, KWin and Weston - users more
> frequently
> >> encounter cases where the current default size limit of 64MB is too
> low.
> >> Examples include allocating video buffers at a 8K resolution - and
> even
> >> 4K
> >> is affected when using non-subsampled video formats and high bit
> >> depths.
> >>
> >> In its current form the size limit for individual buffers does not seem
> to
> >> provide any additional level of protection - such as limiting the
> amount
> >> of
> >> memory a process can pin - as the later can just allocate multiple
> >> buffers.
> >> If additional guardrails are desired, they would likely require some
> kind
> >> accounting not limited to individual buffers.
> >>
> >> Therefor let's disable the size limit by default by setting it to the
> >> maximal possible value, INT_MAX.
> >>
> >> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> >>
> >> ---
> >>
> >> Changes in V2:
> >> - Use INT_MAX instead of 0 in order to not change behavior
> otherwise.
> >>
> >> See
> >> https://lore.kernel.org/dri-devel/20260711144814.8205-1-
> >> robert.mader@collabora.com/
> >> for a previous attempt to make the value configurable via kconfig -
> and
> >> in particular
> >> https://lore.kernel.org/dri-devel/6764ca6f-b4d8-4baa-9d27-
> >> 2ca867ac2d41@amd.com/
> >> for the suggestion and discussion to remove the default limit.
> >> ---
> >> drivers/dma-buf/udmabuf.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
> >> index bced421c0d65..639e93704924 100644
> >> --- a/drivers/dma-buf/udmabuf.c
> >> +++ b/drivers/dma-buf/udmabuf.c
> >> @@ -20,9 +20,9 @@ static int list_limit = 1024;
> >> module_param(list_limit, int, 0644);
> >> MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit.
> >> Default is 1024.");
> >>
> >> -static int size_limit_mb = 64;
> >> +static int size_limit_mb = INT_MAX;
> >> module_param(size_limit_mb, int, 0644);
> >> -MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
> >> megabytes. Default is 64.");
> >> +MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in
> >> megabytes. Default is INT_MAX.");
> > Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> >
> > If there are no further concerns/questions from anyone, I'll push it to
> > drm-misc-next soon.
>
> FTR., we already have a first duplicate :P
>
> https://lore.kernel.org/dri-devel/20260803144120.11524-1-
> xaver.hugl@kde.org/
Yeah, looks like this change seems to be desirable in many use-cases.
I have pushed it to drm-misc-next today.
Thanks,
Vivek
>
> >
> > Thanks,
> > Vivek
> >> struct udmabuf {
> >> pgoff_t pagecount;
> >> --
> >> 2.55.0
>
> --
> Robert Mader
> Consultant Software Developer
>
> Collabora Ltd.
> Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
> Registered in England & Wales, no. 5513718
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-04 6:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22 11:01 [PATCH v2] dma-buf/udmabuf: Disable the size limit by default Robert Mader
2026-07-28 20:20 ` Kasireddy, Vivek
2026-08-03 15:13 ` Robert Mader
2026-08-04 6:22 ` Kasireddy, Vivek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome