Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp386046iog; Wed, 15 Jun 2022 04:27:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzX00jmyiPoJf+4+Ittkthk/Tja60hZwAwmHaH3HogUFgp+wgo4gk3UfmJ8Zg9inxxqMMc X-Received: by 2002:a17:907:9721:b0:70c:65e7:2aa5 with SMTP id jg33-20020a170907972100b0070c65e72aa5mr8395158ejc.132.1655292426453; Wed, 15 Jun 2022 04:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655292426; cv=none; d=google.com; s=arc-20160816; b=iG/fbswX8pmxo+aNiPbIUjKGk5zy6rl2QNlCnzsh2tH7JGSaAgOfKPK3kIQ+YnilYx q3lzBQ7T2US9yPK3ns8svF2dQfR69YNAEP0YLZGGIBEZ6fxnh+7A5WJ97i19q5TEcW97 sSlk7VXMxClgTuJSOfw+PVC4QqIjEh1E3ATMMY+RiN/uEpdtvqVzhVVRDzy7fBLn+vPF B8koyTsvRaBQum0HUNbmWRtFqSlEEs4DU8aJ8EmkxZO4tPhxtNUCDgPgkAos1UcBElIG FTztTWQi0/0/Hl7OPTOHdzloeohnIfr25ICqb0qtYRgbv2X8Ezt5ZDyui4/KoQtLnuR9 xwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FVOq6VwUFB6uFGq2mjk/V+n5h8ZD55Qbyk92hCokle4=; b=UyATxJnRDEKRL8zgNXm+JVZ/tmr923R1Dst8vdf9OMyCubrRoY5iopQHKLabr/+mBT COfm+bJ4an+Tc0CCKbLZ4XPoKVez8cIUtDVwst59CAXFoLB/CEBvFcnZqFNljcVKneL2 xkDaSUFvdSfneatCCqlrsAOPC82JDHyyJk64nIFgctotl/WL/zPyRa6dbtrFeT8b084A XMsfYaUlppWBsJm5TCxS+dYpgKaL/PAghNhZTgFvmMehxcI1kAtc5+rkHRUI13ArVDlU OoI4G8J5GYPUgMdzKKZJQaDjbzrCvARXyOKeCN3PDHzez+eHItL+K1NVVmjYk6nsUEkP BCTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=x516N7q+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a0564021f0400b0042dd2f3552csi14693737edb.421.2022.06.15.04.26.41; Wed, 15 Jun 2022 04:27:06 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=x516N7q+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344486AbiFOLXD (ORCPT + 99 others); Wed, 15 Jun 2022 07:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345394AbiFOLWx (ORCPT ); Wed, 15 Jun 2022 07:22:53 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFDBDECB for ; Wed, 15 Jun 2022 04:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=FVOq6VwUFB6uFGq2mjk/V+n5h8ZD55Qbyk92hCokle4=; b=x516N7q+S0IoRntqx03R881c4L aUG+uFkvQ2ZlReI5wNvc3O80OwY0bHH/Osdpk+MWHqf7L63nQRiXo2EB1VMhezaoXeiTgFhHWNt3l yXaJIiZxCiccJ2PMKZxsADdC98aBEj9YWBXFPZlVhenBNO1bd/bYR+0KSgRznX/okKIfkjpW4MF/7 glQ64v59zGHQI2ESvlEk8pPQI4RRfnhRl+ExqjqgtKeaDDVcyWDmBXt/ta8YxblMZuthaANolD81f jIZJiqrZdO0GdFNG68XLUjEfeykpZLcoFEtdcO1rsQzWa6AwI6Z9Gduqytf26S9XofgafjQXlpBoE xTElzBnw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1R6Y-00E9Kf-OK; Wed, 15 Jun 2022 11:22:34 +0000 Date: Wed, 15 Jun 2022 04:22:34 -0700 From: Christoph Hellwig To: liubo Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, 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@huawei.com, louhongxiang@huawei.com, linfeilong@huawei.com Subject: Re: [PATCH v2 2/2] mm/swapfile: release swap info when swap device is unpluged Message-ID: References: <20220615070228.2858170-1-liubo254@huawei.com> <20220615070228.2858170-3-liubo254@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220615070228.2858170-3-liubo254@huawei.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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: linux-kernel@vger.kernel.org Sorry, but this is simply broken. We can't just do d_path magic here. That being said the problem is real, and I think the right answer is to offer a swapoff variant that doesn't need to open the underlying device or file, but useѕ some kind of handle. I'm just not sure what would be a good handle here.