From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 AC3F486334 for ; Thu, 21 May 2026 13:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779369546; cv=none; b=R7v4znRNPKarrAQbke/T6lYu7rtni7TwfFQJ+/RQh8jfQTueUZYObBbVJ5RIwoXyJ4nGnElprTdDHEzeyLzcB2xOWO5nxbBaLGWBbURo4ZJVh6PYf5sXsx8oJCLo6MsLM1j/rnxTLEzK/BJY3plLdS3Z6md0YOMqt/4r6eqIsxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779369546; c=relaxed/simple; bh=OT2BSMvOIQyXguIre8KjUT8VJ9nL/50riUMgXPAWf/E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oh1Zd/uffUs4d9lPdhxHNcLFdRT3YYIk5d/JvdzkTqc3rH8l5US9sTcZUmYah5EvmLmUtuctO4UEvNIOCpLiXth2XQR8MX6zuDerv+jOfn1Iq/N1x8AzO712badCk1mA097HKmVRe6uA/NM3UMMKPClXKE4bX7cCKylbd+R1zl4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=tzEx0prd; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="tzEx0prd" Message-ID: <7a976d40-54a8-43f1-9d7f-744cb34e7bc1@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779369542; h=from:from: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:in-reply-to:references:references; bh=YK2uSx9/FGZV7F7ut1QE7D7z/0Qvpx0XqR7yKWkjPq8=; b=tzEx0prdoipxV/FdFxmTZvBRCW5TYZVUqqgF4VpxSkT9Ha3qZBXV/yNTIWPomnDlzSYaSI TduvWhBs/rlXak51cn/bfK9OgMz/FVf4oH/h/DWLKZiGJVfmT/y9KwGwg7Fgy2R8uTi/Nz aOAdS01cMSkZxxhXhGHa/j+CIBH4wyU= Date: Thu, 21 May 2026 21:18:52 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 2/2] mm: shmem: refactor thpsize_shmem_enabled_show() with helper arrays Content-Language: en-US To: ranxiaokai627@163.com Cc: leitao@debian.org, ljs@kernel.org, ziy@nvidia.com, liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, akpm@linux-foundation.org, baohua@kernel.org, david@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, hughd@google.com, baolin.wang@linux.alibaba.com References: <20260518123238.56344-1-ranxiaokai627@163.com> <20260518123238.56344-3-ranxiaokai627@163.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <20260518123238.56344-3-ranxiaokai627@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/5/18 20:32, 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: Baolin Wang > Tested-by: Baolin Wang > Reviewed-by: Breno Leitao > Reviewed-by: Lorenzo Stoakes > --- Thanks. Tested-by: Lance Yang