linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info
@ 2015-05-24 16:01 Jungseok Lee
  2015-05-27  3:49 ` KOSAKI Motohiro
  0 siblings, 1 reply; 3+ messages in thread
From: Jungseok Lee @ 2015-05-24 16:01 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: barami97, KOSAKI Motohiro, linux-arm-kernel

A current implementation assumes thread_info address is always correctly
calculated via virt_to_page. It restricts a different approach, such as
thread_info allocation from vmalloc space.

This patch, thus, introduces an independent function to calculate page
address from thread_info one.

Suggested-by: Sungjinn Chung <barami97@gmail.com>
Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 kernel/fork.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 03c1eaa..6300bbd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -212,9 +212,14 @@ struct kmem_cache *vm_area_cachep;
 /* SLAB cache for mm_struct structures (tsk->mm) */
 static struct kmem_cache *mm_cachep;
 
+struct page * __weak arch_thread_info_to_page(struct thread_info *ti)
+{
+	return virt_to_page(ti);
+}
+
 static void account_kernel_stack(struct thread_info *ti, int account)
 {
-	struct zone *zone = page_zone(virt_to_page(ti));
+	struct zone *zone = page_zone(arch_thread_info_to_page(ti));
 
 	mod_zone_page_state(zone, NR_KERNEL_STACK, account);
 }
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info
  2015-05-24 16:01 [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info Jungseok Lee
@ 2015-05-27  3:49 ` KOSAKI Motohiro
  2015-05-27 15:19   ` Jungseok Lee
  0 siblings, 1 reply; 3+ messages in thread
From: KOSAKI Motohiro @ 2015-05-27  3:49 UTC (permalink / raw)
  To: Jungseok Lee; +Cc: LKML, linux-mm, barami97, linux-arm-kernel

On Sun, May 24, 2015 at 12:01 PM, Jungseok Lee <jungseoklee85@gmail.com> wrote:
> A current implementation assumes thread_info address is always correctly
> calculated via virt_to_page. It restricts a different approach, such as
> thread_info allocation from vmalloc space.
>
> This patch, thus, introduces an independent function to calculate page
> address from thread_info one.
>
> Suggested-by: Sungjinn Chung <barami97@gmail.com>
> Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  kernel/fork.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

I haven't receive a path [2/2] and haven't review whole patches. But
this patch itself is OK to me.
Acked-by: KOSAKI Motohiro <kosaki.motohiro@fujitsu.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info
  2015-05-27  3:49 ` KOSAKI Motohiro
@ 2015-05-27 15:19   ` Jungseok Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Jungseok Lee @ 2015-05-27 15:19 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: LKML, linux-mm, barami97, linux-arm-kernel

On May 27, 2015, at 12:49 PM, KOSAKI Motohiro wrote:

Hello, KOSAKI,

> On Sun, May 24, 2015 at 12:01 PM, Jungseok Lee <jungseoklee85@gmail.com> wrote:
>> A current implementation assumes thread_info address is always correctly
>> calculated via virt_to_page. It restricts a different approach, such as
>> thread_info allocation from vmalloc space.
>> 
>> This patch, thus, introduces an independent function to calculate page
>> address from thread_info one.
>> 
>> Suggested-by: Sungjinn Chung <barami97@gmail.com>
>> Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
>> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> ---
>> kernel/fork.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> I haven't receive a path [2/2] and haven't review whole patches. But
> this patch itself is OK to me.
> Acked-by: KOSAKI Motohiro <kosaki.motohiro@fujitsu.com>

Thanks!

I didn't add you to Cc list since [PATCH 2/2] is architecture specific.
According to the feedbacks, it is needed to figure out fundamental solutions:
1) reduce stack size and 2) focus on a generic anti-fragmentation logic.

Please refer to https://lkml.org/lkml/2015/5/24/121 for [PATCH 2/2].

Best Regards
Jungseok Lee
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-27 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 16:01 [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info Jungseok Lee
2015-05-27  3:49 ` KOSAKI Motohiro
2015-05-27 15:19   ` Jungseok Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).