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


Groups > linux.kernel > #1227027

Re: [PATCH v2] arm64: Introduce IRQ stack

From Jungseok Lee <jungseoklee85@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] arm64: Introduce IRQ stack
Date 2015-09-17 15:30 +0200
Message-ID <q9Hqa-4OV-9@gated-at.bofh.it> (permalink)
References <q8gLo-29u-1@gated-at.bofh.it> <q9Fol-1Tl-3@gated-at.bofh.it> <q9Hgt-4Dp-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sep 17, 2015, at 10:17 PM, Jungseok Lee wrote:
> On Sep 17, 2015, at 8:17 PM, Catalin Marinas wrote:
> 
> Hi Catalin,
> 
>> On Sun, Sep 13, 2015 at 02:42:17PM +0000, Jungseok Lee wrote:
>>> Currently, kernel context and interrupts are handled using a single
>>> kernel stack navigated by sp_el1. This forces many systems to use
>>> 16KB stack, not 8KB one. Low memory platforms naturally suffer from
>>> memory pressure accompanied by performance degradation.
>>> 
>>> This patch addresses the issue as introducing a separate percpu IRQ
>>> stack to handle both hard and soft interrupts with two ground rules:
>>> 
>>> - Utilize sp_el0 in EL1 context, which is not used currently
>>> - Do not complicate current_thread_info calculation
>>> 
>>> It is a core concept to trace struct thread_info using sp_el0 instead
>>> of sp_el1. This approach helps arm64 align with other architectures
>>> regarding object_is_on_stack() without additional complexity.
>> 
>> I'm still trying to understand how this patch works. I initially thought
>> that we would set SPSel = 0 while in kernel thread mode to make use of
>> SP_EL0 but I can't find any such code. Do you still use SP_EL1 all the
>> time and SP_EL0 just for temporary saving the thread stack?
> 
> Exactly.
> 
> My first approach was to set SPSel = 0 and implement EL1t Sync and IRQ.
> This idea originally comes from your comment [1]. A kernel thread could
> be handled easily and neatly, but it complicated current_thread_info
> calculation due to a user process.
> 
> Let's assume that a kernel thread uses SP_EL0 by default. When an interrupt
> comes in, a core jumps to EL1t IRQ. In case of a user process, a CPU goes
> into EL1h IRQ when an interrupt raises. To handle this scenario correctly,
> SPSel or spsr_el1 should be referenced. This reaches to quite big overhead
> in current_thread_info function.

This statement is described incorrectly. In case of user process, a CPU goes
into EL0 IRQ. Under this context, another interrupt could come in. At this
time, a core jumps to EL1h IRQ.

My original intention is to describe this situation.

Sorry for confusion.

Best Regards
Jungseok Lee
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-13 16:50 +0200
  Re: [PATCH v2] arm64: Introduce IRQ stack Will Deacon <will.deacon@arm.com> - 2015-09-16 13:30 +0200
    Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-17 12:40 +0200
      Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 12:50 +0200
      Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 14:40 +0200
        Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 19:10 +0200
          Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-18 15:10 +0200
  Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 13:20 +0200
    Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 15:20 +0200
      Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 15:30 +0200
        Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 18:30 +0200
          Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-18 15:00 +0200
            Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-18 15:50 +0200
            Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-18 17:10 +0200
              Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-18 17:40 +0200
                Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-19 10:50 +0200
                Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-21 11:30 +0200
                Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-21 14:20 +0200
  Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-18 15:50 +0200
    Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-19 10:30 +0200

csiph-web