Message ID | 20231119194740.94101-23-ryncsn@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1810276vqn; Sun, 19 Nov 2023 11:50:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo95CYm+MxlfZM5AnHupl9wzlZ1fTmrlPlCC4aQrJxJepGE/tCVP/Vm/heTIyJzCRu2HxF X-Received: by 2002:a05:6808:211c:b0:3b5:656b:f962 with SMTP id r28-20020a056808211c00b003b5656bf962mr8654230oiw.5.1700423446174; Sun, 19 Nov 2023 11:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700423446; cv=none; d=google.com; s=arc-20160816; b=e8Qsb5irFICjGFiISDJm2HKx8KAjoXd65O+2SoGJxEfREMZhDuBsEympLN6F7jF5mv a3r+tBSSUBH85UfkZzaL/MsbkyTRIH9GjCWI87nWVguOAqMTodTTWQ3QAh7P7W7w95Zb /8Jt5a23kVCIknruAYqrbohOrfRfakOG+P8JIaaJEcGaAyKC1iQVzTVsVWL/ndgLh3PE kkJt9i+3E6+Zfzgmh7HHKhvFceuLt+kNjX7JPC0rPh8P4ArkAmbNjozQRlM+RAi68IOv UOujRE0ye2LtcZaeteYvhhbdZU9jXvNb9wRxJPoqj/ErXLI10UjbcL4fR16GcehtZ7a5 BFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YaE/AcfmvaBX4nhUPBOl45o2uIqec3EidHpbbgh18/A=; fh=4HE/piJoUCKuBTCCBiej4//zvvzywHdOLL9QM/KYjYM=; b=XhV8xWANgfh7LFeCRij57W8WcMwarfaJmfVVesoSihQCvZ7PFMVetLieP8DoMhsFdM mnTadpYKaOrQdmA8KRAHWZQfOcXkhnD4tV9NBtXBFm9RnZ7iA/R6vPT/BcilS3/Ykhjy 4kugTATS6VL+KnZBgUZdm+szVsqyrERmskfQH45FydSTzNkDIlmQ96TjeOgyFfbw37pr xGslHFpAiqy7aFtT7LZlKu/tA3j4XjC8iFcBAUGbU7GAwrW+fruoM3Vdts42248VROZs 7PY6Tw30oRwk0hTcVDcQ5V4pqpB0UEMx2nxX+p2U8v9FTPgVc9UGYr43egrFopn2YzL3 MxGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GMgAGHAG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e32-20020a631e20000000b005bde6fae09asi6293707pge.135.2023.11.19.11.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 11:50:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GMgAGHAG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8377280C8D4B; Sun, 19 Nov 2023 11:50:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbjKSTuY (ORCPT <rfc822;jaysivo@gmail.com> + 29 others); Sun, 19 Nov 2023 14:50:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231800AbjKSTt4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Nov 2023 14:49:56 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB8EE1FC3 for <linux-kernel@vger.kernel.org>; Sun, 19 Nov 2023 11:49:13 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7a6774da682so175596139f.3 for <linux-kernel@vger.kernel.org>; Sun, 19 Nov 2023 11:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700423352; x=1701028152; darn=vger.kernel.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=GMgAGHAGjIC3Ddy0feaX8VCRlLMutjNTDBX5rAcWdVC/FdX7vDfmOhxlW98XyoqPxM Mgw8BRbJ+gnw6un1cyxgndjsRWrHGR22bFefYaRmUIIIZBKYCO5HkcUcZN/mS3xmH/u2 TVHnUCPjFhKhfdy4CUfOhSTO7r0KOV7fAjbIbR/gkU+/OU2V1EGcCgnx+/MDwjL2azmD pqlxjlMOoIZnN9mcj9iOsXEWo21ezWM08nYbHt2iUnVCtJd5odLzC2wiRo27iyGVH2mc xH85SpjFZtJqOzFdAuMf1R0mDN7hE/LB0iYvnLWE1hZcwZ0pIRbp7G5/zGDuNCYrz/nr KJHg== 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=MkREllb1Kik/odG9IqVmVxUSa1FOjqfID1SnORrScy44i4Xek/3RiGwFfJS0akUj0L 7bQ8cuPycHr3Dwva8vBLOSRJUftCuAsAiaBfPiN0nLWaavfpPauuPK0W/X+SRwIFFEYy 4cna5UJ7UlqwRig2iKk9Z6JbAS5bTJhFkib7ww0TCFPdBzRIMHv4cuQ+orfJK9Vo/1F8 TltlHM9RIt1+ff8yWX10E06CZny8nVnXL0NDHIBKVgiUqQXOTvJ+LbEUS3PGLRPsKemj YdNMXqCUnlqKOG9hUhRLSGUIsaYKWuY+wObJkWfpA2k+ejaRiMAEQgfr1vkcXElmRg3S T2Wg== X-Gm-Message-State: AOJu0YzweVJ338LxHOPIjB0HxjksYt7n6B5jcp172vhrL42BaCNoHdIR nqIsX7XZpjV9Mz7gShRarPc= 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 <ryncsn@gmail.com> To: linux-mm@kvack.org Cc: Andrew Morton <akpm@linux-foundation.org>, "Huang, Ying" <ying.huang@intel.com>, David Hildenbrand <david@redhat.com>, Hugh Dickins <hughd@google.com>, Johannes Weiner <hannes@cmpxchg.org>, Matthew Wilcox <willy@infradead.org>, Michal Hocko <mhocko@suse.com>, linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com> 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 <kasong@tencent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 11:50:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783023215739573052 X-GMAIL-MSGID: 1783023215739573052 |
Series |
Swapin path refactor for optimization and bugfix
|
|
Commit Message
Kairui Song
Nov. 19, 2023, 7:47 p.m. UTC
From: Kairui Song <kasong@tencent.com> Now there is no caller outside the same file, make it static. Signed-off-by: Kairui Song <kasong@tencent.com> --- mm/swap.h | 8 -------- mm/swap_state.c | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-)
Comments
Hi Kairui, On Sun, Nov 19, 2023 at 11:49 AM Kairui Song <ryncsn@gmail.com> wrote: > > From: Kairui Song <kasong@tencent.com> > > Now there is no caller outside the same file, make it static. Seems to me too trivial/low value to justify as a standalone patch. Chris > > Signed-off-by: Kairui Song <kasong@tencent.com> > --- > 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); > -- > 2.42.0 > >
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);