thanks Pekka and i think one example of the case you mentioned is in
access_process_vm() which is calling
get_user_pages(tsk, mm, addr, 1, write, 1, &pages, &vma). However, it
is allocating only one page here which
much less likely to be stuck under memory pressure. Like you said, in
order to make it more flexible for future
changes, i might make the change like:
*/
- if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
- return i ? i : -ENOMEM;
+ if (unlikely(sigkill_pending(current) | | sigkill_pending(tsk)))
+ return i ? i : -ERESTARTSYS;
is this something acceptable?