--- //depot/vendor/freebsd/src/sys/amd64/amd64/pmap.c 2009/07/19 21:45:13 +++ //depot/user/jhb/pat2/amd64/amd64/pmap.c 2009/07/21 14:20:38 @@ -3324,7 +3324,7 @@ int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { if (!vm_object_populate(object, pindex, pindex + atop(size))) --- //depot/vendor/freebsd/src/sys/arm/arm/pmap.c 2009/07/20 07:55:18 +++ //depot/user/jhb/pat2/arm/arm/pmap.c 2009/07/21 13:56:44 @@ -3101,7 +3101,7 @@ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } --- //depot/vendor/freebsd/src/sys/conf/files 2009/07/21 12:40:14 +++ //depot/user/jhb/pat2/conf/files 2009/07/21 13:56:44 @@ -2637,6 +2637,7 @@ vm/device_pager.c standard vm/phys_pager.c standard vm/redzone.c optional DEBUG_REDZONE +vm/sg_pager.c standard vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard --- //depot/vendor/freebsd/src/sys/fs/procfs/procfs_map.c 2009/06/23 20:55:15 +++ //depot/user/jhb/pat2/fs/procfs/procfs_map.c 2009/06/24 17:33:22 @@ -174,6 +174,7 @@ type = "swap"; vp = NULL; break; + case OBJT_SG: case OBJT_DEVICE: type = "device"; vp = NULL; --- //depot/vendor/freebsd/src/sys/i386/i386/pmap.c 2009/07/19 21:45:13 +++ //depot/user/jhb/pat2/i386/i386/pmap.c 2009/07/21 13:56:44 @@ -3448,7 +3448,7 @@ int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { --- //depot/vendor/freebsd/src/sys/i386/xen/pmap.c 2009/07/19 21:45:13 +++ //depot/user/jhb/pat2/i386/xen/pmap.c 2009/07/21 13:56:44 @@ -3093,7 +3093,7 @@ vm_page_t p; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { --- //depot/vendor/freebsd/src/sys/ia64/ia64/pmap.c 2009/07/11 22:30:13 +++ //depot/user/jhb/pat2/ia64/ia64/pmap.c 2009/07/13 18:26:01 @@ -1751,7 +1751,7 @@ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } --- //depot/vendor/freebsd/src/sys/kern/kern_proc.c 2009/06/19 17:15:16 +++ //depot/user/jhb/pat2/kern/kern_proc.c 2009/06/24 17:33:22 @@ -1486,6 +1486,9 @@ case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; @@ -1658,6 +1661,9 @@ case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; --- //depot/vendor/freebsd/src/sys/mips/mips/pmap.c 2009/06/23 22:54:36 +++ //depot/user/jhb/pat2/mips/mips/pmap.c 2009/06/24 17:33:22 @@ -2148,7 +2148,7 @@ vm_object_t object, vm_pindex_t pindex, vm_size_t size) { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } --- //depot/vendor/freebsd/src/sys/powerpc/booke/pmap.c 2009/06/23 22:54:36 +++ //depot/user/jhb/pat2/powerpc/booke/pmap.c 2009/06/24 17:33:22 @@ -2582,7 +2582,7 @@ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("mmu_booke_object_init_pt: non-device object")); } --- //depot/vendor/freebsd/src/sys/sparc64/sparc64/pmap.c 2009/06/28 22:45:13 +++ //depot/user/jhb/pat2/sparc64/sparc64/pmap.c 2009/07/13 18:26:01 @@ -1499,7 +1499,7 @@ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } --- //depot/vendor/freebsd/src/sys/sys/user.h 2009/06/19 17:15:16 +++ //depot/user/jhb/pat2/sys/user.h 2009/06/24 17:33:22 @@ -340,6 +340,7 @@ #define KVME_TYPE_DEVICE 4 #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 +#define KVME_TYPE_SG 7 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 --- //depot/vendor/freebsd/src/sys/vm/vm.h 2009/07/12 23:35:14 +++ //depot/user/jhb/pat2/vm/vm.h 2009/07/13 18:26:01 @@ -89,7 +89,7 @@ #define VM_PROT_DEFAULT VM_PROT_ALL enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS, - OBJT_DEAD }; + OBJT_DEAD, OBJT_SG }; typedef u_char objtype_t; union vm_map_object; --- //depot/vendor/freebsd/src/sys/vm/vm_fault.c 2009/07/03 22:20:28 +++ //depot/user/jhb/pat2/vm/vm_fault.c 2009/07/13 18:26:01 @@ -472,7 +472,8 @@ (fs.first_object == fs.object || (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && fs.first_object->type != OBJT_DEVICE && - fs.first_object->type != OBJT_PHYS) { + fs.first_object->type != OBJT_PHYS && + fs.first_object->type != OBJT_SG) { vm_pindex_t firstpindex, tmppindex; if (fs.first_pindex < 2 * VM_FAULT_READ) --- //depot/vendor/freebsd/src/sys/vm/vm_map.c 2009/07/12 12:40:14 +++ //depot/user/jhb/pat2/vm/vm_map.c 2009/07/13 18:26:01 @@ -1719,7 +1719,7 @@ if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; VM_OBJECT_LOCK(object); - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { pmap_object_init_pt(map->pmap, addr, object, pindex, size); goto unlock_return; } @@ -2247,7 +2247,8 @@ */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2366,7 +2367,8 @@ saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE; + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG); /* * Release the map lock, relying on the in-transition * mark. @@ -2462,7 +2464,8 @@ */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } next_entry_done: @@ -2595,7 +2598,8 @@ { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); entry->wired_count = 0; } --- //depot/vendor/freebsd/src/sys/vm/vm_meter.c 2009/01/23 22:50:14 +++ //depot/user/jhb/pat2/vm/vm_meter.c 2009/06/15 19:26:59 @@ -205,7 +205,7 @@ * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { /* * Devices, like /dev/mem, will badly skew our totals. */ --- //depot/vendor/freebsd/src/sys/vm/vm_object.c 2009/07/12 23:35:14 +++ //depot/user/jhb/pat2/vm/vm_object.c 2009/07/13 18:26:01 @@ -309,6 +309,7 @@ case OBJT_DEFAULT: case OBJT_DEVICE: case OBJT_PHYS: + case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: if (!TAILQ_EMPTY(&object->memq)) --- //depot/vendor/freebsd/src/sys/vm/vm_object.h 2009/07/12 23:35:14 +++ //depot/user/jhb/pat2/vm/vm_object.h 2009/07/13 18:26:01 @@ -124,6 +124,15 @@ } devp; /* + * SG pager + * + * sgp_pglist - list of allocated pages + */ + struct { + TAILQ_HEAD(, vm_page) sgp_pglist; + } sgp; + + /* * Swap pager * * swp_bcount - number of swap 'swblock' metablocks, each --- //depot/vendor/freebsd/src/sys/vm/vm_page.c 2009/07/18 01:55:25 +++ //depot/user/jhb/pat2/vm/vm_page.c 2009/07/21 14:20:38 @@ -1163,7 +1163,7 @@ if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE) + object->type != OBJT_DEVICE && object->type != OBJT_SG) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else --- //depot/vendor/freebsd/src/sys/vm/vm_pageout.c 2009/06/25 20:35:14 +++ //depot/user/jhb/pat2/vm/vm_pageout.c 2009/06/26 19:37:07 @@ -513,7 +513,9 @@ int actcount, rcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || first_object->type == OBJT_PHYS) + if (first_object->type == OBJT_DEVICE || + first_object->type == OBJT_SG || + first_object->type == OBJT_PHYS) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) --- //depot/vendor/freebsd/src/sys/vm/vm_pager.c 2009/06/25 20:35:14 +++ //depot/user/jhb/pat2/vm/vm_pager.c 2009/06/26 19:37:07 @@ -160,7 +160,8 @@ &vnodepagerops, /* OBJT_VNODE */ &devicepagerops, /* OBJT_DEVICE */ &physpagerops, /* OBJT_PHYS */ - &deadpagerops /* OBJT_DEAD */ + &deadpagerops, /* OBJT_DEAD */ + &sgpagerops /* OBJT_SG */ }; static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); --- //depot/vendor/freebsd/src/sys/vm/vm_pager.h 2009/06/25 20:35:14 +++ //depot/user/jhb/pat2/vm/vm_pager.h 2009/06/26 19:37:07 @@ -70,6 +70,7 @@ extern struct pagerops vnodepagerops; extern struct pagerops devicepagerops; extern struct pagerops physpagerops; +extern struct pagerops sgpagerops; /* * get/put return values