From patchwork Wed Jun 15 07:02:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 12881868 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 D3701C433EF for ; Wed, 15 Jun 2022 07:02:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C6096B0071; Wed, 15 Jun 2022 03:02:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 375C56B0072; Wed, 15 Jun 2022 03:02:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 264AF6B0073; Wed, 15 Jun 2022 03:02:21 -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 189226B0071 for ; Wed, 15 Jun 2022 03:02:21 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id C50B5612E3 for ; Wed, 15 Jun 2022 07:02:20 +0000 (UTC) X-FDA: 79579576440.08.6AF4FCA Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id EFE2C40097 for ; Wed, 15 Jun 2022 07:02:19 +0000 (UTC) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LNGRK1pKfzjY4B; Wed, 15 Jun 2022 15:00:45 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 15 Jun 2022 15:02:15 +0800 Received: from huawei.com (10.175.124.27) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 15 Jun 2022 15:02:14 +0800 From: liubo To: , , CC: , , , , , , , , , , , Subject: [PATCH v2 0/2] mm/swapfile: release swap info when swap device is unpluged Date: Wed, 15 Jun 2022 15:02:26 +0800 Message-ID: <20220615070228.2858170-1-liubo254@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655276540; 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: references; bh=hmpo+doqV8fjl/7IyeUKO7SvD2EkbS6hURjboKLFCxE=; b=ViXnvlWgRK5EWczmAmEUwjv8ZE5Q6b0fRY08JdhJ7PDKORLA11jooctS7w9WWiMg1VoV8N ep/3ELXTZaG3px44jLvvYm1k/MMjP63L6ftcil1Q0UqJztdEbjnDwPiki3+Nk0XauxllTL B4tTVrle5zTTb2PnXOHCVBewCkhOhk8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of liubo254@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liubo254@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655276540; a=rsa-sha256; cv=none; b=bmTgdppIvea5KOb4b7VSoAkUhig7f4BZsj2TpgvwKO03LP77ac51BI7pk72og9QDRWHmfF rvuaED1Jc2vF2bg3dYkohIjGJkDmYYIDp7E02K5rP4YSPuLCIpqspPBiIaeY+rLg4D2B3a TbbaeKhEc8tBfo+J/78HWYYUcKuVVgQ= X-Stat-Signature: 6cq7zgezao6fgahawpubz7zp75ixyqzu X-Rspamd-Queue-Id: EFE2C40097 X-Rspam-User: X-Rspamd-Server: rspam05 Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of liubo254@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liubo254@huawei.com X-HE-Tag: 1655276539-200957 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 series patch try to fix the problem that the resources corresponding to swap are not effectively released when the swap partition disk is hot-pluged. 1/2: Extract operations of resource release in the swapoff process. 2/2: release swap info when swap device is unpluged This is a second version, which addressed some comments: 1. turn first patch into a two patch series. The first does the code movement with no functional changes and the second does the actual fix. --- For v1, see: https://lore.kernel.org/linux-mm/20220528084941.28391-1-liubo254@huawei.com/ --- liubo (2): mm/swapfile: Extract operations of resource release in the swapoff process mm/swapfile: release swap info when swap device is unpluged mm/swapfile.c | 261 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 183 insertions(+), 78 deletions(-)