From: Jungseok Lee <jungseoklee85@gmail.com>
To: Pratyush Anand <panand@redhat.com>
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
linux-arm-kernel@lists.infradead.org, james.morse@arm.com,
takahiro.akashi@linaro.org, mark.rutland@arm.com,
barami97@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] arm64: Introduce IRQ stack
Date: Thu, 8 Oct 2015 23:32:43 +0900 [thread overview]
Message-ID: <66863807-964F-41D1-9788-D0FD8E79ADB6@gmail.com> (raw)
In-Reply-To: <20151008102520.GA10912@dhcppc13.redhat.com>
On Oct 8, 2015, at 7:25 PM, Pratyush Anand wrote:
> Hi Jungseok,
Hi Pratyush,
>
> On 07/10/2015:03:28:11 PM, Jungseok Lee wrote:
>> Currently, kernel context and interrupts are handled using a single
>> kernel stack navigated by sp_el1. This forces a system to use 16KB
>> stack, not 8KB one. This restriction makes low memory platforms suffer
>> from memory pressure accompanied by performance degradation.
>
> How will it behave on 64K Page system? There, it would take atleast 64K per cpu,
> right?
It would take 16KB per cpu even on 64KB page system.
The following code snippet from kernel/fork.c would be helpful.
----8<----
# if THREAD_SIZE >= PAGE_SIZE
static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
int node)
{
struct page *page = alloc_kmem_pages_node(node, THREADINFO_GFP,
THREAD_SIZE_ORDER);
return page ? page_address(page) : NULL;
}
static inline void free_thread_info(struct thread_info *ti)
{
free_kmem_pages((unsigned long)ti, THREAD_SIZE_ORDER);
}
# else
static struct kmem_cache *thread_info_cache;
static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
int node)
{
return kmem_cache_alloc_node(thread_info_cache, THREADINFO_GFP, node);
}
static void free_thread_info(struct thread_info *ti)
{
kmem_cache_free(thread_info_cache, ti);
}
void thread_info_cache_init(void)
{
thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
THREAD_SIZE, 0, NULL);
BUG_ON(thread_info_cache == NULL);
}
# endif
----8<----
>
>> +int alloc_irq_stack(unsigned int cpu)
>> +{
>> + void *stack;
>> +
>> + if (per_cpu(irq_stacks, cpu).stack)
>> + return 0;
>> +
>> + stack = (void *)__get_free_pages(THREADINFO_GFP, THREAD_SIZE_ORDER);
>
> Above would not compile for 64K pages as THREAD_SIZE_ORDER is only defined for
> non 64K. This need to be fixed.
Thanks for pointing it out! I will update it.
Best Regards
Jungseok Lee
next prev parent reply other threads:[~2015-10-08 14:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 15:28 [PATCH v4 0/2] " Jungseok Lee
2015-10-07 15:28 ` [PATCH v4 1/2] " Jungseok Lee
2015-10-08 10:25 ` Pratyush Anand
2015-10-08 14:32 ` Jungseok Lee [this message]
2015-10-08 16:51 ` Pratyush Anand
2015-10-07 15:28 ` [PATCH v4 2/2] arm64: Expand the stack trace feature to support " Jungseok Lee
2015-10-09 14:24 ` James Morse
2015-10-12 14:53 ` Jungseok Lee
2015-10-12 16:34 ` James Morse
2015-10-12 22:13 ` Jungseok Lee
2015-10-13 11:00 ` James Morse
2015-10-13 15:00 ` Jungseok Lee
2015-10-14 12:12 ` Jungseok Lee
2015-10-15 15:59 ` James Morse
2015-10-16 13:01 ` Jungseok Lee
2015-10-16 16:06 ` Catalin Marinas
2015-10-17 13:38 ` Jungseok Lee
2015-10-19 16:18 ` Catalin Marinas
2015-10-20 13:08 ` Jungseok Lee
2015-10-21 15:14 ` Jungseok Lee
2015-10-14 7:13 ` AKASHI Takahiro
2015-10-14 12:24 ` Jungseok Lee
2015-10-14 12:55 ` Jungseok Lee
2015-10-15 4:19 ` AKASHI Takahiro
2015-10-15 13:39 ` Jungseok Lee
2015-10-19 6:47 ` AKASHI Takahiro
2015-10-20 13:19 ` Jungseok Lee
2015-10-15 14:24 ` Jungseok Lee
2015-10-15 16:01 ` James Morse
2015-10-16 13:02 ` Jungseok Lee
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=66863807-964F-41D1-9788-D0FD8E79ADB6@gmail.com \
--to=jungseoklee85@gmail.com \
--cc=barami97@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=panand@redhat.com \
--cc=takahiro.akashi@linaro.org \
--cc=will.deacon@arm.com \
/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®