From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH v3] loop: Limit the number of requests in the bio list Date: Tue, 13 Nov 2012 11:35:07 -0500 Message-ID: References: <1352824065-6734-1-git-send-email-lczerner@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org To: Lukas Czerner Return-path: In-Reply-To: <1352824065-6734-1-git-send-email-lczerner@redhat.com> (Lukas Czerner's message of "Tue, 13 Nov 2012 17:27:45 +0100") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Lukas Czerner writes: > Currently there is not limitation of number of requests in the loop bio > list. This can lead into some nasty situations when the caller spawns > tons of bio requests taking huge amount of memory. This is even more > obvious with discard where blkdev_issue_discard() will submit all bios > for the range and wait for them to finish afterwards. On really big loop > devices and slow backing file system this can lead to OOM situation as > reported by Dave Chinner. > > With this patch we will wait in loop_make_request() if the number of > bios in the loop bio list would exceed 'nr_congestion_on'. > We'll wake up the process as we process the bios form the list. Some > threshold hysteresis is in place to avoid high frequency oscillation. > > Signed-off-by: Lukas Czerner > Reported-by: Dave Chinner Acked-by: Jeff Moyer