From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25A3DC433E0 for ; Tue, 9 Mar 2021 16:29:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9C7865238 for ; Tue, 9 Mar 2021 16:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9C7865238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4F3138D0113; Tue, 9 Mar 2021 11:29:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A22D8D007F; Tue, 9 Mar 2021 11:29:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31C6D8D0113; Tue, 9 Mar 2021 11:29:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 12DFA8D007F for ; Tue, 9 Mar 2021 11:29:34 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C7EF1181AEF3C for ; Tue, 9 Mar 2021 16:29:33 +0000 (UTC) X-FDA: 77900871426.18.55CBC9B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf14.hostedemail.com (Postfix) with ESMTP id E234FC001C73 for ; Tue, 9 Mar 2021 16:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615307362; h=from:from: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=uSaGyOLWX+NEWKQMtAmx6cE0h7h+IwRRgb4ZBbKVgjA=; b=CfgjvL6OhVBB4uFTP01C7DLLq8jzfUBHjnA3eFhEPn2/75kF/Q5nwOqK9j2zzk/XB/cL3z juii7vRTJK4iDRRFDOi7yWwC2f1MySQ8P8c6Uq/IkJgWdx5tlHY4r9lmoKo0zcEv2eBXDi 2xhtcvwqtCyghxvCZzgADmVdLkwNxH4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-573-9MI7-g3zN_CJjzd-XPQQXA-1; Tue, 09 Mar 2021 11:29:17 -0500 X-MC-Unique: 9MI7-g3zN_CJjzd-XPQQXA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 135A2101F00D; Tue, 9 Mar 2021 16:29:15 +0000 (UTC) Received: from [10.36.114.143] (ovpn-114-143.ams2.redhat.com [10.36.114.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42D871A867; Tue, 9 Mar 2021 16:29:02 +0000 (UTC) Subject: Re: [PATCH 6/9] virtio_balloon: remove the balloon-kvm file system To: Christoph Hellwig , Al Viro Cc: Andrew Morton , Daniel Vetter , Nadav Amit , "VMware, Inc." , "Michael S. Tsirkin" , 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 References: <20210309155348.974875-1-hch@lst.de> <20210309155348.974875-7-hch@lst.de> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 9 Mar 2021 17:29:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210309155348.974875-7-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Stat-Signature: tpri5yzmtonup5yb5fuhpiainh8ozbxt X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E234FC001C73 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615307358-160850 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: On 09.03.21 16:53, Christoph Hellwig wrote: > Just use the generic anon_inode file system. > > Signed-off-by: Christoph Hellwig > --- > drivers/virtio/virtio_balloon.c | 30 +++--------------------------- > 1 file changed, 3 insertions(+), 27 deletions(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index cae76ee5bdd688..1efb890cd3ff09 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -6,6 +6,7 @@ > * Copyright 2008 Rusty Russell IBM Corporation > */ > > +#include > #include > #include > #include > @@ -42,10 +43,6 @@ > (1 << (VIRTIO_BALLOON_HINT_BLOCK_ORDER + PAGE_SHIFT)) > #define VIRTIO_BALLOON_HINT_BLOCK_PAGES (1 << VIRTIO_BALLOON_HINT_BLOCK_ORDER) > > -#ifdef CONFIG_BALLOON_COMPACTION > -static struct vfsmount *balloon_mnt; > -#endif > - > enum virtio_balloon_vq { > VIRTIO_BALLOON_VQ_INFLATE, > VIRTIO_BALLOON_VQ_DEFLATE, > @@ -805,18 +802,6 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info, > > return MIGRATEPAGE_SUCCESS; > } > - > -static int balloon_init_fs_context(struct fs_context *fc) > -{ > - return init_pseudo(fc, BALLOON_KVM_MAGIC) ? 0 : -ENOMEM; > -} > - > -static struct file_system_type balloon_fs = { > - .name = "balloon-kvm", > - .init_fs_context = balloon_init_fs_context, > - .kill_sb = kill_anon_super, > -}; > - > #endif /* CONFIG_BALLOON_COMPACTION */ > > static unsigned long shrink_free_pages(struct virtio_balloon *vb, > @@ -909,17 +894,11 @@ static int virtballoon_probe(struct virtio_device *vdev) > goto out_free_vb; > > #ifdef CONFIG_BALLOON_COMPACTION > - balloon_mnt = kern_mount(&balloon_fs); > - if (IS_ERR(balloon_mnt)) { > - err = PTR_ERR(balloon_mnt); > - goto out_del_vqs; > - } > - > vb->vb_dev_info.migratepage = virtballoon_migratepage; > - vb->vb_dev_info.inode = alloc_anon_inode_sb(balloon_mnt->mnt_sb); > + vb->vb_dev_info.inode = alloc_anon_inode(); > if (IS_ERR(vb->vb_dev_info.inode)) { > err = PTR_ERR(vb->vb_dev_info.inode); > - goto out_kern_unmount; > + goto out_del_vqs; > } > vb->vb_dev_info.inode->i_mapping->a_ops = &balloon_aops; > #endif > @@ -1016,8 +995,6 @@ static int virtballoon_probe(struct virtio_device *vdev) > out_iput: > #ifdef CONFIG_BALLOON_COMPACTION > iput(vb->vb_dev_info.inode); > -out_kern_unmount: > - kern_unmount(balloon_mnt); > out_del_vqs: > #endif > vdev->config->del_vqs(vdev); > @@ -1070,7 +1047,6 @@ static void virtballoon_remove(struct virtio_device *vdev) > if (vb->vb_dev_info.inode) > iput(vb->vb_dev_info.inode); > > - kern_unmount(balloon_mnt); > #endif > kfree(vb); > } > ... you might know what I am going to say :) Apart from that LGTM. -- Thanks, David / dhildenb