From patchwork Sun Nov 19 19:47:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13460678 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 21C16C54FB9 for ; Sun, 19 Nov 2023 19:49:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A14DB6B03D0; Sun, 19 Nov 2023 14:49:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C3546B03D6; Sun, 19 Nov 2023 14:49:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83A9B6B03D9; Sun, 19 Nov 2023 14:49:16 -0500 (EST) 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 6FF926B03D0 for ; Sun, 19 Nov 2023 14:49:16 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 532E6402B1 for ; Sun, 19 Nov 2023 19:49:16 +0000 (UTC) X-FDA: 81475742712.02.121FA08 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by imf27.hostedemail.com (Postfix) with ESMTP id 85AE940007 for ; Sun, 19 Nov 2023 19:49:14 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FKQZVLaK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700423354; h=from:from:sender:reply-to: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:in-reply-to:references:references:dkim-signature; bh=YaE/AcfmvaBX4nhUPBOl45o2uIqec3EidHpbbgh18/A=; b=yn+nLvz/w9/E2niAlamSCHZAL0crKELwPIkBQrY3jsUP1AG4MbTi3gHfQirwJRdtPNifSW 6+XyZ1Lm+tBzOsaiTj5Hyv1aYCRUzr3MsZowSrd47RuksPc5PPo84VLwk2igWtYTCqNoRY //9zm1ujK2zW7QohG5Q9sb7erox4XF4= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FKQZVLaK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700423354; a=rsa-sha256; cv=none; b=SgH6mAK0CilR+7xbNY0ZAfyA0bsI2LfytP4il1dgSD9VKi0G1jc4HUNsZQ54vw8+mFr2xk grA9DftLT4S1BWEBWqKdbRAouzePnQf8yMuY2agSSBx8NolZKU2tx65Fv0fEEVKYVBKu/X bSCw3xEvu4JMJJPoIFAHxXodc+wDZDc= Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7a93b7fedc8so175649839f.1 for ; Sun, 19 Nov 2023 11:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700423352; x=1701028152; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=YaE/AcfmvaBX4nhUPBOl45o2uIqec3EidHpbbgh18/A=; b=FKQZVLaK/oKhjU/S14i0v+1cZp9875AFtVsHou0w/ui+wDkCViFxVtlXVrSbtsF55K AxhXTqybFNcRpiE7WNRw4dBePek/qiZKAj29srPRfhNl2nnfORPvRtutmCkPoM0GC8Gx lA1OwcJ8v84J+fQP1jXcjvav7iKv3XBNA2j/Y3Q4Spa2ngZ/Muis4jgm/GDCOFkmvZu6 ccnXvKarCeVXH39oP87jyGDYpSVfWMfjRRiRhQwKkKF4kAsv9j0VH1VaKXbbmS/NH8QR QNOvgptDYzNDwOjlgla5Uki4s/AUbUjYyadCY9agC8FZsyU9OhK+hfeWB9jizZUlIfb2 Xcvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700423352; x=1701028152; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YaE/AcfmvaBX4nhUPBOl45o2uIqec3EidHpbbgh18/A=; b=VUXnG8DlkHbjFdACHys/nZCslgJnwzLV3k3kB0zP/3VXfAb/ug1c5AzCWMwFWIqv1m JW02+iK1aPdADikq6tE8EmDhzJLN6KbmW8lVKDASFI262DvIUeabpa5mNf6i4q3cehe5 MGnLuWSlFezUZ5J7TMgUKMnNXJnzY1+gp3P+YCgVYiYgn4CwlhCPMK7cx+VbRmufVtUY 151rPBteabkkasLQfntisgLooi3WR/+dQ9Eucx5UzyIJ6/m/TJqpzJbbP31O181LhhMb GDi3V8P3MT5HoFkJm7Uw5pb+OkX/YKlh8BOxhAbzvkxKdspmS7oNgMRMJXjylkcopYEY uyrQ== X-Gm-Message-State: AOJu0Yw31o6BjBqm4/0qut7yLxE9BzfDgksGpZVgU5zVxGWlO+6gfGpO BdObyBNtxoYCYoQT35EbX3aXHWl3Aev6oUL0 X-Google-Smtp-Source: AGHT+IGe3yrZIEULCUKtOSeAd+ADt5bek5FOv3ZnPoX4w0FfFxyEh6EumJmpzCHvfJdKyxdaJe+uQA== X-Received: by 2002:a05:6e02:2607:b0:35a:fae1:1358 with SMTP id by7-20020a056e02260700b0035afae11358mr5301806ilb.12.1700423352719; Sun, 19 Nov 2023 11:49:12 -0800 (PST) Received: from KASONG-MB2.tencent.com ([115.171.40.79]) by smtp.gmail.com with ESMTPSA id a6-20020aa78646000000b006cb7feae74fsm1237140pfo.164.2023.11.19.11.49.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Nov 2023 11:49:12 -0800 (PST) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , "Huang, Ying" , David Hildenbrand , Hugh Dickins , Johannes Weiner , Matthew Wilcox , Michal Hocko , linux-kernel@vger.kernel.org, Kairui Song Subject: [PATCH 22/24] swap: make swap_cluster_readahead static Date: Mon, 20 Nov 2023 03:47:38 +0800 Message-ID: <20231119194740.94101-23-ryncsn@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119194740.94101-1-ryncsn@gmail.com> References: <20231119194740.94101-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 7exkp63x3nomxa7xt1ai3dnm161iis9r X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 85AE940007 X-HE-Tag: 1700423354-692890 X-HE-Meta: U2FsdGVkX1/SaNGMixtSr4sbPzlJLMFoGcWOCywNwBoD0hyfuDdNJQCytgW0JD9FiqEkCYPvXIS+yneypTF8JSX4i2K4yBnNtnIouSg8uWnIneH92GQxgz06w6/77hEgLlPIrcgvN+Pbu2IHe8oGgkN886uKEWhQKDTDwgMadAlL+3P/bnW07eFWEeN+6VwYsWTqNiTs8ZRpSkghehlJajfNPSot5M+GeiAqsVshtHzh47ORkgB14TsVUffqEyPiMkYlfd/3cPnix9/yeSCe2U4x0fM0XCtAChl6B7nGuMTnwiWYVcSmdfKS2jAIWvRhywUAprAZiMb54hCH8OrpFNtI45y3UFexUS0IQ1T+/qV799Z8/NIHlkz1h7VzaIKfbwCTqB5dXtQgoV9fa9PZJfm6QFi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ZgQX4hNctCoZmxXjAmUC23agTvAFZcHOSBSamYtRoDJZsXCjpKD4iTHVSUPLW/jGyDiw8enOblqLabv4kSobjxEI03/CzcnalFo6OML7QzM1Ll66fNRB27zqfv6i/pnPlOKF2haaU8kXXd0ARZgrWL2g78iicJ+dr6KrvsTVGlHEsqzJac= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Kairui Song Now there is no caller outside the same file, make it static. Signed-off-by: Kairui Song --- mm/swap.h | 8 -------- mm/swap_state.c | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/mm/swap.h b/mm/swap.h index 4402970547e7..795a25df87da 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -56,8 +56,6 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, struct mempolicy *mpol, pgoff_t ilx, bool *new_page_allocated); -struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t flag, - struct mempolicy *mpol, pgoff_t ilx); struct page *swapin_readahead(swp_entry_t entry, gfp_t flag, struct vm_fault *vmf, enum swap_cache_result *result); struct page *swapin_page_non_fault(swp_entry_t entry, gfp_t gfp_mask, @@ -93,12 +91,6 @@ static inline void show_swap_cache_info(void) { } -static inline struct page *swap_cluster_readahead(swp_entry_t entry, - gfp_t gfp_mask, struct mempolicy *mpol, pgoff_t ilx) -{ - return NULL; -} - static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, struct vm_fault *vmf, enum swap_cache_result *result) { diff --git a/mm/swap_state.c b/mm/swap_state.c index 0433a2586c6d..b377e55cb850 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -627,8 +627,8 @@ static unsigned long swapin_nr_pages(unsigned long offset) * are used for every page of the readahead: neighbouring pages on swap * are fairly likely to have been swapped out from the same node. */ -struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, - struct mempolicy *mpol, pgoff_t ilx) +static struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, + struct mempolicy *mpol, pgoff_t ilx) { struct page *page; unsigned long entry_offset = swp_offset(entry);