Re: [Patch] x86,mm: check freeze request in page fault handler

From: Michal Hocko
Date: Wed Aug 13 2014 - 05:36:19 EST


On Tue 12-08-14 17:47:02, Cong Wang wrote:
[...]
> Does the following updated patch make any sense to you? If not, I will just
> drop it.

Not really to be honest. I do not see what problem you are trying to fix.

> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index a241946..8c0a7d8 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -14,6 +14,7 @@
> #include <linux/hugetlb.h> /* hstate_index_to_shift */
> #include <linux/prefetch.h> /* prefetchw */
> #include <linux/context_tracking.h> /* exception_enter(), ... */
> +#include <linux/freezer.h> /* try_to_freeze() */
>
> #include <asm/traps.h> /* dotraplinkage, ... */
> #include <asm/pgalloc.h> /* pgd_*(), ... */
> @@ -904,6 +905,9 @@ mm_fault_error(struct pt_regs *regs, unsigned long
> error_code,
> * oom-killed):
> */
> pagefault_out_of_memory();
> +
> + if (signal_pending(current))
> + try_to_freeze();
> } else {
> if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|
> VM_FAULT_HWPOISON_LARGE))

--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/