mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Don't read meminfo if there are no shrinkers
This commit is contained in:
parent
19005ecf08
commit
f885dc20eb
@ -69,8 +69,15 @@ static struct meminfo read_meminfo(void)
|
||||
void run_shrinkers(void)
|
||||
{
|
||||
struct shrinker *shrinker;
|
||||
struct meminfo info = read_meminfo();
|
||||
s64 want_shrink = (info.total >> 2) - info.available;
|
||||
struct meminfo info;
|
||||
s64 want_shrink;
|
||||
|
||||
/* Fast out if there are no shrinkers to run. */
|
||||
if (list_empty(&shrinker_list))
|
||||
return;
|
||||
|
||||
info = read_meminfo();
|
||||
want_shrink = (info.total >> 2) - info.available;
|
||||
|
||||
if (want_shrink <= 0)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user