linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] jbd2: don't hold j_state_lock while calling wake_up()
@ 2014-03-09  6:05 Theodore Ts'o
  2014-03-09  6:05 ` [PATCH 2/6] jbd2: calculate statistics without holding j_state_lock and j_list_lock Theodore Ts'o
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Theodore Ts'o @ 2014-03-09  6:05 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

The j_state_lock is one of the hottest locks in the jbd2 layer and
thus one of its scalability bottlenecks.

We don't need to be holding the j_state_lock while we are calling
wake_up(&journal->j_wait_commit), so release the lock a little bit
earlier.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/jbd2/journal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 244b6f6..67b8e30 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -302,8 +302,8 @@ static void journal_kill_thread(journal_t *journal)
 	journal->j_flags |= JBD2_UNMOUNT;
 
 	while (journal->j_task) {
-		wake_up(&journal->j_wait_commit);
 		write_unlock(&journal->j_state_lock);
+		wake_up(&journal->j_wait_commit);
 		wait_event(journal->j_wait_done_commit, journal->j_task == NULL);
 		write_lock(&journal->j_state_lock);
 	}
@@ -710,8 +710,8 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid)
 	while (tid_gt(tid, journal->j_commit_sequence)) {
 		jbd_debug(1, "JBD2: want %d, j_commit_sequence=%d\n",
 				  tid, journal->j_commit_sequence);
-		wake_up(&journal->j_wait_commit);
 		read_unlock(&journal->j_state_lock);
+		wake_up(&journal->j_wait_commit);
 		wait_event(journal->j_wait_done_commit,
 				!tid_gt(tid, journal->j_commit_sequence));
 		read_lock(&journal->j_state_lock);
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-09  6:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-09  6:05 [PATCH 1/6] jbd2: don't hold j_state_lock while calling wake_up() Theodore Ts'o
2014-03-09  6:05 ` [PATCH 2/6] jbd2: calculate statistics without holding j_state_lock and j_list_lock Theodore Ts'o
2014-03-09  6:05 ` [PATCH 3/6] jbd2: add transaction to checkpoint list earlier Theodore Ts'o
2014-03-09  6:05 ` [PATCH 4/6] jbd2: check jh->b_transaction without taking j_list_lock Theodore Ts'o
2014-03-09  6:05 ` [PATCH 5/6] jbd2: minimize region locked by j_list_lock in journal_get_create_access() Theodore Ts'o
2014-03-09  6:05 ` [PATCH 6/6] jbd2: minimize region locked by j_list_lock in jbd2_journal_forget() Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).