af14bca641
Suppose that we have an exclusively busy page, and a thread which can accept shared-busy page. In this case, typical code waiting for the page xbusy state to pass is again: VM_OBJECT_WLOCK(object); ... if (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(object); <---1 vm_page_busy_sleep(p, "vmopax"); goto again; } Suppose that the xbusy state owner locked the object, unbusied the page and unlocked the object after we are at the line [1], but before we executed the load of the busy_lock word in vm_page_busy_sleep(). If it happens that there is still no waiters recorded for the busy state, the xbusy owner did not acquired the page lock, so it proceeded. More, suppose that some other thread happen to share-busy the page after xbusy state was relinquished but before the m->busy_lock is read in vm_page_busy_sleep(). Again, that thread only needs vm_object lock to proceed. Then, vm_page_busy_sleep() reads busy_lock value equal to the VPB_SHARERS_WORD(1). In this case, all tests in vm_page_busy_sleep(9) pass and we are going to sleep, despite the page being share-busied. Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9) to also accept shared-busy state if we only wait for the xbusy state to pass. Merge sequential if()s with the same 'then' clause in vm_page_busy_sleep(). Note that the current code does not share-busy pages from parallel threads, the only way to have more that one sbusy owner is right now is to recurse. Reported and tested by: pho (previous version) Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D8196 |
||
---|---|---|
.. | ||
i915 | ||
radeon | ||
ttm | ||
ati_pcigart.c | ||
drm_agpsupport.c | ||
drm_atomic.h | ||
drm_auth.c | ||
drm_buffer.c | ||
drm_buffer.h | ||
drm_bufs.c | ||
drm_context.c | ||
drm_core.h | ||
drm_crtc_helper.c | ||
drm_crtc_helper.h | ||
drm_crtc.c | ||
drm_crtc.h | ||
drm_dma.c | ||
drm_dp_helper.c | ||
drm_dp_helper.h | ||
drm_dp_iic_helper.c | ||
drm_drv.c | ||
drm_edid_modes.h | ||
drm_edid.c | ||
drm_edid.h | ||
drm_fb_helper.c | ||
drm_fb_helper.h | ||
drm_fixed.h | ||
drm_fops.c | ||
drm_fourcc.h | ||
drm_gem_names.c | ||
drm_gem_names.h | ||
drm_gem.c | ||
drm_global.c | ||
drm_global.h | ||
drm_hashtab.c | ||
drm_hashtab.h | ||
drm_ioc32.c | ||
drm_ioctl.c | ||
drm_irq.c | ||
drm_linux_list_sort.c | ||
drm_linux_list.h | ||
drm_lock.c | ||
drm_mem_util.h | ||
drm_memory.c | ||
drm_mm.c | ||
drm_mm.h | ||
drm_mode.h | ||
drm_modes.c | ||
drm_os_freebsd.c | ||
drm_os_freebsd.h | ||
drm_pci.c | ||
drm_pciids.h | ||
drm_sarea.h | ||
drm_scatter.c | ||
drm_stub.c | ||
drm_sysctl.c | ||
drm_vm.c | ||
drm.h | ||
drmP.h |