diff options
-rw-r--r-- | fs/jffs2/background.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 6eb3daebd56..888f236e549 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c @@ -99,7 +99,13 @@ static int jffs2_garbage_collect_thread(void *_c) if (try_to_freeze()) continue; - cond_resched(); + /* This thread is purely an optimisation. But if it runs when + other things could be running, it actually makes things a + lot worse. Use yield() and put it at the back of the runqueue + every time. Especially during boot, pulling an inode in + with read_inode() is much preferable to having the GC thread + get there first. */ + yield(); /* Put_super will send a SIGKILL and then wait on the sem. */ |