Skip to contentSkip to conversation

reiser4-try_capture_block-update.patch]

PATCH New Hans Reiser 1 participant 1 message Nov 16, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 reiser4-try_capture_block-update.patch]

.

From: Alex Zarochentsev <[email protected]>

try_capture_block:
avoid holding more than two spinlocks at a time. avoid to capture at read requests if
the node wasn't captured before
wake_up_all_lopri_owners:
don't wake the same thread up twice
Cleanup.

 fs/reiser4/lock.c   |    5 
 fs/reiser4/tree.c   |    7 
 fs/reiser4/txnmgr.c |  630 ++++++++++------------------------------------------
 3 files changed, 126 insertions(+), 516 deletions(-)
fs/reiser4/lock.c renamed from fs/reiser4/lock.c~reiser4-try_capture_block-update +2 -3
diff -puN fs/reiser4/lock.c~reiser4-try_capture_block-update fs/reiser4/lock.c
@@ -252,10 +252,9 @@ static void wake_up_all_lopri_owners(zno
 		if (!handle->signaled) {
 			handle->signaled = 1;
 			atomic_inc(&handle->owner->nr_signaled);
+			/* Wake up a single process */
+			__reiser4_wake_up(handle->owner);
 		}
-		/* Wake up a single process */
-		__reiser4_wake_up(handle->owner);
-
 		spin_unlock_stack(handle->owner);
 	}
 }
fs/reiser4/tree.c renamed from fs/reiser4/tree.c~reiser4-try_capture_block-update +1 -6
diff -puN fs/reiser4/tree.c~reiser4-try_capture_block-update fs/reiser4/tree.c
@@ -792,13 +792,8 @@ void forget_znode(lock_handle * handle)
 	 * invalidation does not allow other threads to waste cpu time is a busy
 	 * loop, trying to lock dying object.  The exception is in the flush
 	 * code when we take node directly from atom's capture list.*/
-
-	write_unlock_zlock(&node->lock);
-	/* and, remove from atom's capture list. */
-	uncapture_znode(node);
-	write_lock_zlock(&node->lock);
-
 	invalidate_lock(handle);
+	uncapture_znode(node);
 }
 
 /* Check that internal item at @pointer really contains pointer to @child. */
fs/reiser4/txnmgr.c renamed from fs/reiser4/txnmgr.c~reiser4-try_capture_block-update +123 -507

765 lines not on this page · raw message

_