diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2020-01-19 18:30:23 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2020-01-19 18:30:23 +0000 |
commit | 98087a066f71aa1af97512eb2ca2dbaa5c7c53ac (patch) | |
tree | 83aa7b0d57ed4adde9909183652edeec23bba9a7 /sys/vm/vm_object.h | |
parent | 811d05fcb7a9649fb58c45c96d9c9fb0d3c79357 (diff) | |
download | src-98087a066f71aa1af97512eb2ca2dbaa5c7c53ac.tar.gz src-98087a066f71aa1af97512eb2ca2dbaa5c7c53ac.zip |
Make collapse synchronization more explicit and allow it to complete during
paging.
Shadow objects are marked with a COLLAPSING flag while they are collapsing with
their backing object. This gives us an explicit test rather than overloading
paging-in-progress. While split is on-going we mark an object with SPLIT.
These two operations will modify the swap tree so they must be serialized
and swap_pager_getpages() can now directly detect these conditions and page
more conservatively.
Callers to vm_object_collapse() now will reliably wait for a collapse to finish
so that the backing chain is as short as possible before other decisions are
made that may inflate the object chain. For example, split, coalesce, etc.
It is now safe to run fault concurrently with collapse. It is safe to increase
or decrease paging in progress with no lock so long as there is another valid
ref on increase.
This change makes collapse more reliable as a secondary benefit. The primary
benefit is making it safe to drop the object lock much earlier in fault or
never acquire it at all.
This was tested with a new shadow chain test script that uncovered long
standing bugs and will be integrated with stress2.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D22908
Notes
Notes:
svn path=/head/; revision=356886
Diffstat (limited to 'sys/vm/vm_object.h')
-rw-r--r-- | sys/vm/vm_object.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index b5b6e0c70dc1..780f7c7e83b7 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -190,6 +190,8 @@ struct vm_object { #define OBJ_SIZEVNLOCK 0x0040 /* lock vnode to check obj size */ #define OBJ_PG_DTOR 0x0080 /* dont reset object, leave that for dtor */ #define OBJ_TMPFS_NODE 0x0200 /* object belongs to tmpfs VREG node */ +#define OBJ_SPLIT 0x0400 /* object is being split */ +#define OBJ_COLLAPSING 0x0800 /* Parent of collapse. */ #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_SHADOWLIST 0x4000 /* Object is on the shadow list. */ |