From patchwork Thu Sep 15 03:49:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12976807 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 AC70BECAAD8 for ; Thu, 15 Sep 2022 03:16:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 458018D0007; Wed, 14 Sep 2022 23:16:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 406F88D0003; Wed, 14 Sep 2022 23:16:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A7FB8D0007; Wed, 14 Sep 2022 23:16:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1B6C48D0003 for ; Wed, 14 Sep 2022 23:16:22 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E1B1E1C214B for ; Thu, 15 Sep 2022 03:16:21 +0000 (UTC) X-FDA: 79912856562.15.D148647 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf01.hostedemail.com (Postfix) with ESMTP id B6833400A5 for ; Thu, 15 Sep 2022 03:16:19 +0000 (UTC) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSj0Y1twvzNmKD; Thu, 15 Sep 2022 11:11:41 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 11:16:06 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 11:16:06 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v5 1/5] Revert "mm: mark swap_lock and swap_active_head static" Date: Thu, 15 Sep 2022 11:49:59 +0800 Message-ID: <20220915035003.3347466-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220915035003.3347466-1-liushixin2@huawei.com> References: <20220915035003.3347466-1-liushixin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663211781; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ysb6lrI5RZOlgACFnqJEsH8gquEOGQoKh0o5Ep3eycA=; b=IFf5M0oNjkk0JF6elNQGXUbB/m4qGbkOQLzjUHl+IVURE/uBL8UzJOCUklSGr2pKifWsGs XzlVY6uhy8uqoVB/MJKwug3agEVvIlRHC9VN+XUMt6Dv+3fdGt18NQSM/0fiRmFjSbziqn Kqp0HxVU2Yp48lEqhq1hCPgdLvktGrM= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663211781; a=rsa-sha256; cv=none; b=DpNUU37w5M5mIg1n5r2BAXFWsChFOB9SHDphfBWOui7XA8VqtB9zVJljqXnaNpwWWfCDxD ykNC1Ijvdxjcfr410C4qzFsB2W5Lz9p64wofm+6a4yJgNMKY7mUT/f3fGpsxbXTsJzQcqu 2kE+g+1+HSxUiEt0eipof9LrkJqouvY= Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Stat-Signature: dbsykr3i74cgiuah83hgbdfag38eawci X-Rspamd-Queue-Id: B6833400A5 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1663211779-892635 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: This reverts commit 633423a09cb5cfe61438283e1ce49c23cf4a0611. swap_lock and swap_active_head will be used in next patch, so export it again. Signed-off-by: Liu Shixin --- include/linux/swapfile.h | 2 ++ mm/swapfile.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/swapfile.h b/include/linux/swapfile.h index 7ed529a77c5b..a2540b8396e2 100644 --- a/include/linux/swapfile.h +++ b/include/linux/swapfile.h @@ -6,6 +6,8 @@ * these were static in swapfile.c but frontswap.c needs them and we don't * want to expose them to the dozens of source files that include swap.h */ +extern spinlock_t swap_lock; +extern struct plist_head swap_active_head; extern struct swap_info_struct *swap_info[]; extern unsigned long generic_max_swapfile_size(void); unsigned long arch_max_swapfile_size(void); diff --git a/mm/swapfile.c b/mm/swapfile.c index 4efcfe34e45b..6cdb34c01dd3 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -51,7 +51,7 @@ static bool swap_count_continued(struct swap_info_struct *, pgoff_t, unsigned char); static void free_swap_count_continuations(struct swap_info_struct *); -static DEFINE_SPINLOCK(swap_lock); +DEFINE_SPINLOCK(swap_lock); static unsigned int nr_swapfiles; atomic_long_t nr_swap_pages; /* @@ -77,7 +77,7 @@ static const char Unused_offset[] = "Unused swap offset entry "; * all active swap_info_structs * protected with swap_lock, and ordered by priority. */ -static PLIST_HEAD(swap_active_head); +PLIST_HEAD(swap_active_head); /* * all available (active, not full) swap_info_structs