]> git.sesse.net Git - bcachefs-tools-debian/commit
improve kmalloc performance
authorDaniel Hill <daniel@gluo.nz>
Mon, 20 Nov 2023 12:43:52 +0000 (01:43 +1300)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 25 Nov 2023 00:54:11 +0000 (19:54 -0500)
commit326d7c1b3b8ff8e0bd1dda46ad83a5bf27080e21
treeee936c8c615d4632da0ba1b5de03e94a306c5c3f
parentfbad1bfdf3ebbe70afd3f936de59fa3fc47614d7
improve kmalloc performance

Reading from /proc/meminfo is really slow

We don't want to start swapping to disk.

Deceptively, memory available goes up when we start to swap to disk making
performance even worse.

To mitigate this:
1. replace reading from meminfo with proper system calls.
2. attempt to lock allocations in physical memory space.
3. check our own allocated memory instead of available memory.
4. still check available memory in the off chance we're trying to play
nice with other apps.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
bcachefs.c
linux/shrinker.c