All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] udmabuf: configurable list_limit and size_limit_mb
@ 2021-06-11 21:21 Dongwon Kim
  2021-06-23 12:14 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Dongwon Kim @ 2021-06-11 21:21 UTC (permalink / raw)
  To: dri-devel; +Cc: Dongwon Kim, Gerd Hoffmann

Default list_limit and size_limit_mb are not big enough to cover all
possible use cases. For example, list_limit could be well over its default,
1024 if only one or several pages are chained in all individual list entries
when creating dmabuf backed by >4MB buffer. list_limit and size_limit_mb are
now defined as module parameters so that those can be optionally configured
by root with proper values to remove these constraints.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
 drivers/dma-buf/udmabuf.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 1a79ce899b0f..8df761a10251 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -13,8 +13,13 @@
 #include <linux/udmabuf.h>
 #include <linux/hugetlb.h>
 
-static const u32    list_limit = 1024;  /* udmabuf_create_list->count limit */
-static const size_t size_limit_mb = 64; /* total dmabuf size, in megabytes  */
+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;
+module_param(size_limit_mb, int, 0644);
+MODULE_PARM_DESC(size_limit_mb, "Max size of a dmabuf, in megabytes. Default is 64.");
 
 struct udmabuf {
 	pgoff_t pagecount;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] udmabuf: configurable list_limit and size_limit_mb
  2021-06-11 21:21 [PATCH] udmabuf: configurable list_limit and size_limit_mb Dongwon Kim
@ 2021-06-23 12:14 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2021-06-23 12:14 UTC (permalink / raw)
  To: Dongwon Kim; +Cc: dri-devel

On Fri, Jun 11, 2021 at 02:21:07PM -0700, Dongwon Kim wrote:
> Default list_limit and size_limit_mb are not big enough to cover all
> possible use cases. For example, list_limit could be well over its default,
> 1024 if only one or several pages are chained in all individual list entries
> when creating dmabuf backed by >4MB buffer. list_limit and size_limit_mb are
> now defined as module parameters so that those can be optionally configured
> by root with proper values to remove these constraints.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>

Pushed to drm-misc-next.

thanks,
  Gerd


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-23 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 21:21 [PATCH] udmabuf: configurable list_limit and size_limit_mb Dongwon Kim
2021-06-23 12:14 ` Gerd Hoffmann

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.