From patchwork Fri Nov 1 16:54:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13859620 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 A490CE6F06F for ; Fri, 1 Nov 2024 16:58:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE4CB10E9E1; Fri, 1 Nov 2024 16:57:59 +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="d1cXjxzK"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7196910E9E1 for ; Fri, 1 Nov 2024 16:57:59 +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:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QmeuZbhj6lC4GdqAZ3mOlOVzHqfnX+iXpQ+XjcOOq+Y=; b=d1cXjxzKKBdnY22DrVcOvY8alL sfpQ/8NTFP3a9dpohbtQlkQduFk/c5sUqOAFfYz7W4eUbeI7ouLgHGz9g6si1DWS6tAhtFJFCL6jo J1C0qHwUnL3Hkni5JJyaXBG8i4V1lCLEvoUQ3BpfZK+wAfYHdxBEb4pr1mF8cm7c7g324FkNWSgDu WFXi7i85RR7lGkqsH3KxSwJkNQBmhGRCbqYWPA9ju5P3c6hElOGH42E7KpFxxqVdUAuCcEKMXM7V8 eifJbrDoDUGye4XBp00gzzdtGJuBgLFpJXYpaLIDll8PpILDZ02WJ0c8fCuPK5WVH/e3YZ5VzAvBi 9A5YDWsQ==; Received: from [187.36.213.55] (helo=morissey..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1t6uxz-000VPu-9o; Fri, 01 Nov 2024 17:57:44 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Jonathan Corbet , Andrew Morton , Hugh Dickins , Barry Song , David Hildenbrand , Ryan Roberts , Baolin Wang , Lance Yang Cc: linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, =?utf-8?q?Ma=C3=ADra_Canal?= Subject: [PATCH v5 0/5] mm: add more kernel parameters to control mTHP Date: Fri, 1 Nov 2024 13:54:04 -0300 Message-ID: <20241101165719.1074234-2-mcanal@igalia.com> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 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" This series introduces four patches related to the kernel parameters controlling mTHP and a fifth patch replacing `strcpy()` for `strscpy()` in the file `mm/huge_memory.c`. The first patch is a straightforward documentation update, correcting the format of the kernel parameter ``thp_anon=``. The second, third, and fourth patches focus on controlling THP support for shmem via the kernel command line. The second patch introduces a parameter to control the global default huge page allocation policy for the internal shmem mount. The third patch moves a piece of code to a shared header to ease the implementation of the fourth patch. Finally, the fourth patch implements a parameter similar to ``thp_anon=``, but for shmem. The goal of these changes is to simplify the configuration of systems that rely on mTHP support for shmem. For instance, a platform with a GPU that benefits from huge pages may want to enable huge pages for shmem. Having these kernel parameters streamlines the configuration process and ensures consistency across setups. Let me know your thoughts. v1 -> v2: https://lore.kernel.org/linux-mm/20241027175743.1056710-1-mcanal@igalia.com/T/ * [1/3] s/fix the format/fix the doc in the commit's subject (Barry Song & David Hildenbrand) * [1/3] Add Barry's A-b to PATCH 1/3 (Barry Song) * [1/3] s/64KB/64K (David Hildenbrand) * [1/3] Add David's A-b to PATCH 1/3 (David Hildenbrand) * [2/3] Create the function `shmem_valid_huge()` to reduce code-duplication (Baolin Wang) * [3/4] New PATCH: generalize the function `setup_thp_anon()` and add it to common file * [4/4] Fix typo in the documentation: s/shmem_anon/thp_shmem (Barry Song) * [4/4] Reduce code-duplication (Barry Song) v2 -> v3: https://lore.kernel.org/linux-mm/20241029002324.1062723-1-mcanal@igalia.com/T/ * [2/4] Apply Wang's suggestion (Baolin Wang) * [3/4] Delete PATCH 3/4 from v2 and implement ``thp_shmem=`` just like in v1 (Barry Song) * [4/4] New PATCH: "mm: huge_memory: Use strscpy() instead of strcpy()" v3 -> v4: https://lore.kernel.org/linux-mm/20241030130308.1066299-1-mcanal@igalia.com/T/ * [2/5] Improve commit message by including details about the use of the kernel parameter (Andrew Morton) * [2/5] Add Baolin's R-b to PATCH 2/5 (Baolin Wang) * [2/5] Add David's R-b to PATCH 2/5 (David Hildenbrand) * [3/5] New PATCH: "mm: move ``get_order_from_str()`` to internal.h" (Barry Song & David Hildenbrand) * [4/5] Improve commit message by including details about the use of the kernel parameter (Andrew Morton) * [5/5] Add Lance's R-b to PATCH 5/5 (Lance Yang) v4 -> v5: https://lore.kernel.org/linux-mm/20241101164313.1073238-2-mcanal@igalia.com/T/ * [3/5] Don't use personal e-mail address (Maíra Canal) Best Regards, - Maíra Maíra Canal (5): mm: fix docs for the kernel parameter ``thp_anon=`` mm: shmem: control THP support through the kernel command line mm: move ``get_order_from_str()`` to internal.h mm: shmem: override mTHP shmem default with a kernel parameter mm: huge_memory: Use strscpy() instead of strcpy() .../admin-guide/kernel-parameters.txt | 19 +- Documentation/admin-guide/mm/transhuge.rst | 25 ++- mm/huge_memory.c | 42 ++--- mm/internal.h | 22 +++ mm/shmem.c | 177 +++++++++++++++--- 5 files changed, 234 insertions(+), 51 deletions(-)