diff options
author | kchow <none@none> | 2006-02-12 20:51:59 -0800 |
---|---|---|
committer | kchow <none@none> | 2006-02-12 20:51:59 -0800 |
commit | 4944b02ebdb42bbb8031cd6158822d445f03f9de (patch) | |
tree | f63fe7b51bd0cb185e79fd7c6fd05c5f9391f403 /usr/src | |
parent | 0a64e869f2f81a72b403c27c7550d6576563f79d (diff) | |
download | illumos-joyent-4944b02ebdb42bbb8031cd6158822d445f03f9de.tar.gz |
6377034 setting physmem in /etc/system does not have desired effect on x86
6382469 zfs_map() is not initializing all fields in segvn_crargs_t on call to as_map/segvn_create
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/conf/param.c | 11 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/zfs_vnops.c | 2 | ||||
-rw-r--r-- | usr/src/uts/i86pc/os/startup.c | 51 |
3 files changed, 23 insertions, 41 deletions
diff --git a/usr/src/uts/common/conf/param.c b/usr/src/uts/common/conf/param.c index 9abf7b0f8a..6519a36a30 100644 --- a/usr/src/uts/common/conf/param.c +++ b/usr/src/uts/common/conf/param.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -538,10 +538,19 @@ param_calc(int platform_max_nprocs) * Note: 2^20 is a meg; shifting right by (20 - PAGESHIFT) * converts pages to megs without integer overflow. */ +#if defined(__sparc) if (physmem > original_physmem) { physmem = original_physmem; cmn_err(CE_NOTE, "physmem limited to %ld", physmem); } +#else + if (physmem != original_physmem) { + cmn_err(CE_NOTE, "physmem cannot be modified to 0x%lx" + " via /etc/system. Please use eeprom(1M) instead.", + physmem); + physmem = original_physmem; + } +#endif if (maxusers == 0) { pgcnt_t physmegs = physmem >> (20 - PAGESHIFT); pgcnt_t virtmegs = vmem_size(heap_arena, VMEM_FREE) >> 20; diff --git a/usr/src/uts/common/fs/zfs/zfs_vnops.c b/usr/src/uts/common/fs/zfs/zfs_vnops.c index 959a3122e0..a7fb0c5bd7 100644 --- a/usr/src/uts/common/fs/zfs/zfs_vnops.c +++ b/usr/src/uts/common/fs/zfs/zfs_vnops.c @@ -3299,6 +3299,8 @@ zfs_map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp, vn_a.cred = cr; vn_a.amp = NULL; vn_a.flags = flags & ~MAP_TYPE; + vn_a.szc = 0; + vn_a.lgrp_mem_policy_flags = 0; error = as_map(as, *addrp, len, segvn_create, &vn_a); diff --git a/usr/src/uts/i86pc/os/startup.c b/usr/src/uts/i86pc/os/startup.c index 1766aa0d81..f097b4357c 100644 --- a/usr/src/uts/i86pc/os/startup.c +++ b/usr/src/uts/i86pc/os/startup.c @@ -977,10 +977,13 @@ startup_memlist(void) * the computed value unless it is larger than the real * amount of memory on hand. */ - if (physmem == 0 || physmem > npages) + if (physmem == 0 || physmem > npages) { physmem = npages; - else + } else if (physmem < npages) { + cmn_err(CE_WARN, "limiting physmem to 0x%lx of" + " 0x%lx available pages", physmem, npages); npages = physmem; + } PRM_DEBUG(physmem); /* @@ -1674,44 +1677,6 @@ startup_vm(void) p0_va = i86devmap(0, 1, PROT_READ); PRM_DEBUG(p0_va); - /* - * If the following is true, someone has patched phsymem to be less - * than the number of pages that the system actually has. Remove - * pages until system memory is limited to the requested amount. - * Since we have allocated page structures for all pages, we - * correct the amount of memory we want to remove by the size of - * the memory used to hold page structures for the non-used pages. - */ - if (physmem < npages) { - uint_t diff; - offset_t off; - struct page *pp; - caddr_t rand_vaddr; - struct seg kseg; - - cmn_err(CE_WARN, "limiting physmem to %lu pages", physmem); - - off = 0; - diff = npages - physmem; - diff -= mmu_btopr(diff * sizeof (struct page)); - kseg.s_as = &kas; - while (diff--) { - rand_vaddr = (caddr_t) - (((uintptr_t)&unused_pages_vp >> 7) ^ - (uintptr_t)((u_offset_t)off >> MMU_PAGESHIFT)); - pp = page_create_va(&unused_pages_vp, off, MMU_PAGESIZE, - PG_WAIT | PG_EXCL, &kseg, rand_vaddr); - if (pp == NULL) { - panic("limited physmem too much!"); - /*NOTREACHED*/ - } - page_io_unlock(pp); - page_downgrade(pp); - availrmem--; - off += MMU_PAGESIZE; - } - } - cmn_err(CE_CONT, "?mem = %luK (0x%lx)\n", physinstalled << (MMU_PAGESHIFT - 10), ptob(physinstalled)); @@ -2549,6 +2514,12 @@ get_system_configuration() } else { segmapfreelists = (int)lvalue; } + + if ((BOP_GETPROPLEN(bootops, "physmem") <= sizeof (prop)) && + (BOP_GETPROP(bootops, "physmem", prop) >= 0) && + (kobj_getvalue(prop, &lvalue) != -1)) { + physmem = (uintptr_t)lvalue; + } } /* |