diff options
author | Lukas Czerner <lczerner@redhat.com> | 2012-11-30 11:42:41 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-11-30 11:48:05 +0100 |
commit | 7b5a35225b0d4fd779cf79d7624e63d1957f6c4d (patch) | |
tree | 5e2324e3b657b8ead9c0cdd58c6ed5d79f8e76f8 /sound/sh | |
parent | eed8c02e680c04cd737e0a9cef74e68d8eb0cefa (diff) |
loop: Limit the number of requests in the bio list
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 <lczerner@redhat.com>
Reported-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'sound/sh')
0 files changed, 0 insertions, 0 deletions