From: Sasha Levin Date: Thu, 15 Jan 2015 01:41:19 +0000 (-0500) Subject: kernel: freezer: restore TIF_FREEZE X-Git-Tag: v4.1.12-92~326^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=33a4d141abb4f185a5063335acf84066153298d9;p=users%2Fjedix%2Flinux-maple.git kernel: freezer: restore TIF_FREEZE Ksplice needs to freeze threads while in kernel. This facility was removed from upstream since it was no longer required, but Ksplice still needs it. Re-add TIF_FREEZE to allow Ksplice to freeze threads. Signed-off-by: Sasha Levin Signed-off-by: Maxim Uvarov Signed-off-by: Guangyu Sun Signed-off-by: Santosh Shilimkar --- diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index b4bdec3e9523e..f1eae959ca604 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -106,6 +106,7 @@ struct thread_info { #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ #define TIF_FORCED_TF 24 /* true if TF in eflags artificially */ #define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ +#define TIF_FREEZE 26 /* is freezing for suspend */ #define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ #define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */ #define TIF_ADDR32 29 /* 32-bit address space on 64 bits */ diff --git a/kernel/freezer.c b/kernel/freezer.c index a8900a3bc27a8..143385b5e6543 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c @@ -45,6 +45,9 @@ bool freezing_slow_path(struct task_struct *p) if (test_thread_flag(TIF_MEMDIE)) return false; + if (test_tsk_thread_flag(p, TIF_FREEZE)) + return true; + if (pm_nosig_freezing || cgroup_freezing(p)) return true;