All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: A C <adrien_chiron@domain.hid>
Cc: adeos <adeos-main@gna.org>
Subject: Re: [Adeos-main] __ipipe_grab_irq
Date: Thu, 07 Jan 2010 15:25:05 +0100	[thread overview]
Message-ID: <1262874305.2220.107.camel@domain.hid> (raw)
In-Reply-To: <449944.37907.qm@domain.hid>

On Thu, 2010-01-07 at 13:48 +0000, A C wrote:
> Hello,
> in the function __ipipe_grab_irq for the NIOS2, there is the following
> block :
> 
> if (likely(irq == __ipipe_hrtimer_irq)) {
>         __raw_get_cpu_var(__ipipe_tick_regs).estatus = regs->estatus;
>         __raw_get_cpu_var(__ipipe_tick_regs).ea = regs->ea;
>         if (!__ipipe_root_domain_p) {
>             __raw_get_cpu_var(__ipipe_tick_regs).estatus &=
> ~NIOS2_STATUS_PIE_MSK); 
>               }
>     }

This should read:

diff --git a/arch/nios2/kernel/ipipe.c b/arch/nios2/kernel/ipipe.c
index e88d788..2ec178c 100644
--- a/arch/nios2/kernel/ipipe.c
+++ b/arch/nios2/kernel/ipipe.c
@@ -290,7 +290,7 @@ int __ipipe_grab_irq(int irq, struct pt_regs *regs)
 {
 	if (likely(irq == __ipipe_hrtimer_irq)) {
 		__raw_get_cpu_var(__ipipe_tick_regs).estatus = regs->estatus;
-		__raw_get_cpu_var(__ipipe_tick_regs).ea = regs->ea;
+		__raw_get_cpu_var(__ipipe_tick_regs).ra = regs->ra;
 		if (!__ipipe_root_domain_p) {
 			__raw_get_cpu_var(__ipipe_tick_regs).estatus
 				&= ~NIOS2_STATUS_PIE_MSK;

> 
> We do not understand why there is an unusual case for an interruption
> from the timer. We understand each lines but not the global nature.
> Any help ?
> 

The linux kernel does basic sampling-based profiling and assesses the
current load average by looking at which code the timer tick did
preempt. Since we have a deferred interrupt model, and possibly many
non-linux tick interrupts passed to the upper domain(s), we have to
somehow forge a timer tick frame specifically for linux, which we then
pass to the regular tick handler (to any regular IRQ handler in fact,
since only the tick handler uses this info), for keeping those
computations accurate.

> Cheers
> Adrien Chiron & Vincent Vanbesien
> 
> 
> 
> _______________________________________________
> Adeos-main mailing list
> Adeos-main@domain.hid
> https://mail.gna.org/listinfo/adeos-main


-- 
Philippe.




      reply	other threads:[~2010-01-07 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 13:48 [Adeos-main] __ipipe_grab_irq A C
2010-01-07 14:25 ` Philippe Gerum [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=1262874305.2220.107.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=adeos-main@gna.org \
    --cc=adrien_chiron@domain.hid \
    /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.