Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp340018imj; Sat, 16 Feb 2019 01:22:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYFvyUQ4uiYB+/J1RG5NLKPwvT1TPkIXWNjrysdB1uZ3OkVUzfCPVZT2cv/5nDWE7TaNKyT X-Received: by 2002:aa7:81c5:: with SMTP id c5mr14390817pfn.217.1550308960091; Sat, 16 Feb 2019 01:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550308960; cv=none; d=google.com; s=arc-20160816; b=JF9Va8x1HiUb5ro7nDLw31RFnMUCgl+o2jWiHt+OYQz7eoMJZsowe/ARHkJp7/epWm sE0QgjlDO3RrPskK8+KXDT4bJRXpppgmnHDHLReYZzG1BGgeOJVhu38m8NIsigBncuSO RTMsvrB8RRlT6Su3+tJRgRjR8asb/h/VJw+q6bgfDlFzkj/a7Fpv0FV7X2q35FkZCaXe /MLaTLF0FI80AEkDPMq3CrH7U0GAl5NRbxSQDGvv94K+E2kgRzknHqmkLwFxFdXYkd3M nkPnzyUOQUJhJg6bcgWA6pOMjyLirdGdc3Ovl4tN+8v+9Sp2huuDIiUF/ZWxs9eVeDAr ybow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=I6QSJ50DfOUk/YX9xZFpacvxO6ChrJPFi14gjwYNohI=; b=Jac+krpdBfUeGq8OErUQSYJ1ZlpaCCMX/eUPL9DBwnHzxlcogN3z1T8soqj5N/kCZp JmwycwnEBDJPEtTFid5tc9qWafHVq0VtYafcw57F3laM0MhsrVDT9N6gEnj/hzPvR+vQ P+UInYdJa7mJs4FY96dXlmUfP5l+XsMvsC/2GoPRvPBDgz/3mq97UGBJlIJGjERVS4gf D8wmX/rl8GR2XPFalYRywvYi94JS9BQyXrbExPIU879rWXCeRgrd9K9sVM3mCA4OVuKs K1SljJiUL82eAduP9DUWYi/YCxImQb/OYTv46AYu9teWLz3VsigKH2NKPLVTJMNLV25x zssw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si6199758pls.85.2019.02.16.01.22.24; Sat, 16 Feb 2019 01:22:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404732AbfBOWxp (ORCPT + 99 others); Fri, 15 Feb 2019 17:53:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49422 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404684AbfBOWxe (ORCPT ); Fri, 15 Feb 2019 17:53:34 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6F3AC073D6F; Fri, 15 Feb 2019 22:53:33 +0000 (UTC) Received: from localhost (ovpn-117-203.ams2.redhat.com [10.36.117.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A77560C69; Fri, 15 Feb 2019 22:53:33 +0000 (UTC) Date: Fri, 15 Feb 2019 22:53:32 +0000 From: "Richard W.M. Jones" To: Pavel Machek Cc: kernel list , Andrew Morton , Wouter Verhelst , nbd@other.debian.org Subject: Re: nbd, nbdkit, loopback mounts and memory management Message-ID: <20190215225332.GA4922@redhat.com> References: <20190215191953.GB17897@amd> <20190215224126.GX12500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190215224126.GX12500@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 15 Feb 2019 22:53:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 10:41:26PM +0000, Richard W.M. Jones wrote: > On Fri, Feb 15, 2019 at 08:19:54PM +0100, Pavel Machek wrote: > > Hi! > > > > I watched fosdem talk about > > nbdkit... https://www.youtube.com/watch?v=9E5A608xJG0 . Nice. But word > > of warning: I'm not sure using it read-write on localhost is safe. > > > > In particular, user application could create a lot of dirty data > > quickly. If there's not enough memory for nbdkit (or nbd-client or > > nbd-server), you might get a deadlock. > > Thanks for the kind words about the talk. I've added Wouter Verhelst > & the NBD mailing list to CC. Although I did the talk because the > subject is interesting, how I actually use nbdkit / NBD is to talk to > qemu and that's where I have most experience and where we (Red Hat) > use it in production systems. > > However in January I spent a lot of time exercising the NBD loop-mount > + nbdkit case using fio in order to find contention / bottlenecks in > our use of threads and locks. I didn't notice any particular problems > then, but it's possible my testing wasn't thorough enough. Or that > fio only creates small numbers of dirty pages (because of locality in > its access patterns I guess?) > > When you say it's not safe, what could happen? What would we observe > if it was going wrong? Reading more carefully I see you said we'd observe a deadlock. I didn't see that, but again my testing of this wouldn't have been very thorough. When I have some time I'll try creating / spooling huge files into an NBD loop mount to see if I can cause a deadlock. Thanks, Rich. > > Also note that nbd.txt in Documentation/blockdev/ points to > > sourceforge; it should probably point to > > https://github.com/NetworkBlockDevice/nbd ? > > Wouter should be able to say what the correct link should be. > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > libguestfs lets you edit virtual machines. Supports shell scripting, > bindings from many languages. http://libguestfs.org -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html