tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Patch: allow concurrent faults on a single uvm_object



Hi,

This address the problem with lock contention due to page faults on libc.so
and other shared objects.  It also allows for concurrent faults on shared
amaps, for example PostgreSQL's shared buffer.

The approach is:

- Add a PGO_NOBUSY flag that has getpages return pages without busying them. 
  It has to come with PGO_LOCKED and VM_PROT_WRITE == 0.  This allows
  getpages to be called with a RW_READER lock for the in-core case.

- For each fault, keep track of the type of lock on the upper & lower
  objects.  Start out with the assumption that RW_READER is good for both
  and then make some guesses to refine that.  If the fault runs into trouble
  because it has a RW_READER lock, try to upgrade to RW_WRITER and if that
  fails, give up and restart the fault to happen from the beginning with a
  RW_WRITER lock.

- Add a couple of "vmstat -s" counters to see how it does in practice.

- Allow some more uvm_map() operations with RW_READER on the underlock
  objects.

- Cut contention from v_interlock in genfs_getpages by adding a flag that's
  set earlier with both v_interlock + vmobjlock set.

Changes here:

	http://www.netbsd.org/~ad/2020/fault.diff

Comments welcome.

Thanks,
Andrew


Home | Main Index | Thread Index | Old Index