Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcu: document ways of stalling updates in low-memory situations

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

+15 -6
+15 -6
Documentation/RCU/checklist.txt
··· 218 218 include: 219 219 220 220 a. Keeping a count of the number of data-structure elements 221 - used by the RCU-protected data structure, including those 222 - waiting for a grace period to elapse. Enforce a limit 223 - on this number, stalling updates as needed to allow 224 - previously deferred frees to complete. 221 + used by the RCU-protected data structure, including 222 + those waiting for a grace period to elapse. Enforce a 223 + limit on this number, stalling updates as needed to allow 224 + previously deferred frees to complete. Alternatively, 225 + limit only the number awaiting deferred free rather than 226 + the total number of elements. 225 227 226 - Alternatively, limit only the number awaiting deferred 227 - free rather than the total number of elements. 228 + One way to stall the updates is to acquire the update-side 229 + mutex. (Don't try this with a spinlock -- other CPUs 230 + spinning on the lock could prevent the grace period 231 + from ever ending.) Another way to stall the updates 232 + is for the updates to use a wrapper function around 233 + the memory allocator, so that this wrapper function 234 + simulates OOM when there is too much memory awaiting an 235 + RCU grace period. There are of course many other 236 + variations on this theme. 228 237 229 238 b. Limiting update rate. For example, if updates occur only 230 239 once per hour, then no explicit rate limiting is required,