On Wed, Oct 16, 2002 at 03:57:28PM +0100, John Levon wrote:
> Matthew, can we submit the proper fix (using cond_resched ?) at some
> point ?
yes, i have the proper fix in my tree, along with some other changes I
want to make. Here's the better patch:
diff -urpNX dontdiff linux-2.5.43/fs/locks.c linux-2.5.43-flock/fs/locks.c
--- linux-2.5.43/fs/locks.c 2002-09-27 20:10:43.000000000 -0700
+++ linux-2.5.43-flock/fs/locks.c 2002-10-10 18:03:10.000000000 -0700
@@ -727,12 +726,16 @@ static int flock_lock_file(struct file *
}
unlock_kernel();
- if (found)
- yield();
-
if (new_fl->fl_type == F_UNLCK)
return 0;
+ /*
+ * If a higher-priority process was blocked on the old file lock,
+ * give it the opportunity to lock the file.
+ */
+ if (found)
+ cond_resched();
+
lock_kernel();
for_each_lock(inode, before) {
struct file_lock *fl = *before;
-- Revolutions do not require corporate support. - 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 : Wed Oct 23 2002 - 22:00:28 EST