From patchwork Sat Jul 13 13:24:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13732408 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 4FE6CC3DA42 for ; Sat, 13 Jul 2024 13:24:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79DCD6B0092; Sat, 13 Jul 2024 09:24:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 723F86B0088; Sat, 13 Jul 2024 09:24:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ECAD6B008C; Sat, 13 Jul 2024 09:24:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 398576B0083 for ; Sat, 13 Jul 2024 09:24:40 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D5C08160F63 for ; Sat, 13 Jul 2024 13:24:39 +0000 (UTC) X-FDA: 82334799078.05.4E0BF2B Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 11281180014 for ; Sat, 13 Jul 2024 13:24:33 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=SyY9v3rC; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf06.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.124 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720877049; a=rsa-sha256; cv=none; b=IE/5RYCJ0jPbGuI5MMLRQ6HI5ODlRUazhtEVGh5hh5fsJ2jb5PrU1RygTGGyYSlnWO52Ne AdKaWuDKIzdzuUO8+dFvZ79vC2AaeAhDRT7otcDAUAOQJJHCFw4p8ADY4r5afu79789k3O k4MyOQvuzjkOR12gUfRoBPXZSWgn6a4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=SyY9v3rC; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf06.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.124 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720877049; 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=ytypz4bqlRLBeOb2hk6wBu/fHjDnyJ0xf/5Zkw4In5c=; b=kU4XfA0Deu+2IsiESTSl92VhQxrv9LEz1Up8b/+/0ssBO/eqHz0zMXoMC/eVqH8B5j9edq zmp0xNS031NtAqsHWoMHu+YPp5ukePkunPT0AQuZ2PMzmxLtM+aQhxv9Wrdoq3fQZnikbm 1imWw5J21srqeeIWG3rKoOK9FeQ7Www= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1720877070; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=ytypz4bqlRLBeOb2hk6wBu/fHjDnyJ0xf/5Zkw4In5c=; b=SyY9v3rC8zEkbGTdAPYgVAT2R8mI+Lkc6nHisNZ0Aoph4xEZnSner+hhhjdf38YedyjUUH4a7G1vUkixn2HwIslWKACbnbmCbRFIJByZkz7UBhJwxZBloqW2uk1c2PKnW7bhdqiGIt+ZWX5XFoBRqd7lvRL+jDKIa87F1p0sQsQ= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067112;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0WAR0qGo_1720877067; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WAR0qGo_1720877067) by smtp.aliyun-inc.com; Sat, 13 Jul 2024 21:24:28 +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 v2 0/3] Some cleanups for shmem Date: Sat, 13 Jul 2024 21:24:19 +0800 Message-Id: X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 11281180014 X-Stat-Signature: f844csdezen75r1oji8noz9dux7o9j5h X-Rspam-User: X-HE-Tag: 1720877073-483484 X-HE-Meta: U2FsdGVkX18Segq6JWla9Tgyf12GMqaq/+yg0cA1ZBCV/Tq+V/RA7ff7P7XNxTVqPJnFxenFcbvQIV8+2IuYHT769ijeE8rFgU1i+PtuRfNhnLctOEBFoIaks1+7Z/qED1oBnjKPOnpe/Jt7oUnFLt/iy9JOQBvRrs2mnWBcgGhO97yktjkz0R34j675shWLouF+dC09VOXjpsQjmAeY5poVEULBxD6JA28gJesZxj3vdbQnvmdYHFE3UZDaOnLm2z2A9n7zNjXJYA+1Nlea6QVWbOAx1pOD3d5V/pTvas9R9fs7l7bI5q4dtepLW7l8MZa8uTWt01bq5CcsnwAUTOi235eJakTGeRDbSPlI3WSHH4TML+6HEM1KCD+lRTH3Ki6fWtqDR4EUgghk/Yw7N+jzWzBYbMziArfK5Qto75cKSl/GRqg0Np2X+iJ8APQgxCNc+9xIHA5M6R06KiHPax6aqUVQ6kw1kwBJZiS11ka+8wYL6nDjgl7x56e/KGsaDIWkNHRr7qWXzaiVUb/AN1o0tI2J1WIIApMcMud2w1Gs2e9hCNWh2QbIM5jdo3xZkxmWeGGVTShdl/d7bMT4PIizuRYbLoS5x1llKAKnsG0yenpWBSPiYqMVFHviM/50pwcW3UFIGjhdK5RgC+pSGlxxq0Tp1prrTLUwdrD86ahTZf1LOat3iNuEPzhnTsoc/hSNqnYZlK/h1qGtV5tCe3VJTuMEduYgW78TsRHpH7TF+Id9mw2ukw7+aBtRZF7YQFh8d8gfbDEHKDZpgGeGs0b33KbKlUgUBNFJu6OaqDRq1QAXnmBIKruTgJ+KZCrNhkbnIfrTMPrjyqSApQyY7/5vLks75vgosBIN6SoVJGSBpKSiljVEYaBY+IoYMmLrPtCQAAwmvgjHwyldyjM8UiY0v496bK8n6yn/5s8IJMU9hmPlm7kqUFLJ4LHxS//LTlHuviJSa6CFSNvnFqm 3+FEoIjV hErIda3nl7VyEoN/X4Npx+bcLgS7RSqc5tYuC9rblfJ0wub2xbZBJZVqNWQHnmwX8t10XDY+YvUWKFQYdhMNfR5ZFf2X0h+rvqsI5LITjeKDkEa5oqs6ulZTlvMoF8aCDZeF8iJMGpA5KhXYjtlpCAG/GhgXky7JgV4u4LVm9EIGKM40= 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. Changes from v1: - Add a dummy function in case CONFIG_TRANSPARENT_HUGEPAGE is not enabled, which fixes a building error reported by kernel test robot. 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 | 91 +++++++++++++++++++++------------------- 3 files changed, 53 insertions(+), 60 deletions(-)