1

So I've edited SLOB to use the best-fit algorithm, both when finding a suitable page and a suitable block. But the question is, how do I test it?

Should I just write user-level code that does malloc a few times? Should I have a module do the same with kmalloc?

Your help will be greatly appreciated!

suitandtie
  • 11
  • 1

1 Answers1

1

SLOB is memory allocator for Linux kernel objects. So, it's different from user mode heap memory manager. To test it (to allocate memory from SLOB) you need to use kmalloc or kmem_cache_alloc.

Or, maybe, you can try to create Linux kernel objects such as process, file open from user space to allocate memory from SLOB. If your user mode application creates kernel objects (e.g. open file) then you should notice decrease of memory space from SLOB. Opposite if you destroy kernel objects (e.g. close file) from application.

No unit test or automated test for Linux kernel though. - How is the Linux kernel tested ?

Community
  • 1
  • 1
Wonil
  • 6,364
  • 2
  • 37
  • 55