Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1537626

Re: [PATCH 1/5] MIPS: Introduce irq_stack

From Matt Redfearn <matt.redfearn@imgtec.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] MIPS: Introduce irq_stack
Date 2016-12-07 10:30 +0100
Message-ID <sLGI1-6DX-5@gated-at.bofh.it> (permalink)
References <sJWee-4q8-61@gated-at.bofh.it> <sJWnU-4tM-39@gated-at.bofh.it> <sLwfE-7XU-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Jason,


On 06/12/16 22:13, Jason A. Donenfeld wrote:
> On Fri, Dec 2, 2016 at 2:39 PM, Matt Redfearn <matt.redfearn@imgtec.com> wrote:
>> +void *irq_stack[NR_CPUS];
> I'm curious why you implemented it this way rather than using
> DEFINE_PER_CPU and the related percpu helper functions.
Because in the IRQ entry point in assembler we have to look up the 
address of this CPU's IRQ stack. Doing so with a simple array can be 
done with fewer instructions than a per-cpu variable. The kernel stack 
pointer for each CPU is held in a similar array.

MIPS does not have a particularly optimized per-cpu implementation with 
the per-cpu offset being held somewhere easily accessible, so right now 
it has be looked up from the __per_cpu_offset array, and then applied to 
the per-cpu pointer. Obviously doing the first lookup is analogous to 
what I am doing, and the subsequent application to the per-cpu pointer 
would be additional instructions.

Thanks,
Matt

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] MIPS: Add per-cpu IRQ stack Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:40 +0100
  [PATCH 2/5] MIPS: Stack unwinding while on IRQ stack Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:40 +0100
  [PATCH 4/5] MIPS: Switch to the irq_stack in interrupts Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:40 +0100
  [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:50 +0100
    Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from  user mode "Maciej W. Rozycki" <macro@imgtec.com> - 2016-12-05 17:30 +0100
      Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from  user mode Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-05 18:00 +0100
        Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from  user mode "Maciej W. Rozycki" <macro@imgtec.com> - 2016-12-05 18:30 +0100
      Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from user mode Paul Burton <paul.burton@imgtec.com> - 2016-12-05 18:30 +0100
        Re: [PATCH 3/5] MIPS: Only change $28 to thread_info if coming from  user mode "Maciej W. Rozycki" <macro@imgtec.com> - 2016-12-05 19:00 +0100
  [PATCH 1/5] MIPS: Introduce irq_stack Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:50 +0100
    Re: [PATCH 1/5] MIPS: Introduce irq_stack "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-06 23:20 +0100
      Re: [PATCH 1/5] MIPS: Introduce irq_stack Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-07 10:30 +0100
  [PATCH 5/5] MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-02 14:50 +0100
  Re: [PATCH 0/5] MIPS: Add per-cpu IRQ stack "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-06 23:20 +0100
    Re: [PATCH 0/5] MIPS: Add per-cpu IRQ stack Matt Redfearn <matt.redfearn@imgtec.com> - 2016-12-07 10:40 +0100

csiph-web