Changeset View
Standalone View
sys/vm/vnode_pager.c
Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | |||||
* operation ). The swapper handles the case by limiting the amount | * operation ). The swapper handles the case by limiting the amount | ||||
* of asynchronous I/O, but that sort of solution doesn't scale well | * of asynchronous I/O, but that sort of solution doesn't scale well | ||||
* for the vnode pager without a lot of work. | * for the vnode pager without a lot of work. | ||||
* | * | ||||
* Also, the backing vnode's iodone routine may not wake the pageout | * Also, the backing vnode's iodone routine may not wake the pageout | ||||
* daemon up. This should be probably be addressed XXX. | * daemon up. This should be probably be addressed XXX. | ||||
*/ | */ | ||||
if (vm_cnt.v_free_count < vm_cnt.v_pageout_free_min) | if (vm_page_count_min()) | ||||
kib: A random place to put this note: previous condition could be outdated, but it was at least the… | |||||
jeffAuthorUnsubmitted Not Done Inline ActionsCan you explain why a torn write here is a problem? The previous check is inherently racey. We may miss a setting or clearing of the condition in either case. The bitmask will be a single word up to 64 domains. jeff: Can you explain why a torn write here is a problem? The previous check is inherently racey. | |||||
kibUnsubmitted Not Done Inline ActionsWe check the first word, and noted that all our domains are at min or at severe. We move to the next word, but between that the domains recorded in the first word are cleared, while second word gets our domains marked as min/severe. As result, the thread is going to sleep, while if the read of domainset was raceless by any technique, we would notice a suitable ready domain. kib: We check the first word, and noted that all our domains are at min or at severe. We move to… | |||||
jeffAuthorUnsubmitted Not Done Inline ActionsThe cases that sleep use the bitset lock to ensure sleep/wake synchronization which has the side-effect of giving them a stable look at the bits. In this case we're just deciding whether we do a synchronous write or not. We may miss some state transition but I still assert the same was true before. This is just trying to limit page consumption by throttling slightly. jeff: The cases that sleep use the bitset lock to ensure sleep/wake synchronization which has the… | |||||
flags |= VM_PAGER_PUT_SYNC; | flags |= VM_PAGER_PUT_SYNC; | ||||
/* | /* | ||||
* Call device-specific putpages function | * Call device-specific putpages function | ||||
*/ | */ | ||||
vp = object->handle; | vp = object->handle; | ||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals); | rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals); | ||||
▲ Show 20 Lines • Show All 379 Lines • Show Last 20 Lines |
A random place to put this note: previous condition could be outdated, but it was at least the correct state, some nearby time ago. Now, with the lock-less access to the vm_min_domains mask, potentially we do evaluation of several words, and the cumulative state might 'too' invalid.
If it is reasonable to expect that domain mask fits into a single word, may be we should assert this ?