linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: clameter@sgi.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, ak@suse.de, travis@sgi.com
Subject: [patch 1/2] x86_64: Clean up stack allocation and free
Date: Tue, 06 Nov 2007 16:43:58 -0800	[thread overview]
Message-ID: <20071107004710.642423857@sgi.com> (raw)
In-Reply-To: <20071107004357.233417373@sgi.com>

[-- Attachment #1: x86_64_stack_cleanup --]
[-- Type: text/plain, Size: 1619 bytes --]

Cleanup the allocation and freeing of stacks a bit by using a __GFP_ZERO
flag instead of memset.

Cc: ak@suse.de
Cc: travis@sgi.com
Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 include/asm-x86/thread_info_64.h |   16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

Index: linux-2.6/include/asm-x86/thread_info_64.h
===================================================================
--- linux-2.6.orig/include/asm-x86/thread_info_64.h	2007-10-12 12:41:32.000000000 -0700
+++ linux-2.6/include/asm-x86/thread_info_64.h	2007-11-06 15:38:22.000000000 -0800
@@ -74,20 +74,14 @@ static inline struct thread_info *stack_
 
 /* thread information allocation */
 #ifdef CONFIG_DEBUG_STACK_USAGE
-#define alloc_thread_info(tsk)					\
-    ({								\
-	struct thread_info *ret;				\
-								\
-	ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \
-	if (ret)						\
-		memset(ret, 0, THREAD_SIZE);			\
-	ret;							\
-    })
+#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
 #else
-#define alloc_thread_info(tsk) \
-	((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
+#define THREAD_FLAGS GFP_KERNEL
 #endif
 
+#define alloc_thread_info(tsk) \
+	((struct thread_info *) __get_free_pages(THREAD_FLAGS, THREAD_ORDER))
+
 #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
 
 #else /* !__ASSEMBLY__ */

-- 

--
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>

  reply	other threads:[~2007-11-07  0:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  0:43 [patch 0/2] X86_64 configurable stack size clameter
2007-11-07  0:43 ` clameter [this message]
2007-11-07 19:11   ` [patch 1/2] x86_64: Clean up stack allocation and free Andy Whitcroft
2007-11-07  0:43 ` [patch 2/2] x86_64: Configure stack size clameter
2007-11-07 19:14   ` Andy Whitcroft
2007-11-07 23:12     ` Andi Kleen
2007-11-08  0:42       ` Christoph Lameter
2007-11-09 20:13         ` Andrew Morton
2007-11-09 20:45           ` Christoph Lameter
2007-11-09 21:10             ` Andrew Morton
2007-11-09 21:19               ` Christoph Lameter
2007-11-09 21:46                 ` Andrew Morton
2007-11-09 21:50                   ` Christoph Lameter
2007-11-10 17:21           ` Andi Kleen

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=20071107004710.642423857@sgi.com \
    --to=clameter@sgi.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=travis@sgi.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