Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/v3d: Add modparam for turning off Big/Super Pages

Add a modparam for turning off Big/Super Pages to make sure that if an
user doesn't want Big/Super Pages enabled, it can disabled it by setting
the modparam to false.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923141348.2422499-11-mcanal@igalia.com

+12
+7
drivers/gpu/drm/v3d/v3d_drv.c
··· 36 36 #define DRIVER_MINOR 0 37 37 #define DRIVER_PATCHLEVEL 0 38 38 39 + /* Only expose the `super_pages` modparam if THP is enabled. */ 40 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 41 + bool super_pages = true; 42 + module_param_named(super_pages, super_pages, bool, 0400); 43 + MODULE_PARM_DESC(super_pages, "Enable/Disable Super Pages support."); 44 + #endif 45 + 39 46 static int v3d_get_param_ioctl(struct drm_device *dev, void *data, 40 47 struct drm_file *file_priv) 41 48 {
+1
drivers/gpu/drm/v3d/v3d_drv.h
··· 539 539 void v3d_clean_caches(struct v3d_dev *v3d); 540 540 541 541 /* v3d_gemfs.c */ 542 + extern bool super_pages; 542 543 void v3d_gemfs_init(struct v3d_dev *v3d); 543 544 void v3d_gemfs_fini(struct v3d_dev *v3d); 544 545
+4
drivers/gpu/drm/v3d/v3d_gemfs.c
··· 20 20 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) 21 21 goto err; 22 22 23 + /* The user doesn't want to enable Super Pages */ 24 + if (!super_pages) 25 + goto err; 26 + 23 27 type = get_fs_type("tmpfs"); 24 28 if (!type) 25 29 goto err;