All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Picco <bob.picco@hp.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] pfn_to_nid
Date: Tue, 21 Jun 2005 10:22:34 +0000	[thread overview]
Message-ID: <20050621102234.GF23911@localhost.localdomain> (raw)

Tony,

This didn't make it into -mm.  So current -mm is broken for the
same reason which previous -mm was broken. Below is the text from the original 
post. 

Bjorn posted on IRC a problem building 2.6.12-rc6-mm1. pfn_to_nid is undefined.
We haven't had this interface on ia64.  The problem was introduced in a recent
sys_mbind change.  Bjorn has compiled, linked and booted the patch for me.

Oh, the paddr_to_nid call could fail when DISCONTIG+NUMA is configured
because there isn't any ACPI SRAT NUMA information.

bob

Signed-off-by: Bob Picco <bob.picco@hp.com>


Index: linux-2.6.12-rc6-mm1/include/asm-ia64/mmzone.h
=================================--- linux-2.6.12-rc6-mm1.orig/include/asm-ia64/mmzone.h	2005-06-07 13:36:51.000000000 -0400
+++ linux-2.6.12-rc6-mm1/include/asm-ia64/mmzone.h	2005-06-07 14:48:17.000000000 -0400
@@ -15,6 +15,20 @@
 #include <asm/page.h>
 #include <asm/meminit.h>
 
+static inline int pfn_to_nid(unsigned long pfn)
+{
+#ifdef CONFIG_NUMA
+	extern int paddr_to_nid(unsigned long);
+	int nid = paddr_to_nid(pfn << PAGE_SHIFT);
+	if (nid < 0)
+		return 0;
+	else
+		return nid;
+#else
+	return 0;
+#endif
+}
+
 #ifdef CONFIG_DISCONTIGMEM
 
 #ifdef CONFIG_IA64_DIG /* DIG systems are small */

                 reply	other threads:[~2005-06-21 10:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050621102234.GF23911@localhost.localdomain \
    --to=bob.picco@hp.com \
    --cc=linux-ia64@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.