vm_soft_fault(): Avoid deadlock waiting for wired ranges
* VMArea::AddWaiterIfWired(): Replace the ignoreRange argument by a flags argument and introduce (currently only) flag IGNORE_WRITE_WIRED_RANGES. If specified, ranges wired for writing are ignored. Ignoring just a single specified range doesn't cut it in vm_soft_fault(), and there aren't any other users of that feature. * vm_soft_fault(): When having to unmap a page of a lower cache, this page cannot be wired for writing. So we can safely ignore all writed-wired ranges, instead of just our own. We even have to do that in case there's another thread that concurrently tries to write-wire the same page, since otherwise we'd deadlock waiting for each other.
This commit is contained in:
@@ -89,6 +89,14 @@ struct VMPageWiringInfo {
|
||||
|
||||
|
||||
struct VMArea {
|
||||
public:
|
||||
enum {
|
||||
// AddWaiterIfWired() flags
|
||||
IGNORE_WRITE_WIRED_RANGES = 0x01, // ignore existing ranges that
|
||||
// wire for writing
|
||||
};
|
||||
|
||||
public:
|
||||
char* name;
|
||||
area_id id;
|
||||
uint32 protection;
|
||||
@@ -130,8 +138,7 @@ public:
|
||||
|
||||
bool AddWaiterIfWired(VMAreaUnwiredWaiter* waiter);
|
||||
bool AddWaiterIfWired(VMAreaUnwiredWaiter* waiter,
|
||||
addr_t base, size_t size,
|
||||
VMAreaWiredRange* ignoreRange = NULL);
|
||||
addr_t base, size_t size, uint32 flags = 0);
|
||||
|
||||
protected:
|
||||
VMArea(VMAddressSpace* addressSpace,
|
||||
|
||||
Reference in New Issue
Block a user