linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: Lee.Schermerhorn@hp.com, ak@suse.de, clameter@sgi.com
Cc: Mel Gorman <mel@csn.ul.ie>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 6/6] Do not use FASTCALL for __alloc_pages_nodemask()
Date: Fri, 17 Aug 2007 21:18:48 +0100 (IST)	[thread overview]
Message-ID: <20070817201848.14792.58117.sendpatchset@skynet.skynet.ie> (raw)
In-Reply-To: <20070817201647.14792.2690.sendpatchset@skynet.skynet.ie>


One PPC64 machine using gcc 3.4.6 the machine fails to boot when
__alloc_pages_nodemask() uses the FASTCALL calling convention. It is not
clear why this machine in particular is affected as other PPC64 machines
boot. The only usual aspect of the machine is that it has memoryless nodes
but I couldn't see any problem using them. The error received looks like

Initializing hardware...  storageUnable to handle kernel paging request for data at address 0xffffffff
Faulting instruction address: 0xc0000000001aaa0c
cpu 0x4: Vector: 300 (Data Access) at [c00000000fea7650]
    pc: c0000000001aaa0c: .strnlen+0x10/0x3c
    lr: c0000000001ab880: .vsnprintf+0x378/0x644
    sp: c00000000fea78d0
   msr: 9000000000009032
   dar: ffffffff
 dsisr: 40000000
  current = 0xc00000003fe4d7a0
  paca    = 0xc000000000487300
    pid   = 1178, comm = 05-wait_for_sys
enter ? for help
[link register   ] c0000000001ab880 .vsnprintf+0x378/0x644
[c00000000fea78d0] c0000000003cad35 (unreliable)
[c00000000fea7990] c0000000001abc70 .sprintf+0x3c/0x4c
[c00000000fea7a10] c00000000021d5c0 .show_uevent+0x150/0x1a4
[c00000000fea7bb0] c00000000021cedc .dev_attr_show+0x44/0x60
[c00000000fea7c30] c000000000143874 .sysfs_read_file+0x128/0x208
[c00000000fea7cf0] c0000000000d71bc .vfs_read+0x134/0x1f8
[c00000000fea7d90] c0000000000d75f4 .sys_read+0x4c/0x8c
[c00000000fea7e30] c00000000000852c syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 000000000ff65894
SP (ff90f730) is in userspace


This patch creates an inline version of __alloc_pages called
__alloc_pages_internal() which allows the machine to boot. Both __alloc_pages
and __alloc_pages_nodemask use this interal function but only __alloc_pages()
uses FASTCALL.

Opinions as to why FASTCALL breaks on one machine are welcome.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---

 include/linux/gfp.h |    3 +--
 mm/page_alloc.c     |   13 ++++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc3-030_filter_nodemask/include/linux/gfp.h linux-2.6.23-rc3-035_nofastcall/include/linux/gfp.h
--- linux-2.6.23-rc3-030_filter_nodemask/include/linux/gfp.h	2007-08-17 16:56:36.000000000 +0100
+++ linux-2.6.23-rc3-035_nofastcall/include/linux/gfp.h	2007-08-17 17:00:37.000000000 +0100
@@ -142,8 +142,7 @@ extern struct page *
 FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *));
 
 extern struct page *
-FASTCALL(__alloc_pages_nodemask(gfp_t, unsigned int,
-				struct zonelist *, nodemask_t *nodemask));
+__alloc_pages_nodemask(gfp_t, unsigned int, struct zonelist *, nodemask_t *);
 
 static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
 						unsigned int order)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc3-030_filter_nodemask/mm/page_alloc.c linux-2.6.23-rc3-035_nofastcall/mm/page_alloc.c
--- linux-2.6.23-rc3-030_filter_nodemask/mm/page_alloc.c	2007-08-17 17:00:27.000000000 +0100
+++ linux-2.6.23-rc3-035_nofastcall/mm/page_alloc.c	2007-08-17 17:00:37.000000000 +0100
@@ -1222,8 +1222,8 @@ try_next_zone:
 /*
  * This is the 'heart' of the zoned buddy allocator.
  */
-struct page * fastcall
-__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
+static inline struct page *
+__alloc_pages_internal(gfp_t gfp_mask, unsigned int order,
 			struct zonelist *zonelist, nodemask_t *nodemask)
 {
 	const gfp_t wait = gfp_mask & __GFP_WAIT;
@@ -1396,11 +1396,18 @@ got_pg:
 	return page;
 }
 
+struct page *
+__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
+			struct zonelist *zonelist, nodemask_t *nodemask)
+{
+	return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask);
+}
+
 struct page * fastcall
 __alloc_pages(gfp_t gfp_mask, unsigned int order,
 		struct zonelist *zonelist)
 {
-	return __alloc_pages_nodemask(gfp_mask, order, zonelist, NULL);
+	return __alloc_pages_internal(gfp_mask, order, zonelist, NULL);
 }
 
 

  parent reply	other threads:[~2007-08-17 20:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 20:16 [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v4 Mel Gorman
2007-08-17 20:17 ` [PATCH 1/6] Use zonelists instead of zones when direct reclaiming pages Mel Gorman
2007-08-17 20:17 ` [PATCH 2/6] Use one zonelist that is filtered instead of multiple zonelists Mel Gorman
2007-08-17 20:59   ` Christoph Lameter
2007-08-21  8:51     ` Mel Gorman
2007-08-17 20:17 ` [PATCH 3/6] Embed zone_id information within the zonelist->zones pointer Mel Gorman
2007-08-17 21:02   ` Christoph Lameter
2007-08-21  8:54     ` Mel Gorman
2007-08-17 20:18 ` [PATCH 4/6] Record how many zones can be safely skipped in the zonelist Mel Gorman
2007-08-17 21:03   ` Christoph Lameter
2007-08-21  8:58     ` Mel Gorman
2007-08-17 20:18 ` [PATCH 5/6] Filter based on a nodemask as well as a gfp_mask Mel Gorman
2007-08-17 21:29   ` Christoph Lameter
2007-08-21  9:12     ` Mel Gorman
2007-08-17 20:18 ` Mel Gorman [this message]
2007-08-17 21:07   ` [PATCH 6/6] Do not use FASTCALL for __alloc_pages_nodemask() Christoph Lameter
2007-08-18 12:51     ` Andi Kleen
2007-08-21 10:25       ` Mel Gorman

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=20070817201848.14792.58117.sendpatchset@skynet.skynet.ie \
    --to=mel@csn.ul.ie \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).