linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org,
	dwalker@mvista.com, mingo@elte.hu, sct@redhat.com
Subject: Re: kjournald wasting CPU in invert_lock fs/jbd/commit.c
Date: Mon, 11 Jul 2005 19:09:42 -0400	[thread overview]
Message-ID: <1121123382.5481.11.camel@localhost.localdomain> (raw)
In-Reply-To: <20050711154113.5abc81dd.akpm@osdl.org>

On Mon, 2005-07-11 at 15:41 -0700, Andrew Morton wrote:
> Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > I noticed that the code in commit.c of the jbd system can waste CPU
> > cycles.
> 
> How did you notice?  By code inspection or by runtime observation?  If the
> latter, please share.

Argh! I just realize that this problem is really more in Ingo's RT
kernel, but I assumed that it was a problem in vanilla since the code is
more from the vanilla kernel.  With Ingo's spin_locks as mutexes, this
creates a problem on UP, but your are right, this is not a problem for
vanilla UP.


> Yeah.  But these _are_ spinlocks, so spinning is what's supposed to happen.
>  Maybe we should dump that silly schedule() and just do cpu_relax(). 
> Although I do recall once theorising that the time we spend in the
> schedule() might be preventing livelocks.
> 

As mentioned above, this was a confusion of paradigms. I just got back
from Europe, so I'm blaming this on jetlag!  

OK a cpu_relax() may be better. So here it is :-)

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
--- a/fs/jbd/commit.c	2005-07-11 17:51:37.000000000 -0400
+++ b/fs/jbd/commit.c	2005-07-11 19:05:35.000000000 -0400
@@ -87,7 +87,7 @@ static int inverted_lock(journal_t *jour
 {
 	if (!jbd_trylock_bh_state(bh)) {
 		spin_unlock(&journal->j_list_lock);
-		schedule();
+		cpu_relax();
 		return 0;
 	}
 	return 1;



      reply	other threads:[~2005-07-11 23:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 22:17 kjournald wasting CPU in invert_lock fs/jbd/commit.c Steven Rostedt
2005-07-11 22:41 ` Andrew Morton
2005-07-11 23:09   ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1121123382.5481.11.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=akpm@osdl.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sct@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).