summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorkchow <none@none>2007-07-28 09:28:25 -0700
committerkchow <none@none>2007-07-28 09:28:25 -0700
commit4c36ab8840d241bee6c7f9b5c69205a9ffbd66dd (patch)
treefe5d5469aa540d51a9e1f0ecda59c1d21121587e /usr/src
parent567d55e140d6df8a327df15dac64a9a0c5b43c35 (diff)
downloadillumos-gate-4c36ab8840d241bee6c7f9b5c69205a9ffbd66dd.tar.gz
6585487 Incorrect handling of multiple mnodes in a given memseg impacts memory on Primepower systems
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/sun4/vm/vm_dep.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/uts/sun4/vm/vm_dep.h b/usr/src/uts/sun4/vm/vm_dep.h
index da9f35b778..6f150837f8 100644
--- a/usr/src/uts/sun4/vm/vm_dep.h
+++ b/usr/src/uts/sun4/vm/vm_dep.h
@@ -335,9 +335,16 @@ typedef struct {
* when memory is added (kphysm_add_memory_dynamic) or deleted
* (kphysm_del_cleanup).
*/
-#define PLCNT_MODIFY_MAX(pfn, cnt) { \
- int mn = PFN_2_MEM_NODE(pfn); \
- atomic_add_long(&plcnt[mn][MTYPE_RELOC].plc_mt_pgmax, (cnt)); \
+#define PLCNT_MODIFY_MAX(startpfn, cnt) { \
+ pfn_t pfn = startpfn, endpfn = startpfn + ABS(cnt); \
+ while (pfn < endpfn) { \
+ int mn = PFN_2_MEM_NODE(pfn); \
+ long inc = MIN(endpfn, mem_node_config[mn].physmax + 1) \
+ - pfn; \
+ pfn += inc; \
+ atomic_add_long(&plcnt[mn][MTYPE_RELOC].plc_mt_pgmax, \
+ ((cnt) < 0) ? -inc: inc); \
+ } \
}
extern plcnt_t plcnt;