Skip to contentSkip to conversation

__ipipe_grab_irq

Adeos-main A C 2 participants 2 messages Jan 7, 2010 NIOS2 architecture

lore
Share & tools
lore

A C

author
#0 lore raw

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); 
              }
    }

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 ?

Cheers
Adrien Chiron & Vincent Vanbesien

#1 lore raw
Quoted 4 lines · A C

Hello,
in the function __ipipe_grab_irq for the NIOS2, there is the following block :

Quoted 8 lines
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:

arch/nios2/kernel/ipipe.c +1 -1
index e88d788..2ec178c 100644
@@ -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;
Quoted 5 lines

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.

Quoted 9 lines

Cheers
Adrien Chiron & Vincent Vanbesien

_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Signature · 1 line
Philippe.