From patchwork Sun Oct 27 17:36:36 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: 13852706 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFA58D13577 for ; Sun, 27 Oct 2024 17:58:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 487F16B009B; Sun, 27 Oct 2024 13:58:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 410C66B009C; Sun, 27 Oct 2024 13:58:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B1416B009D; Sun, 27 Oct 2024 13:58:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 053666B009B for ; Sun, 27 Oct 2024 13:58:44 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5E855141C3D for ; Sun, 27 Oct 2024 17:58:21 +0000 (UTC) X-FDA: 82720141434.07.F8ADF77 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by imf15.hostedemail.com (Postfix) with ESMTP id D804FA0003 for ; Sun, 27 Oct 2024 17:58:19 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="MDBz/DCN"; spf=pass (imf15.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730051765; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=+EYxh3PAF2StjbS6XQUuDIepM4pqjcsAUbbLfrUfkKo=; b=wAcDp82FSt0xp6DM/oHQseIEt+KjmbQ54k+kweis+qbtUas34p8OdXdoH44G7IHGh0i3EF NkjCfKlaCQBLAQAlSvisoAAA4uRfZ6uDzSxRnyJzKP4JDAu5O0pBSxL2PHlpGh28vvGsvm IrqZommS6olb/wmQ4P9ar5FykB5V2LU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730051765; a=rsa-sha256; cv=none; b=codEYqKEGKJpTAI7WITUZ0+8uW9CTgUp1dFiaPYz0wKmov3yktBLekxWjKFGwDJc1rMKeR iM55WT0quIHEIP1tAmPoWXu6x7NcmZeUGvtXJmTFzWRc149HOlOPara0alBC5Xkr1+bpOL VkcSqd8DLjMtL/q62kQAK9JCBdwnxpE= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="MDBz/DCN"; spf=pass (imf15.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com 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=+EYxh3PAF2StjbS6XQUuDIepM4pqjcsAUbbLfrUfkKo=; b=MDBz/DCNOUZvjCqX1ePpLaGvlS aE4Q0gy6ii59jGv7tPRgl4QRR5ZrucmSM6lqdxPNXUEOrWYzqZ3FR2MD/t5CX4oxKWyD+s45KU57c uLRygNdqehYhmO+H5RFCwGs1d4nbKcaT8fe7mqTcqfYU76Car+hrszGUCHAdy1PbzmeNGrHfJdFMA YIW5dU870nlb+iXKIVS8dGfRfIUUpBqDRoZW46aLrx4Dr920YkVPgDcJXWSN7uBaq5iZGvwKADtOT pd5Av7XNj6lyHVpYgekoPvxTasM2mIHEfcVm7/IWBa30e3zxrCEmOKLnaoq57GEzpWi29U8khPHeY 4HoveHyw==; 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 1t57Wu-00Fn6f-Fb; Sun, 27 Oct 2024 18:58:21 +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, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, =?utf-8?q?Ma=C3=ADra_C?= =?utf-8?q?anal?= Subject: [PATCH 0/3] mm: add more kernel parameters to control mTHP Date: Sun, 27 Oct 2024 14:36:36 -0300 Message-ID: <20241027175743.1056710-1-mcanal@igalia.com> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 X-Stat-Signature: yi7bou4y7oemkumigb7o6ameg8j7zirp X-Rspamd-Queue-Id: D804FA0003 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1730051899-239923 X-HE-Meta: U2FsdGVkX1+5TOAzczWFhN9xgYZETiALQi++qbk2YK2L1KIDm3TUlpRQMVS1koBmwI084qQHxPoCV65PX+XARw+KKHw13xZTK4xv4ItYJaDsoGHrCdG9NXrFN/GBgfPKDO01EhS4SGzfRZy0q43DHlt87NALT5B05MQXTZSe7CTnaEwbhQl8C//1y6lH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kNbkCE5Rb6w3n8TeHm5Du+9cKPg4Q0dMd X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This series introduces three patches related to the kernel parameters controlling mTHP. The first patch is a straightforward documentation update, correcting the format of the kernel parameter ``thp_anon=``. The second and third 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 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. Regarding the third patch, I’m open to suggestions on how to reduce code duplication between ``thp_anon=`` and ``thp_shmem=``. While I duplicated the ``get_order_from_str()`` function, I realize this isn’t ideal and would appreciate advice on where best to place the function. Let me know your thoughts. [1] https://lore.kernel.org/linux-mm/20240820105244.62703-1-21cnbao@gmail.com/ Best Regards, - Maíra Maíra Canal (3): mm: fix the format of the kernel parameter ``thp_anon=`` mm: shmem: control THP support through the kernel command line mm: shmem: override mTHP shmem default with a kernel parameter .../admin-guide/kernel-parameters.txt | 19 ++- Documentation/admin-guide/mm/transhuge.rst | 25 ++- mm/shmem.c | 147 +++++++++++++++++- 3 files changed, 186 insertions(+), 5 deletions(-)