[PATCH] close_files(): add scheduling point
authorIngo Molnar <mingo@elte.hu>
Mon, 12 Feb 2007 08:52:26 +0000 (00:52 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:30 +0000 (09:48 -0800)
close_files() can sometimes take long enough to trigger the soft lockup
detector.

Cc: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/exit.c

index bc71fdfcd8a78d4a6b0f466b11f55cb8354bacdd..14f17033f5635cf41fedbaec35c92b14f1a91933 100644 (file)
@@ -430,8 +430,10 @@ static void close_files(struct files_struct * files)
                while (set) {
                        if (set & 1) {
                                struct file * file = xchg(&fdt->fd[i], NULL);
-                               if (file)
+                               if (file) {
                                        filp_close(file, files);
+                                       cond_resched();
+                               }
                        }
                        i++;
                        set >>= 1;