]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
null_blk: Fix: memory release when memory_backed=1
authorNitesh Shetty <nj.shetty@samsung.com>
Mon, 5 Jun 2023 06:23:53 +0000 (11:53 +0530)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:25 +0000 (17:19 +0200)
commit6e96068d73196609abc9295092a544ac2c7333ed
tree15807013c8e676a1f2efab992807c5722f41af78
parent667fdf5dd7509f60315c707caf283ccb5d701b25
null_blk: Fix: memory release when memory_backed=1

BugLink: https://bugs.launchpad.net/bugs/2033931
[ Upstream commit 8cfb98196cceec35416041c6b91212d2b99392e4 ]

Memory/pages are not freed, when unloading nullblk driver.

Steps to reproduce issue
  1.free -h
        total        used        free      shared  buff/cache   available
Mem:    7.8Gi       260Mi       7.1Gi       3.0Mi       395Mi       7.3Gi
Swap:      0B          0B          0B
  2.modprobe null_blk memory_backed=1
  3.dd if=/dev/urandom of=/dev/nullb0 oflag=direct bs=1M count=1000
  4.modprobe -r null_blk
  5.free -h
        total        used        free      shared  buff/cache   available
Mem:    7.8Gi       1.2Gi       6.1Gi       3.0Mi       398Mi       6.3Gi
Swap:      0B          0B          0B

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Link: https://lore.kernel.org/r/20230605062354.24785-1-nj.shetty@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/block/null_blk/main.c