dm writecache: set a default MAX_WRITEBACK_JOBS
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 13 Jul 2022 11:09:04 +0000 (07:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:23 +0000 (14:24 +0200)
commit9769bd964d54e32fcc42fd1adbe897628ca35476
treeaaa3a6499c6bfb8ef796ff5989cc9e316c3e854c
parent10bc71642fadca0b942b804f30eb51f4f02ad3df
dm writecache: set a default MAX_WRITEBACK_JOBS

[ Upstream commit ca7dc242e358e46d963b32f9d9dd829785a9e957 ]

dm-writecache has the capability to limit the number of writeback jobs
in progress. However, this feature was off by default. As such there
were some out-of-memory crashes observed when lowering the low
watermark while the cache is full.

This commit enables writeback limit by default. It is set to 256MiB or
1/16 of total system memory, whichever is smaller.

Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-writecache.c