Skip to content

Commit

Permalink
[JFFS2] add cond_resched() when garbage collecting deletion dirent
Browse files Browse the repository at this point in the history
We observe soft lockups when doing heavy test which creates
directory with a lot of direntries and deletes them. This
cycle is the reason fo this. Make it nicer and add cond_resched()
inside of it.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Dec 19, 2006
1 parent 0bf3a9d commit aba54da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/jffs2/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct

for (raw = f->inocache->nodes; raw != (void *)f->inocache; raw = raw->next_in_ino) {

cond_resched();

/* We only care about obsolete ones */
if (!(ref_obsolete(raw)))
continue;
Expand Down

0 comments on commit aba54da

Please sign in to comment.