Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45206C4345F for ; Mon, 22 Apr 2024 10:02:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6286810F553; Mon, 22 Apr 2024 10:02:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="mMaGX+5r"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D7C310F553 for ; Mon, 22 Apr 2024 10:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PSojjO61pmwfadO2uUCv8NjPvAimnxrdkOfUbDXyGUc=; b=mMaGX+5rLeBSJoU4c83Eybmqos MFQSPDFt6r6Dc46R7SQLMRpuSdy5Mf5ZSWUPhobOwhTL9dDp5Kw+V2AnGy/nCTBeN5brREZf1tZHS 6GbVcsoz85SfzyJngM5VbeQVT4e7Txor1/0gZquqkMRJKkxkli6563P154at9WOb9SmAZYCEIqQW5 D5EiN5iZuIS3PvJQaZK4Lqkk2/sF2twwO2HBKSHWKb3kLAc9ZF+eT4x+V1yQoKEx2SkbBEUy9H3vc w8SYshcc3QRzue+pNZox/UVChzf6F7Q/0GoQvZEjAqgbEt677oCFxNmavC1LxfREeL22J/nHvcfcA MJmLulmQ==; Received: from [84.65.0.132] (helo=[192.168.0.101]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1ryqV9-007Cqv-W3; Mon, 22 Apr 2024 12:02:20 +0200 Message-ID: Date: Mon, 22 Apr 2024 11:02:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 8/8] drm/v3d: Add modparam for turning off Big/Super Pages Content-Language: en-GB To: =?UTF-8?Q?Ma=C3=ADra_Canal?= , Melissa Wen , Iago Toral , Tvrtko Ursulin , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, kernel-dev@igalia.com References: <20240421215309.660018-1-mcanal@igalia.com> <20240421215309.660018-9-mcanal@igalia.com> From: Tvrtko Ursulin In-Reply-To: <20240421215309.660018-9-mcanal@igalia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 21/04/2024 22:44, Maíra Canal wrote: > 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 > --- > drivers/gpu/drm/v3d/v3d_drv.c | 8 ++++++++ > drivers/gpu/drm/v3d/v3d_gemfs.c | 5 +++++ > 2 files changed, 13 insertions(+) > > diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c > index 3debf37e7d9b..bc8c8905112a 100644 > --- a/drivers/gpu/drm/v3d/v3d_drv.c > +++ b/drivers/gpu/drm/v3d/v3d_drv.c > @@ -36,6 +36,14 @@ > #define DRIVER_MINOR 0 > #define DRIVER_PATCHLEVEL 0 > > +bool super_pages = true; > + > +/* Only expose the `super_pages` modparam if THP is enabled. */ > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE I would have put bool super_pages in here so it can get compiled out. > +module_param_named(super_pages, super_pages, bool, 0400); > +MODULE_PARM_DESC(super_pages, "Enable/Disable Super Pages support."); > +#endif > + > static int v3d_get_param_ioctl(struct drm_device *dev, void *data, > struct drm_file *file_priv) > { > diff --git a/drivers/gpu/drm/v3d/v3d_gemfs.c b/drivers/gpu/drm/v3d/v3d_gemfs.c > index 31cf5bd11e39..5fa08263cff2 100644 > --- a/drivers/gpu/drm/v3d/v3d_gemfs.c > +++ b/drivers/gpu/drm/v3d/v3d_gemfs.c > @@ -11,6 +11,11 @@ void v3d_gemfs_init(struct v3d_dev *v3d) > char huge_opt[] = "huge=within_size"; > struct file_system_type *type; > struct vfsmount *gemfs; > + extern bool super_pages; > + > + /* The user doesn't want to enable Super Pages */ > + if (!super_pages) > + goto err; And if this hunk is moved after the CONFIG_TRANSPARENT_HUGEPAGE check just below I hope compiler can be happy with that. Regards, Tvrtko > > /* > * By creating our own shmemfs mountpoint, we can pass in