From: Vaneet Narang <v.narang@samsung.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>,
Arnd Bergmann <arnd@kernel.org>
Cc: AMIT SAHRAWAT <a.sahrawat@samsung.com>,
Andrew Morton <akpm@linux-foundation.org>,
Marc Zyngier <maz@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Vincent Whitchurch <vincent.whitchurch@axis.com>,
Nick Desaulniers <ndesaulniers@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Valentin Schneider <valentin.schneider@arm.com>,
Dmitry Safonov <0x7f454c46@gmail.com>,
Maninder Singh <maninder1.s@samsung.com>,
Thomas Gleixner <tglx@linutronix.de>,
Nathan Huckleberry <nhuck@google.com>,
Will Deacon <will@kernel.org>, Jian Cai <caij2003@gmail.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH 2/3] arm: introduce IRQ stacks
Date: Wed, 21 Oct 2020 19:16:53 +0530 [thread overview]
Message-ID: <20201021134653epcms5p7a6932d1304c604b224a04025c6f0153e@epcms5p7> (raw)
In-Reply-To: <20201021125740.GM1551@shell.armlinux.org.uk>
Hi Russel & Arnd,
> > > - define 'current' as 'this_cpu_read_stable(current_task);'
> > > - convert to CONFIG_THREAD_INFO_IN_TASK
>
unlike ARM64 ARM doesn't suport dedicated register like "sp_el0", so
arm still stores thread info on stack and fetches using current task using
stack pointer (SP) so CONFIG_THREAD_INFO_IN_TASK is not supported on ARM.
To implement solution inline with current ARM design, we have used indirection.
> That means we need to also code that up in assembly - remember, we
> need to access thread_info from assembly code.
> Note also that there is a circular dependency involved. If you make
> thread_info accessible via per-cpu, then:
> "We don't do it because we don't have a separate register to be able
> to store the thread_info pointer, and copying that lump between the
> SVC and IRQ stack will add massively to IRQ latency, especially for
> older machines."
We tried to minimize latency in switching between SVC stack and IRQ stack
by just copying extra thread info pointer to IRQ stack. Apart from this,
Most of the code of SVC to IRQ switching is similar to ARM64 implementation.
Also We tried to minimize latency of get_current() by introducting self pointer in
SVC stack to avoid if check to determine, is current is called from SVC context
or IRQ context. This way will always do one extra indirection in get_current,
irrespective get_current is called from SVC or IRQ context.
Yes we agree still there will be minor additional latency on accessing current
task and SVC to IRQ switching which might be significant for older machines,
So this is the reason why we kept this sol. under kconfig. This solution
provides extra stack to kernel developers for further development,instead of increasing
stack size to 16KB or spending time on debugging stack overflow issues.
PS: We have debugged and resolved stack overflow issue but we still implemented this sol. to avoid
debugging such issues in future also it gives us flexibility for kernel enhancement on ARM.
Thanks & Regards,
Vaneet Narang
next prev parent reply other threads:[~2020-10-21 14:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201008071628epcas5p24d196a6023a47a3b0bfa7b7f231ec811@epcas5p2.samsung.com>
2020-10-08 7:15 ` [PATCH 0/3] IRQ stack support for ARM Maninder Singh
[not found] ` <CGME20201008071633epcas5p20f5c533ac67ab235997e7e4a8ad3022b@epcas5p2.samsung.com>
2020-10-08 7:15 ` [PATCH 1/3] arm: introduce self pointer in thread info Maninder Singh
[not found] ` <CGME20201008071639epcas5p465f13d992a25936ba63436baf1fb6f83@epcas5p4.samsung.com>
2020-10-08 7:15 ` [PATCH 2/3] arm: introduce IRQ stacks Maninder Singh
[not found] ` <CAK8P3a2RYeNiTy9QmwFVKtFifXxWc9XfAT6ThPoSH9wGYsKGpA@mail.gmail.com>
2020-10-21 12:42 ` Arnd Bergmann
2020-10-21 12:45 ` Russell King - ARM Linux admin
2020-10-21 12:55 ` Arnd Bergmann
2020-10-21 12:57 ` Russell King - ARM Linux admin
2020-10-21 15:59 ` Arnd Bergmann
2020-11-09 14:45 ` Tony Lindgren
2020-11-09 19:10 ` Arnd Bergmann
2020-11-10 9:19 ` Tony Lindgren
2020-11-10 10:04 ` Arnd Bergmann
2020-11-10 12:04 ` Tony Lindgren
2020-11-10 13:35 ` Arnd Bergmann
2020-11-11 6:56 ` Tony Lindgren
[not found] ` <CGME20201008071639epcas5p465f13d992a25936ba63436baf1fb6f83@epcms5p7>
2020-10-21 13:46 ` Vaneet Narang [this message]
[not found] ` <CGME20201008071644epcas5p1f5c220b5f58fd4251695af147325b7c4@epcas5p1.samsung.com>
2020-10-08 7:15 ` [PATCH 3/3] arm: Modify stack trace and dump for use with irq stack Maninder Singh
2020-10-08 7:53 ` [PATCH 0/3] IRQ stack support for ARM Sebastian Andrzej Siewior
2020-10-08 8:30 ` Russell King - ARM Linux admin
2020-10-15 20:59 ` Nick Desaulniers
2020-10-15 21:16 ` Florian Fainelli
[not found] ` <CAK8P3a0h=D8_Kn_fpHbsik_jf4to2jayxj7K7B7=HaNFzKqNnw@mail.gmail.com>
2020-10-21 11:58 ` Arnd Bergmann
2020-10-21 12:34 ` Russell King - ARM Linux admin
2020-10-21 12:46 ` Arnd Bergmann
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=20201021134653epcms5p7a6932d1304c604b224a04025c6f0153e@epcms5p7 \
--to=v.narang@samsung.com \
--cc=0x7f454c46@gmail.com \
--cc=a.sahrawat@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=caij2003@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maninder1.s@samsung.com \
--cc=maz@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nhuck@google.com \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=vincent.whitchurch@axis.com \
--cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®