[PATCH] infrastructure for handling pte_chain_alloc() failures
The VM allocates pte_chains with GFP_ATOMIC, under deep locking. If that allocation fails, we oops. My approach to solving this is to require that the caller of page_add_rmap() pass in a pte_chain structure for page_add_rmap() to use. Then, callers can arrange to allocate that structure outside locks with GFP_KERNEL. This patch provides the base infrastructure. A common case is that page_add_rmap() will in fact not consume the pte_chain, because an empty slot was found within one of the page's existing pte_chain structures. So this patch provides for a special one-deep per-cpu pte_chain cache to optimise this case of taking just one pte_chain and then immediately putting it back. We end up adding maybe 20-30 instructions to the pagefault path to handle the eventuality of pte_chain allocation failures. Lots of other design ideas were considered. This is the best I could come up with.
Showing
Please register or sign in to comment