Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1826393imj; Sun, 17 Feb 2019 15:52:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IaqH4m5RNsfdPkpuhrtH4vvYsVNKn2YTV/8uLVq9lIqrlXu+SpAi3qbXI1ZvIIsygzVic7q X-Received: by 2002:a63:ae0e:: with SMTP id q14mr20352450pgf.151.1550447547120; Sun, 17 Feb 2019 15:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550447547; cv=none; d=google.com; s=arc-20160816; b=AQSeSrO7otJYL0iqIm3i8O9dH1kxX+LClM34GHnI1Bu0I5iqwsVWFmcpvNzloO8LaN cNil9BPdYuJ+R6UQl855jh+DS9DWk7Un+PFkFJ5N3jZqkeYdrd9H2Ys8WpZyb6RazosL UnDgurRn56k1mZC2XWQdtbXnSNaCTnfwUA8EdnG6HOKkL9w1IJh6ImVlDKCvBMnxn5e8 2r0Ewv0EMVFV4f10m38uNZenhyG2yWbT+pQUW2lOuDr45zGUriwdJSnF4QnPhBWp7ik0 +BMG/arei5m9YCo4LIhHPOMlvJ5FDgKmLp8xBUhSkOWHO0Z6hcFInohBZiwKMBCWwmB4 u6ng== 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=9YXO7gH0m8JqLr67NLxpBiSHEFbfXjs+yR11vYSyzh0=; b=KmmlhadLZ+BzlujmQEUwtXCcc0ORXqLhn76C6NKxCrrjruDn92Glg+dcWVW/mgI0OB VDRo2BKhXW5IA+5iMxt7khtWHAQAl1V6rqWKDNlIEDzajZmW8N++X98jyYXvoDJlrj4I egHFnduXgU1+HLZpy8sA6IMarLoXV9Uq6fEYKxeQdLVd5MRX3+4gHaDgvjP8CVX67Aei 0xZBkGZypg63H5X/D3F1+5DND3dcWKnH7YW+Hz8occUPxdaS/A5F7+QYBydcSHWk/lpC Zl7CV22glGo1ZZYoIsomqlqWIqvvgmZ/tVo6Nuj3eGu6s6l+4MUOqdrSeE5dRKG+5kgQ EQgQ== 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 31si12565417pla.334.2019.02.17.15.52.11; Sun, 17 Feb 2019 15:52:27 -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 S1727705AbfBQXvx (ORCPT + 99 others); Sun, 17 Feb 2019 18:51:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58438 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfBQXvx (ORCPT ); Sun, 17 Feb 2019 18:51:53 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FC3066C4B; Sun, 17 Feb 2019 23:51:53 +0000 (UTC) Received: from localhost (ovpn-117-203.ams2.redhat.com [10.36.117.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF8B2608C7; Sun, 17 Feb 2019 23:51:52 +0000 (UTC) Date: Sun, 17 Feb 2019 23:51:51 +0000 From: "Richard W.M. Jones" To: Pavel Machek Cc: smcdowell@cloudbd.io, kernel list , Andrew Morton Subject: Re: nbd, nbdkit, loopback mounts and memory management Message-ID: <20190217235151.GZ12500@redhat.com> References: <20190215191953.GB17897@amd> <20190217084458.GY12500@redhat.com> <20190217231514.GA10675@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190217231514.GA10675@amd> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 17 Feb 2019 23:51:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 18, 2019 at 12:15:14AM +0100, Pavel Machek wrote: > But Shaun reported it happened somehow often for them, so he might > have a practical test case... better than my theories :-). Yes, certainly not saying this isn't a problem. I think the good news is the fix seems quite easy, ie. to add mlockall and adjust the OOM killer score, as is done currently in the client: https://github.com/NetworkBlockDevice/nbd/blob/3969c3f81a11a483f267a55ed6665d260dc9e1d2/nbd-client.c#L867-L885 https://github.com/NetworkBlockDevice/nbd/blob/3969c3f81a11a483f267a55ed6665d260dc9e1d2/nbd-client.c#L1219 For now I have added a note in the TODO file to follow up in case we get a test case or reports of a problem: https://github.com/libguestfs/nbdkit/commit/72e0afe2e280d895f68941677fafa559ddc3bb0d Thanks, 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