cachefilesd can spin when disk space is short.

When cachefilesd finds that it needs to cull, but that culling doesn't
achieve anything, it sets an alarm to wake it in 30 seconds to try again.
But as read_cache_state() will detect that culling is still needed, it will
immediately try again anyway.

This results in 100% cpu usage of no value.

This patch causes culling to be blocked until the 30 second alarm goes off.

It also changes the test to decide whether to enter poll() after blocking
signals to test exactly those values that might be changed by a signal.
Testing these is important, testing anything else is pointless.

Signed-off-by: NeilBrown <>
Signed-off-by: David Howells <>
Reviewed-by: Steve Dickson <>
Reviewed-by: John Snow <>
1 file changed