dm vdo: add memory allocation utilities
authorMatthew Sakai <msakai@redhat.com>
Fri, 17 Nov 2023 00:41:15 +0000 (19:41 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:13 +0000 (13:43 -0500)
commit46766d4888ffdfd2bce91a6879bd6285a92a4881
treea0dc55493f92cc3119db381d9f53d717f2a3e39e
parenta3957b1f3ec9ec78dd33422f3a8b4ee6781d8e3b
dm vdo: add memory allocation utilities

This patch adds standardized allocation macros and memory tracking tools to
track and report any allocated memory that is not freed. This makes it
easier to ensure that the vdo target does not leak memory.

This patch also adds utilities for controlling whether certain threads are
allowed to allocate memory, since memory allocation during certain critical
code sections can cause the vdo target to deadlock.

Co-developed-by: J. corwin Coburn <corwin@hurlbutnet.net>
Signed-off-by: J. corwin Coburn <corwin@hurlbutnet.net>
Co-developed-by: Michael Sclafani <dm-devel@lists.linux.dev>
Signed-off-by: Michael Sclafani <dm-devel@lists.linux.dev>
Co-developed-by: Thomas Jaskiewicz <tom@jaskiewicz.us>
Signed-off-by: Thomas Jaskiewicz <tom@jaskiewicz.us>
Co-developed-by: Ken Raeburn <raeburn@redhat.com>
Signed-off-by: Ken Raeburn <raeburn@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-vdo/memory-alloc.c [new file with mode: 0644]
drivers/md/dm-vdo/memory-alloc.h [new file with mode: 0644]