Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4483075ioo; Tue, 31 May 2022 05:34:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgYj8FhIcCPmVtb5bjiAqudqGo9MWSrAF4QnZKez7EysCboIm9dRPYnTixQ1WfIGVvRad1 X-Received: by 2002:a05:6a00:c84:b0:518:e0f6:f1af with SMTP id a4-20020a056a000c8400b00518e0f6f1afmr32899372pfv.47.1654000499361; Tue, 31 May 2022 05:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654000499; cv=none; d=google.com; s=arc-20160816; b=aotZ81bSQkvQ9UCLFEiaBtKvyOg5BzASOQObnHwjpiisZ9OtHiCrEHDNlJTkw7gHcc MpuH7OzEltKKA9BIVnBjE62+gc1RJL9twE/2r7/d51JzWqsM0JeFjTo9k4hYFj7Tq/RD w5nNBVqNFpS5aOYn1LOk3G7XPUmsJu8PzDot5p+Sl0dPaySf62s+pHRJH4imGjczx9lU e6OALVkOcHiqxNtQXfoSkWVegB36JflFki6GLGxgEUTtRb4DUuHeg+vhmtCzeXNxeadi QMTLw8Pj9yIJDa4HrEhS/18+HtPTjowdcMSibB8ctXAfd1Un1EDpOaJNt8feDjryVwjH S6Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=tIH6N4n3vEumh74JYuyahAhOwPsDKtlSQbSYCv2m5eg=; b=0ZzZGPfJ0Ip04dNCeXEi75dLXABY1oTlPjDwW8LlXRQUHAtDZxP1e1WEmosOFa5I1v Su/VnFAqSx0bQKxbEITEJv5XRYH4/tKn9+/YRqg8AQ3RIsOqqHx9TR4OuuSI2C6bmcDZ Uo/UJg3AUQnv8lokVtcb9ftxyUAIFG0m4ZWGs7ig1uNnPloBi9m9IUlFVhXKtvasZBPS yCCW268RQBZd5sM5fIVn0sN1UnCam/ZnirGqcC+vK8sGi58xW3tvkgSOXvYicwpwoX+u zmRE5Lm3sEpfqautfK54p/LSzbzSZXWNGLhiIjWZR18y/48+qhhlC4ib2dfOE84zIkUL AuRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a1709029b9200b00153b2d16619si17291271plp.545.2022.05.31.05.34.45; Tue, 31 May 2022 05:34:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236278AbiE3NA3 (ORCPT + 99 others); Mon, 30 May 2022 09:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbiE3NA2 (ORCPT ); Mon, 30 May 2022 09:00:28 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8AD6BFDE for ; Mon, 30 May 2022 06:00:27 -0700 (PDT) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LBb7q47NjzgYJF; Mon, 30 May 2022 20:58:47 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 30 May 2022 21:00:24 +0800 Received: from kwepemm600016.china.huawei.com ([7.193.23.20]) by kwepemm600016.china.huawei.com ([7.193.23.20]) with mapi id 15.01.2375.024; Mon, 30 May 2022 21:00:24 +0800 From: "liubo (AW)" To: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" CC: "ying.huang@intel.com" , "willy@infradead.org" , "vbabka@suse.cz" , "surenb@google.com" , "peterx@redhat.com" , "neilb@suse.de" , "naoya.horiguchi@nec.com" , "minchan@kernel.org" , linmiaohe , Louhongxiang , linfeilong Subject: =?utf-8?B?562U5aSNOiBbUEFUQ0hdIG1tL3N3YXBmaWxlOiByZWxlYXNlIHN3YXAgaW5m?= =?utf-8?Q?o_when_swap_device_is_unpluged?= Thread-Topic: [PATCH] mm/swapfile: release swap info when swap device is unpluged Thread-Index: AQHYcm/S8I4jercSlEysmKi3QX0FCa03ZWgg Date: Mon, 30 May 2022 13:00:24 +0000 Message-ID: <80d54ab2864e4011a9f5e5b198ccfe8e@huawei.com> References: <20220528084941.28391-1-liubo254@huawei.com> In-Reply-To: <20220528084941.28391-1-liubo254@huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.177.130] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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: X-Mailing-List: lin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