Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2663754pxb; Tue, 9 Mar 2021 08:01:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9Sm6LP9TbGe+nEkP59VtsaSM/HjNE2fPWCABBZlb2pK2UxwalCIlB1X3BRekEjWHgyO/g X-Received: by 2002:a05:6402:26c9:: with SMTP id x9mr4818011edd.322.1615305665776; Tue, 09 Mar 2021 08:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615305665; cv=none; d=google.com; s=arc-20160816; b=aPb3Lm2bHMubVAweZTfO4W2jiHxdJ9YyFM88ipbrQVoVUREjajDO3Hqvr2CRMa3tpy /i8rt+DSHkKS/LAAalFpheLTsjXg+ffY/jpVkqFYv59D/cLAUH+PCjEbuQzzzdZ3fGNI UplHKshsgTncFVX3BK17MXdj9ITz2NcsrSH6FS/1HCLGSJokqicQ2ZaSNEYVs4ITnNCz KmTjQ5GIh1vVNxXmQuD+lw6FeptIag/ua9IvP2KJxKGCGHBM7NJIC57xrigFf9XTxYoG a470wxK25GEzn7mL56vaaXHI0O8IrkmFdgBn7uaaGB/4KMFOKdri1GSx5Cr4sry8MZea ezKQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=81oGSCBl39iypfLV/NoPk/fT5YyYJiKMaMVaZJIwgrQ=; b=k/hn8QgFlpBuB0xZSf/EFOOKHof1GLMHWOTQXQ1SzHk7Sl8GK4Mg9iSLa5IrARNHXR CX7mwk34qJzJQqf8gHZRA9yRDZUAy14IC+1eQ57m4WyuXr0egk3kcnB4q9GgIuY6y/sF uVQTlXCF34Rb4PTvEf0JOub/7peSfvSeC1uCJp4S+rrULwBtg+Yr3FIpJHiIxKAdAagt NlzOV7E0ENLWYZHUxjG4LrWDm9Xpsr9A08WDkxjlzxLDCDrJmSJqC4AvsWR2gZ7OYF8b yHrHzz0mgZcjg6bJF+RBnIRT5TeyFOhWPP79si9Sc4+E7YbwFVTGmxRM8mi4lVLvq4zK L/mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=K1zd0jFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si9246401eji.385.2021.03.09.08.00.43; Tue, 09 Mar 2021 08:01:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=K1zd0jFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbhCIP5Z (ORCPT + 99 others); Tue, 9 Mar 2021 10:57:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbhCIP44 (ORCPT ); Tue, 9 Mar 2021 10:56:56 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A364CC061761; Tue, 9 Mar 2021 07:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=81oGSCBl39iypfLV/NoPk/fT5YyYJiKMaMVaZJIwgrQ=; b=K1zd0jFpZYL+ZtHkLHvgFqVo3p h0n1mVJ6xBDYsmZ2ahXvorBLK+B3nIqdp9SBF8EG/bXS+IsljPrtJK2g37AP4qDeVxiqHM/RZXx3q S2CEFcUd8C43qdjZ+9VdgqfeVWq56HoefjzfpaWwnPCvcAjOqJar1KuO0CyEqdbCe8ML70nAYFfua VPC6vyaOhGWsaj+cksNDgySPdh8+mPTd/DfGakuL9yseLjJeQfIk/7NZVe94BnW2qbyUlG2+FyHwZ uFSZK8ZEBs8Qdk6n8xtOgSm5GaHD9TgoqPuqa4IUBK0F1IiHVfJUGU91yPDMhg29RGnXUdHnRmOAs sVy5rRLQ==; Received: from [2001:4bb8:180:9884:c70:4a89:bc61:3] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lJeiQ-000lYx-7J; Tue, 09 Mar 2021 15:56:11 +0000 From: Christoph Hellwig To: Al Viro Cc: Andrew Morton , Daniel Vetter , Nadav Amit , "VMware, Inc." , "Michael S. Tsirkin" , David Hildenbrand , Minchan Kim , Nitin Gupta , Jason Gunthorpe , Alex Williamson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 9/9] zsmalloc: remove the zsmalloc file system Date: Tue, 9 Mar 2021 16:53:48 +0100 Message-Id: <20210309155348.974875-10-hch@lst.de> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210309155348.974875-1-hch@lst.de> References: <20210309155348.974875-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- mm/zsmalloc.c | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a6449a2ad861de..a7d2f471935447 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -176,10 +177,6 @@ struct zs_size_stat { static struct dentry *zs_stat_root; #endif -#ifdef CONFIG_COMPACTION -static struct vfsmount *zsmalloc_mnt; -#endif - /* * We assign a page to ZS_ALMOST_EMPTY fullness group when: * n <= N / f, where @@ -308,8 +305,6 @@ static void kick_deferred_free(struct zs_pool *pool); static void init_deferred_free(struct zs_pool *pool); static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage); #else -static int zsmalloc_mount(void) { return 0; } -static void zsmalloc_unmount(void) {} static int zs_register_migration(struct zs_pool *pool) { return 0; } static void zs_unregister_migration(struct zs_pool *pool) {} static void migrate_lock_init(struct zspage *zspage) {} @@ -1751,33 +1746,6 @@ static void lock_zspage(struct zspage *zspage) } while ((page = get_next_page(page)) != NULL); } -static int zs_init_fs_context(struct fs_context *fc) -{ - return init_pseudo(fc, ZSMALLOC_MAGIC) ? 0 : -ENOMEM; -} - -static struct file_system_type zsmalloc_fs = { - .name = "zsmalloc", - .init_fs_context = zs_init_fs_context, - .kill_sb = kill_anon_super, -}; - -static int zsmalloc_mount(void) -{ - int ret = 0; - - zsmalloc_mnt = kern_mount(&zsmalloc_fs); - if (IS_ERR(zsmalloc_mnt)) - ret = PTR_ERR(zsmalloc_mnt); - - return ret; -} - -static void zsmalloc_unmount(void) -{ - kern_unmount(zsmalloc_mnt); -} - static void migrate_lock_init(struct zspage *zspage) { rwlock_init(&zspage->lock); @@ -2086,7 +2054,7 @@ static const struct address_space_operations zsmalloc_aops = { static int zs_register_migration(struct zs_pool *pool) { - pool->inode = alloc_anon_inode_sb(zsmalloc_mnt->mnt_sb); + pool->inode = alloc_anon_inode(); if (IS_ERR(pool->inode)) { pool->inode = NULL; return 1; @@ -2506,14 +2474,10 @@ static int __init zs_init(void) { int ret; - ret = zsmalloc_mount(); - if (ret) - goto out; - ret = cpuhp_setup_state(CPUHP_MM_ZS_PREPARE, "mm/zsmalloc:prepare", zs_cpu_prepare, zs_cpu_dead); if (ret) - goto hp_setup_fail; + return ret; #ifdef CONFIG_ZPOOL zpool_register_driver(&zs_zpool_driver); @@ -2522,11 +2486,6 @@ static int __init zs_init(void) zs_stat_init(); return 0; - -hp_setup_fail: - zsmalloc_unmount(); -out: - return ret; } static void __exit zs_exit(void) @@ -2534,7 +2493,6 @@ static void __exit zs_exit(void) #ifdef CONFIG_ZPOOL zpool_unregister_driver(&zs_zpool_driver); #endif - zsmalloc_unmount(); cpuhp_remove_state(CPUHP_MM_ZS_PREPARE); zs_stat_exit(); -- 2.30.1