Skip to content

Commit

Permalink
udmabuf: configurable list_limit and size_limit_mb
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dongwon Kim <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
downor authored and kraxel committed Jun 23, 2021
1 parent 89bcadc commit 2e717a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/dma-buf/udmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2e717a5

Please sign in to comment.