Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668668

Re: attempting to format brd device results in OOM kills

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: attempting to format brd device results in OOM kills
Date Mon, 19 Jun 2017 00:30:01 +0200
Message-ID <tTQRH-2AF-9@gated-at.bofh.it> (permalink)
References <tTLp2-7x8-49@gated-at.bofh.it> <tTQRH-2AF-1@gated-at.bofh.it>
X-Original-To Jeff Layton <jlayton@redhat.com>, Christoph Hellwig <hch@infradead.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k7jMX3BMswPyK+JI+k/tcIsn0dN6pPypmdBjVyPMauo=; b=ILq+LDQlh8CW5yeDM0+2Eq0+ikxMV9KYXl9YfbGsuaZwKOrpVRLxV1945br63M72Gy CgEklWsCWOzr6HA4tOQrHYBP0TEmg8710gP74EqdECUGDQSkXklSkOnbUQkND/yNWqfL oE72Yx5iIvmexrrvaL5NLiRZXRc0V1TZl1gsapJQCC2uDnNngABw4b3X4TGgA4UfCW1U +kdh7TRIar/bx0sHMOrnQPAPPCj1AOGbnfHCJXTRE6Ga1N4ty1Arc96Sct6geJJ9JNCU GKPv0GCa8Qccx7Cd12UQV+7dAQXW1bcGPm6Eao8hEbYR63HpuJj0tDI/ZvDdyfspaEJk biOA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k7jMX3BMswPyK+JI+k/tcIsn0dN6pPypmdBjVyPMauo=; b=PqJe/ny++Omt6YvlIc1RpWblExmUfjumVKKdCBQ6+vbumBFM8nSuruw7SvB/C3Wz+U P2Wa7MTSV//k7DR0OJA9Ts6FT8UB0OI6PwK+4nE9feL+ieZ1QBo7a+q9SuhWoBP6vHfU a4Y2uo0L1/zewRrmZExxz8FfTPVbNEycUkJFiG2yV5lAqjga4BkbP3WlPNLZwGIH3EbL lvFNPY5OMPsJVds8zn8TQ31mJtfZLJ2W5Lk+MuIOItOvaIXhlw6xIc6LbsbyzZySusLQ tVMX1ay8p5HrK3f6/uPZUsP57FWFUHmqnKDZj/p97SozTwRb1kS4eSgyoN/lh7fUL5Eo OhUQ==
X-Gm-Message-State AKS2vOxeah93rWnGJLexxTMukOnNmgqlpYHt9eUtCmpv5mnVXGHypLp8 xWvR+xipJ4ifn9DEMnhtrQ==
X-Received by 10.99.44.201 with SMTP id s192mr22718288pgs.84.1497824877494; Sun, 18 Jun 2017 15:27:57 -0700 (PDT)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Language en-US
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
Organization linux.* mail to news gateway
X-Original-Cc Hannes Reinecke <hare@suse.de>, LKML <linux-kernel@vger.kernel.org>
X-Original-Date Sun, 18 Jun 2017 16:27:55 -0600
X-Original-Message-ID <d2411a2c-81a3-4a42-b2a3-7ec349f4ed95@kernel.dk>
X-Original-References <1497803428.21567.4.camel@redhat.com> <7e8cdef3-7062-0a11-63c1-e19fabcd117c@kernel.dk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1668668

Show key headers only | View raw


On 06/18/2017 04:21 PM, Jens Axboe wrote:
> On 06/18/2017 10:30 AM, Jeff Layton wrote:
>> I've run across a regression from v4.11. If I boot a v4.12-rc1 or later
>> kernel, make a large brd device and try to format it, it quickly slows
>> down to a crawl and then the OOM killer kicks in.
>>
>> I ran a bisect and it landed here:
>>
>> commit f09a06a193d942a12c1a33c153388b3962222006 (HEAD, refs/bisect/bad)
>> Author: Christoph Hellwig <hch@lst.de>
>> Date:   Wed Apr 5 19:21:16 2017 +0200
>>
>>     brd: remove discard support
>>     
>>     It's just a in-driver reimplementation of writing zeroes to the pages,
>>     which fails if the discards aren't page aligned.
>>     
>>     Signed-off-by: Christoph Hellwig <hch@lst.de>
>>     Reviewed-by: Hannes Reinecke <hare@suse.com>
>>     Signed-off-by: Jens Axboe <axboe@fb.com>
>>
>>
>> I've been reproducing it in a VM with ~8G allocated to it:
>>
>> I have a modprobe.d file with this in it:
>>
>>     options brd rd_nr=1 rd_size=1073741824
>>
>> I then just:
>>
>>     # modprobe brd
>>     # mkfs -t ext2 /dev/ram0
>>
>> It keels over pretty quickly after that.
> 
> Just checked, and creating a 1TB ram disk and then running mkfs.ext2 on it
> writes 16851MiB of data. I can't say I'm surprised you OOM, if you run that
> in a 8G VM, as you're about 8G short.
> 
> I'm puzzled as to why the discard change would make any difference, however.

Reverted the patch, and I see identical behavior. The only difference is that
the whole device is trimmed first, as expected. But it still writes ~16G
afterwards.

Are you sure this commit is what broke things for you? Honestly, I don't see
how it could ever work with 1TB ram disk, 8G of RAM, and 16G of data written.

-- 
Jens Axboe

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: attempting to format brd device results in OOM kills Jens Axboe <axboe@kernel.dk> - 2017-06-19 00:30 +0200
  Re: attempting to format brd device results in OOM kills Jens Axboe <axboe@kernel.dk> - 2017-06-19 00:30 +0200
    Re: attempting to format brd device results in OOM kills Jeff Layton <jlayton@redhat.com> - 2017-06-19 00:50 +0200
      Re: attempting to format brd device results in OOM kills Jens Axboe <axboe@kernel.dk> - 2017-06-19 03:50 +0200

csiph-web