From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE92D2E1C4E for ; Thu, 14 May 2026 09:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778749705; cv=none; b=gEkSDO69jKUQoKVjP7B0/pi26qjTFlCxaUPCAOZ7hkcSmq2NcxZk231AfF+ozCoIMUZVVa8D5EAD9yfIx9q4eWNvh3YruOxMmlKVLkaEUwAp+oZQrtzCeiLn251hxLZZsQKVfvZw+KyRpFXWuPQ2Km8CUvbrueGRSSm/6t/Dtmo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778749705; c=relaxed/simple; bh=sJzVm7mM5Qdpb5n7f1LoaiNX27IWMnujc8x+4x0J98M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ImVp8yR7ZYBjuYeZayHLgmMtUC9uaYxagu3X9xwGYyY+tfZdhJXR2cNjJaMqw/60WdiBwOxnkrYsvSIxbkjRuXcqBAYHleaxVPEOh+W5EU5mH+izx/2QL9MtsQAA5/jgk2dmpb1nGc5zx1N3QpM/4yvb021v1hJ0r4BJYunveo8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=QAgTfnFp; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="QAgTfnFp" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/3eJRZXmPeJgjsdl66pfXOtXDBzINDk7PkVrFSfPubk=; b=QAgTfnFp+8VyQ7uo5CLIiP+FF8 RXHqPKgHkl+aUG8Pkxlt1DaSlyVQRjI5+dYF02G362oBSPRBU3i169G1XZIQ962XL85BwMpBWLxby YfbTb7NP2vQQGV2TRo2nR8pCvI+90EeXSdL5G7ZxxEREp/JzP75ja1x8tu39J5XJL/6bgZWVWb9g1 pkgGnp3+Rt4kd7FW758wSlb0vbIQl3+0OV6A3P6qCgrbxGVKtIEyGbprVPJ8D6dv7Scg0FzL9Z5o8 p9DcqK7NRWPRMZ+cfaGzGgVEPLlktOWbdwuW+2eSFLjsa04R4WWBCqU99bvWyPoAnXF/43A7jr5kh Rpi5JGdw==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wNS36-003pSu-1r; Thu, 14 May 2026 09:08:08 +0000 Date: Thu, 14 May 2026 02:08:03 -0700 From: Breno Leitao To: ranxiaokai627@163.com Cc: hughd@google.com, baolin.wang@linux.alibaba.com, akpm@linux-foundation.org, ljs@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn Subject: Re: [PATCH v2 2/2] mm: huge_memory: refactor thpsize_shmem_enabled_show() with helper arrays Message-ID: References: <20260513094508.50888-1-ranxiaokai627@163.com> <20260513094508.50888-2-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260513094508.50888-2-ranxiaokai627@163.com> X-Debian-User: leitao On Wed, May 13, 2026 at 09:45:08AM +0000, ranxiaokai627@163.com wrote: > From: Ran Xiaokai > > Replace the hardcoded if/else chain of test_bit() calls and string > literals in thpsize_shmem_enabled_show() with a loop over > huge_shmem_orders_by_mode[] and huge_shmem_enabled_mode_strings[] arrays. > > This makes thpsize_shmem_enabled_show() consistent with > thpsize_shmem_enabled_store() and eliminates duplicated mode name strings. > > Signed-off-by: Ran Xiaokai Reviewed-by: Breno Leitao