mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	linux-kernel@vger.kernel.org
Subject: [PATCH -mm 1/6] cpu_relax(): interrupt.h
Date: Wed, 21 Jun 2006 22:59:32 +0200	[thread overview]
Message-ID: <20060621205932.GA22516@rhlx01.fht-esslingen.de> (raw)


Add cpu_relax() to tasklet_unlock_wait() loop.


I kept barrier() since it is said to still be required, in various older
postings.
Took care of kernel style formatting.

Tested on 2.6.17-mm1.


This is the first patch within a set, which aims to improve P4 HT performance
a bit:
these SMT CPUs want a rep nop (pause) (as done by cpu_relax()) when
busy-polling, in order to free pipeline resources for the SMT CPU sibling.

During I/O polling cpu_relax() will help for non-P4 CPUs, too (reduce
power consumption there).

Signed-off-by: Andreas Mohr <andi@lisas.de>


diff -urN linux-2.6.17-mm1.orig/include/linux/interrupt.h linux-2.6.17-mm1.my/include/linux/interrupt.h
--- linux-2.6.17-mm1.orig/include/linux/interrupt.h	2006-06-21 14:28:19.000000000 +0200
+++ linux-2.6.17-mm1.my/include/linux/interrupt.h	2006-06-21 21:34:12.000000000 +0200
@@ -227,7 +227,10 @@
 
 static inline void tasklet_unlock_wait(struct tasklet_struct *t)
 {
-	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) {
+		barrier();
+		cpu_relax();
+	}
 }
 #else
 #define tasklet_trylock(t) 1

             reply	other threads:[~2006-06-21 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 20:59 Andreas Mohr [this message]
2006-06-21 21:04 ` Arjan van de Ven

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=20060621205932.GA22516@rhlx01.fht-esslingen.de \
    --to=andi@rhlx01.fht-esslingen.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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

all inboxes | Powered by JetHome®