diff options
| author | Tony Luck <tony.luck@intel.com> | 2005-10-28 17:32:56 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2005-10-28 17:32:56 -0400 |
| commit | c87ff94333642ce3db4fc0857ad1f723cb42c1dd (patch) | |
| tree | 9577010b5ca20b692904c4728b305a9cbde5373e /arch/ia64/mm/numa.c | |
| parent | 556902cd2d2cfdc54fe1f1d7f3ac5e2eb276ac09 (diff) | |
| parent | 1e5c936e3cc2ab745f66c0ae296c42f892ffd42a (diff) | |
Pull sparsemem-v5 into release branch
Diffstat (limited to 'arch/ia64/mm/numa.c')
| -rw-r--r-- | arch/ia64/mm/numa.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index 77118bbf3d8b..4e5c8b36ad93 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c | |||
| @@ -47,3 +47,27 @@ paddr_to_nid(unsigned long paddr) | |||
| 47 | 47 | ||
| 48 | return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0); | 48 | return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0); |
| 49 | } | 49 | } |
| 50 | |||
| 51 | #if defined(CONFIG_SPARSEMEM) && defined(CONFIG_NUMA) | ||
| 52 | /* | ||
| 53 | * Because of holes evaluate on section limits. | ||
| 54 | * If the section of memory exists, then return the node where the section | ||
| 55 | * resides. Otherwise return node 0 as the default. This is used by | ||
| 56 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where | ||
| 57 | * the section resides. | ||
| 58 | */ | ||
| 59 | int early_pfn_to_nid(unsigned long pfn) | ||
| 60 | { | ||
| 61 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; | ||
| 62 | |||
| 63 | for (i = 0; i < num_node_memblks; i++) { | ||
| 64 | ssec = node_memblk[i].start_paddr >> PA_SECTION_SHIFT; | ||
| 65 | esec = (node_memblk[i].start_paddr + node_memblk[i].size + | ||
| 66 | ((1L << PA_SECTION_SHIFT) - 1)) >> PA_SECTION_SHIFT; | ||
| 67 | if (section >= ssec && section < esec) | ||
| 68 | return node_memblk[i].nid; | ||
| 69 | } | ||
| 70 | |||
| 71 | return 0; | ||
| 72 | } | ||
| 73 | #endif | ||
