Changeset View
Standalone View
sys/sys/vnode.h
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | struct vnode { | ||||
struct lock v_lock; /* u (if fs don't have one) */ | struct lock v_lock; /* u (if fs don't have one) */ | ||||
struct mtx v_interlock; /* lock for "i" things */ | struct mtx v_interlock; /* lock for "i" things */ | ||||
struct lock *v_vnlock; /* u pointer to vnode lock */ | struct lock *v_vnlock; /* u pointer to vnode lock */ | ||||
/* | /* | ||||
* The machinery of being a vnode | * The machinery of being a vnode | ||||
*/ | */ | ||||
TAILQ_ENTRY(vnode) v_actfreelist; /* l vnode active/free lists */ | TAILQ_ENTRY(vnode) v_actfreelist; /* l vnode active/free lists */ | ||||
TAILQ_ENTRY(vnode) v_dirtylist; /* l vnode dirty list */ | |||||
kib: This is the part that I dislike most from the whole patch. It blows struct vnode by 16 bytes… | |||||
Not Done Inline ActionsThe internal fragmentation in the slab means there's more space here before we actually consume more physical memory. It is a step function on PAGE_SIZE / sizeof(vnode). So we shouldn't gratuitously blow it out and there are ways we could make it smaller fairly reasonably but every pointer doesn't translate to increased physical memory. We are looking at multi-page slabs for some of these larger zones to control fragmentation better but unless you make ridiculous allocation sizes you don't get a lot of benefit. jeff: The internal fragmentation in the slab means there's more space here before we actually… | |||||
Not Done Inline ActionsIt would be very helpful to add multi-page slabs. When I was writing my book some years ago I did some tests and found that nearly 10% of wired memory in the kernel was wasted space due to bad packing of slabsAt that time vnodes were the worst offenders followed by processes. I note that Solaris supports multi-page slabs and has much less wasted kernel memory. mckusick: It would be very helpful to add multi-page slabs. When I was writing my book some years ago I… | |||||
Done Inline ActionsI should have noted this. According to my conversations with jeff there was unused space in the slab. With the D22997 the active list is retired and instead global vnode linkage is introduced (making 3 linkages in total: all allocated managed LRU, assigned to a mount point, dirty list on a mount point) As for sizeof itself, I plan to shrink the struct later. v_tag is almost unused (the only consumer can be easily patched away), flag fields are bigger than they need to be and fit in the hole at the beginning of the struct. Note there are several ufs-isms in the vnode perhaps should be moved to something else so that othe filesystems don't have to pay for it. mjg: I should have noted this. According to my conversations with jeff there was unused space in the… | |||||
struct bufobj v_bufobj; /* * Buffer cache object */ | struct bufobj v_bufobj; /* * Buffer cache object */ | ||||
/* | /* | ||||
* Hooks for various subsystems and features. | * Hooks for various subsystems and features. | ||||
*/ | */ | ||||
struct vpollinfo *v_pollinfo; /* i Poll events, p for *v_pi */ | struct vpollinfo *v_pollinfo; /* i Poll events, p for *v_pi */ | ||||
struct label *v_label; /* MAC label for vnode */ | struct label *v_label; /* MAC label for vnode */ | ||||
struct lockf *v_lockf; /* Byte-level advisory lock list */ | struct lockf *v_lockf; /* Byte-level advisory lock list */ | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
#define VV_PROCDEP 0x0100 /* vnode is process dependent */ | #define VV_PROCDEP 0x0100 /* vnode is process dependent */ | ||||
#define VV_NOKNOTE 0x0200 /* don't activate knotes on this vnode */ | #define VV_NOKNOTE 0x0200 /* don't activate knotes on this vnode */ | ||||
#define VV_DELETED 0x0400 /* should be removed */ | #define VV_DELETED 0x0400 /* should be removed */ | ||||
#define VV_MD 0x0800 /* vnode backs the md device */ | #define VV_MD 0x0800 /* vnode backs the md device */ | ||||
#define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ | #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ | ||||
#define VV_READLINK 0x2000 /* fdescfs linux vnode */ | #define VV_READLINK 0x2000 /* fdescfs linux vnode */ | ||||
#define VMP_TMPMNTFREELIST 0x0001 /* Vnode is on mnt's tmp free list */ | #define VMP_TMPMNTFREELIST 0x0001 /* Vnode is on mnt's tmp free list */ | ||||
#define VMP_DIRTYLIST 0x0002 /* Vnode is on mnt's dirty free list */ | |||||
/* | /* | ||||
* Vnode attributes. A field value of VNOVAL represents a field whose value | * Vnode attributes. A field value of VNOVAL represents a field whose value | ||||
* is unavailable (getattr) or which is not to be changed (setattr). | * is unavailable (getattr) or which is not to be changed (setattr). | ||||
*/ | */ | ||||
struct vattr { | struct vattr { | ||||
enum vtype va_type; /* vnode type (for create) */ | enum vtype va_type; /* vnode type (for create) */ | ||||
u_short va_mode; /* files access mode and type */ | u_short va_mode; /* files access mode and type */ | ||||
▲ Show 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | |||||
int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, | int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, | ||||
struct acl *aclp, accmode_t accmode, struct ucred *cred, | struct acl *aclp, accmode_t accmode, struct ucred *cred, | ||||
int *privused); | int *privused); | ||||
int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, | int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, | ||||
gid_t file_gid, struct acl *acl, accmode_t accmode, | gid_t file_gid, struct acl *acl, accmode_t accmode, | ||||
struct ucred *cred, int *privused); | struct ucred *cred, int *privused); | ||||
void vattr_null(struct vattr *vap); | void vattr_null(struct vattr *vap); | ||||
int vcount(struct vnode *vp); | int vcount(struct vnode *vp); | ||||
void vdirty(struct vnode *); | |||||
void vdrop(struct vnode *); | void vdrop(struct vnode *); | ||||
void vdropl(struct vnode *); | void vdropl(struct vnode *); | ||||
int vflush(struct mount *mp, int rootrefs, int flags, struct thread *td); | int vflush(struct mount *mp, int rootrefs, int flags, struct thread *td); | ||||
int vget(struct vnode *vp, int flags, struct thread *td); | int vget(struct vnode *vp, int flags, struct thread *td); | ||||
enum vgetstate vget_prep(struct vnode *vp); | enum vgetstate vget_prep(struct vnode *vp); | ||||
int vget_finish(struct vnode *vp, int flags, enum vgetstate vs); | int vget_finish(struct vnode *vp, int flags, enum vgetstate vs); | ||||
void vgone(struct vnode *vp); | void vgone(struct vnode *vp); | ||||
void vhold(struct vnode *); | void vhold(struct vnode *); | ||||
▲ Show 20 Lines • Show All 316 Lines • Show Last 20 Lines |
This is the part that I dislike most from the whole patch. It blows struct vnode by 16 bytes, which scales to additional tens of MBs of kernel memory for typical machine.
Why don't you reused v_actfreelist ?