I'm planning to add some kernel self tests which use a user level program in tools/testing/selftests/vm/ and a kernel module. See: https://lore.kernel.org/linux-mm/20191023195515.13168-1-rcampbell@nvidia.com...
The question is where to put the kernel module source code. I see some test modules that are in lib/test_*.ko and my patch initially placed the hmm-dmirror module in drivers/char/ since it creates a character device.
Any advice?