All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: rpm@xenomai.org
Cc: adeos-main@gna.org
Subject: Re: [Adeos-main] [PATCH+HACK] optimise root stalling
Date: Fri, 29 Sep 2006 09:48:33 +0200	[thread overview]
Message-ID: <451CCFD1.4030001@domain.hid> (raw)
In-Reply-To: <1159440412.4949.33.camel@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

Philippe Gerum wrote:

> On Thu, 2006-09-28 at 12:31 +0200, Jan Kiszka wrote:
>> Does it still make sense then to optimise like I proposed?
>>
>
> If you did measure a 5% improvement on low-end x86 hw, then I guess so.
> Moving __ipipe_unstall_root to the arch-dependent section would do, so
> that we could use the most efficient implementation on a case by case
> basis.
>

I'm not seeing 5% alone due to this change, it's a piece in the puzzle. I just
benchmarked the fixed version below against the unmodified one. There is an improvement
of the average hackbench runtime, though it's minimal. The wrong variant I posted first
doesn't show noticeable benefit compared to the correct one. I guess the "critical"
part is switching IRQs off when they were on, and not just enabling them when they
weren't disabled.

So I think the one below could be applied for now, but per-arch optimisations may
remain on the to-do list for the future if we discover archs that could do better with
hand-optimised code here. The x86 assembly looks quite good already.


--- linux-2.6.17.13.orig/kernel/ipipe/core.c
+++ linux-2.6.17.13/kernel/ipipe/core.c
@@ -166,6 +158,7 @@ void __ipipe_unstall_root(void)
 {
 	ipipe_declare_cpuid;
 
+#ifdef CONFIG_SMP
 	local_irq_disable_hw();
 
 	ipipe_load_cpuid();
@@ -174,6 +167,14 @@ void __ipipe_unstall_root(void)
 
 	if (ipipe_root_domain->cpudata[cpuid].irq_pending_hi != 0)
 		__ipipe_sync_pipeline(IPIPE_IRQMASK_ANY);
+#else	/* !CONFIG_SMP */
+	clear_bit(IPIPE_STALL_FLAG, &ipipe_root_domain->cpudata[cpuid].status);
+
+	if (unlikely(ipipe_root_domain->cpudata[cpuid].irq_pending_hi != 0)) {
+		local_irq_disable_hw();
+		__ipipe_sync_pipeline(IPIPE_IRQMASK_ANY);
+	}
+#endif	/* CONFIG_SMP */
 
 	local_irq_enable_hw();
 }



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2006-09-29  7:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  7:35 [Adeos-main] [PATCH+HACK] optimise root stalling Jan Kiszka
2006-09-25 10:44 ` Jan Kiszka
2006-09-28 15:33   ` Philippe Gerum
2006-09-28  9:07 ` Philippe Gerum
2006-09-28  9:15   ` Jan Kiszka
2006-09-28  9:16     ` Philippe Gerum
2006-09-28  9:23       ` Jan Kiszka
2006-09-28 10:07         ` Philippe Gerum
2006-09-28 10:31           ` Jan Kiszka
2006-09-28 10:46             ` Philippe Gerum
2006-09-29  7:48               ` Jan Kiszka [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-26 15:07 gilles.chanteperdrix
2006-09-26 15:14 ` Jan Kiszka

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=451CCFD1.4030001@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.