From patchwork Thu Jul 11 05:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13730034 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 79E12C3DA41 for ; Thu, 11 Jul 2024 05:43:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E8FC6B0093; Thu, 11 Jul 2024 01:43:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F9B76B009C; Thu, 11 Jul 2024 01:43:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B4046B0093; Thu, 11 Jul 2024 01:43:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C2F1C6B0098 for ; Thu, 11 Jul 2024 01:43:13 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1BEE780401 for ; Thu, 11 Jul 2024 05:43:13 +0000 (UTC) X-FDA: 82326378666.14.961A018 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf09.hostedemail.com (Postfix) with ESMTP id 5517B14001C for ; Thu, 11 Jul 2024 05:43:08 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=jUNh5m1v; spf=pass (imf09.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720676558; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=u47PfWzz2FJOZ82dozbNoz0ZxoMQZbCxCxb8RnhAKuM=; b=pTYqRIs63h/gyNQBKZbcZ2JNj8xZN9mpYSIB7hJIsP2mE3M1OVxUXiWs7gd/HCfCRD9s2b WUwIswAg8JGZSlfwBxiULZl09bg/Oj1DE5jiR29I4gBSldw8keH5GbWsraqd4NVi09xgDE Ys5Nfr3WPb7K3y5Ay7MkP2nuvuUi1Kk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720676558; a=rsa-sha256; cv=none; b=sF8qwlY9WHN8X/bxW3KK1vxivRTxCGUshlVfguozXs/aYP68YPvxtr6U9XmMCUfJ8MqSU5 nodnt8BKP612sKSJ5rr5A6neOrdUALPP7DIL6lcUnxCEtw7m+EXWnn5/+V8UiBUqfAqeSx ANLG+FpGvFQNDYLwXiYaqDwsHPN+reY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=jUNh5m1v; spf=pass (imf09.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1720676585; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=u47PfWzz2FJOZ82dozbNoz0ZxoMQZbCxCxb8RnhAKuM=; b=jUNh5m1vBnPPTSbpwy/f64rq8dley9ztXRROgT6lA3BVqKUyVxQ1e9OcaqNq41CabGLb5+QUcqVGwqzFSp24E2GxAq8HLDvqkOMtX8SIn1uK8/BOJJQtpdSGtDY0hzu8pvuATd0MnDeE53dWg4ISVcbOFBb/hE6LWd5gh51h5zo= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045220184;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0WAIkxYZ_1720676581; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WAIkxYZ_1720676581) by smtp.aliyun-inc.com; Thu, 11 Jul 2024 13:43:01 +0800 From: Baolin Wang To: akpm@linux-foundation.org, hughd@google.com Cc: willy@infradead.org, david@redhat.com, 21cnbao@gmail.com, ryan.roberts@arm.com, ziy@nvidia.com, ioworker0@gmail.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] Some cleanups for shmem Date: Thu, 11 Jul 2024 13:42:47 +0800 Message-Id: X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5517B14001C X-Stat-Signature: pdi9mrmsxirz56554esuk4kqjj9tiu4i X-HE-Tag: 1720676588-873643 X-HE-Meta: U2FsdGVkX1/lv5Xf3Jf/+YdHC/rxbwFxgEjr7Ob7AtoPMSRfdb5/LFIUm/DtKldTXy5ouVBfQjeXYaWwmSmEgUIKgDWgTfp0Heaw0lAXhdLOfivo3HKZwY6NqAz/M2nR3/PLR2F7tBpcxuybRKTuaQ0Q0r9yW2MauykqXy5QGmoMuSsKGCbIKPzWUwEmxMVDmH/GEq4jUBUsjy1R9AX/QwWq74rlaBXwLHqskfiWqh5Dahx8etAa1NMv3Xav/CeWjkmMb10l5UHnewI+Po8kd9vI8MlQdniATgroNRpZZ85GRSDjXXSWto/PlZNuhUTkemxvtxzJPEFpXI/44WaM6MBdghn8uXms1bkMU+X1aVaH/MPo7CiQjtUhEeTNIZAaQBzkn6B2KQWPpBNLcbY8/hnAKQ8VEQyPrcq+/U8mM8Eq+2RdgXYbnWsr/CUbZnDrcunT7Xpp/6IKbzrDsfPMLnGePiyaqIavFx3yugTxWHjt25IrNicmGl/BX4VrVbMotk2ZrPiCdTkhhK/UL9BshGnFo9SpedIF55/B+4xvJBfc5hvlvNua2T0jGZcTR+lDQCYzU77+8jtpUtUqgsHhlXylIsPYVSv2RXh/1Bg6JIRce8Y6lCt3N/uYEttox1a/dkNrUKAjzfDKO2sodDO0vSU3ruSpt/bTd/43f/Oj2KPdzbLiNNs0ZvrvIiCGYkSt+z8Vxnn2TsBTBycGuC5NzepeFR4SJyHG/0s/Kq+fHwrC2vCdcmPP1ehJS0nmRK2u8rlshi7BuBep86AH3/uHec/GbfKc6684LS4DQEWXntfmKWBMQ3UVkdDjYeG5/6VmENhKtb8T4dC0Qp7gctjLOX2R5/V0hYFFlCbNq6v8vI4MKhv2nRlUnof1BiJjWZzI8/p2MXFXcmNagIqcXHiXoAKvAJFnayKARbxXjkpKyNoTHcfhV9dTyJAdJjCXlwd+iENO2CghrPm2akTJx9u H8tdz3du BB+d0nmm9M80y+yp36pcZo+shWvGVXXiujw2AL3GhoxMLTlH7bvpwaU6hoFCjKe2YfNfEVJbfsqaci/yjdZQfk//PRexiok5GuC8jC156PnnotJmKWqpxZigZECcat2qFgUe7+Lljni+jC/b+2lvpVwGGCd0J7qDktK1ZEl4u94e22jezIo2dtIWL+NQxv+6e6PVuh7gXO/jmiTaoka4CijrCYg== 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: Hi, This series does some cleanups to reuse code, rename functions and simplify logic to make code more clear. No functional changes are expected. Baolin Wang (3): mm: shmem: simplify the suitable huge orders validation for tmpfs mm: shmem: rename shmem_is_huge() to shmem_huge_global_enabled() mm: shmem: move shmem_huge_global_enabled() into shmem_allowable_huge_orders() include/linux/shmem_fs.h | 11 +----- mm/huge_memory.c | 11 ++---- mm/shmem.c | 84 ++++++++++++++++++++-------------------- 3 files changed, 46 insertions(+), 60 deletions(-)