vm_radix.c (249211) | vm_radix.c (249221) |
---|---|
1/* 2 * Copyright (c) 2013 EMC Corp. 3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 35 unchanged lines hidden (view full) --- 44 * the number of insert and remove operations. This basically implies 45 * that optimizations supposedly helping one operation but hurting the 46 * other might be carefully evaluated. 47 * - On average not many nodes are expected to be fully populated, hence 48 * level compression may just complicate things. 49 */ 50 51#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2013 EMC Corp. 3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 35 unchanged lines hidden (view full) --- 44 * the number of insert and remove operations. This basically implies 45 * that optimizations supposedly helping one operation but hurting the 46 * other might be carefully evaluated. 47 * - On average not many nodes are expected to be fully populated, hence 48 * level compression may just complicate things. 49 */ 50 51#include <sys/cdefs.h> |
52__FBSDID("$FreeBSD: head/sys/vm/vm_radix.c 249211 2013-04-06 18:04:35Z alc $"); | 52__FBSDID("$FreeBSD: head/sys/vm/vm_radix.c 249221 2013-04-07 01:30:51Z alc $"); |
53 54#include "opt_ddb.h" 55 56#include <sys/param.h> 57#include <sys/systm.h> 58#include <sys/kernel.h> 59#include <sys/vmmeter.h> 60 --- 28 unchanged lines hidden (view full) --- 89#define VM_RADIX_FLAGS 0x1 90#define VM_RADIX_PAD VM_RADIX_FLAGS 91 92/* Returns one unit associated with specified level. */ 93#define VM_RADIX_UNITLEVEL(lev) \ 94 ((vm_pindex_t)1 << ((VM_RADIX_LIMIT - (lev)) * VM_RADIX_WIDTH)) 95 96struct vm_radix_node { | 53 54#include "opt_ddb.h" 55 56#include <sys/param.h> 57#include <sys/systm.h> 58#include <sys/kernel.h> 59#include <sys/vmmeter.h> 60 --- 28 unchanged lines hidden (view full) --- 89#define VM_RADIX_FLAGS 0x1 90#define VM_RADIX_PAD VM_RADIX_FLAGS 91 92/* Returns one unit associated with specified level. */ 93#define VM_RADIX_UNITLEVEL(lev) \ 94 ((vm_pindex_t)1 << ((VM_RADIX_LIMIT - (lev)) * VM_RADIX_WIDTH)) 95 96struct vm_radix_node { |
97 void *rn_child[VM_RADIX_COUNT]; /* Child nodes. */ | |
98 vm_pindex_t rn_owner; /* Owner of record. */ 99 uint16_t rn_count; /* Valid children. */ 100 uint16_t rn_clev; /* Current level. */ | 97 vm_pindex_t rn_owner; /* Owner of record. */ 98 uint16_t rn_count; /* Valid children. */ 99 uint16_t rn_clev; /* Current level. */ |
100 void *rn_child[VM_RADIX_COUNT]; /* Child nodes. */ |
|
101}; 102 103static uma_zone_t vm_radix_node_zone; 104 105/* 106 * Allocate a radix node. Pre-allocation should ensure that the request 107 * will always be satisfied. 108 */ --- 61 unchanged lines hidden (view full) --- 170 171/* 172 * Get the root node for a radix tree. 173 */ 174static __inline struct vm_radix_node * 175vm_radix_getroot(struct vm_radix *rtree) 176{ 177 | 101}; 102 103static uma_zone_t vm_radix_node_zone; 104 105/* 106 * Allocate a radix node. Pre-allocation should ensure that the request 107 * will always be satisfied. 108 */ --- 61 unchanged lines hidden (view full) --- 170 171/* 172 * Get the root node for a radix tree. 173 */ 174static __inline struct vm_radix_node * 175vm_radix_getroot(struct vm_radix *rtree) 176{ 177 |
178 return ((struct vm_radix_node *)(rtree->rt_root & ~VM_RADIX_FLAGS)); | 178 return ((struct vm_radix_node *)rtree->rt_root); |
179} 180 181/* 182 * Set the root node for a radix tree. 183 */ 184static __inline void 185vm_radix_setroot(struct vm_radix *rtree, struct vm_radix_node *rnode) 186{ --- 578 unchanged lines hidden --- | 179} 180 181/* 182 * Set the root node for a radix tree. 183 */ 184static __inline void 185vm_radix_setroot(struct vm_radix *rtree, struct vm_radix_node *rnode) 186{ --- 578 unchanged lines hidden --- |