[PATCH] tmpfs 5/6 use cond_resched

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Apr 01 2003 - 17:35:14 EST


cond_resched each time around the loop in shmem_file_write
and do_shmem_file_read, matching filemap.c.

--- tmpfs4/mm/shmem.c Tue Apr 1 21:35:21 2003
+++ tmpfs5/mm/shmem.c Tue Apr 1 21:35:32 2003
@@ -1211,6 +1211,8 @@
                 buf += bytes;
                 if (pos > inode->i_size)
                         inode->i_size = pos;
+
+ cond_resched();
         } while (count);
 
         *ppos = pos;
@@ -1302,6 +1304,8 @@
                 page_cache_release(page);
                 if (ret != nr || !desc->count)
                         break;
+
+ cond_resched();
         }
 
         *ppos = ((loff_t) index << PAGE_CACHE_SHIFT) + offset;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:15 EST