* [PATCH] x86/sgx: Remove unnecessary try_to_freeze()
@ 2023-12-13 9:03 Kevin Hao
2023-12-13 11:52 ` Huang, Kai
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Hao @ 2023-12-13 9:03 UTC (permalink / raw)
To: x86, linux-sgx
Cc: Jarkko Sakkinen, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Rafael J. Wysocki, Pavel Machek
A freezable kernel thread can enter frozen state during freezing by
either calling try_to_freeze() or using wait_event_freezable() and its
variants. However, there is no need to use both methods simultaneously.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
---
arch/x86/kernel/cpu/sgx/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 166692f2d501..318165b3ff78 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -404,9 +404,6 @@ static int ksgxd(void *p)
WARN_ON(__sgx_sanitize_pages(&sgx_dirty_page_list));
while (!kthread_should_stop()) {
- if (try_to_freeze())
- continue;
-
wait_event_freezable(ksgxd_waitq,
kthread_should_stop() ||
sgx_should_reclaim(SGX_NR_HIGH_PAGES));
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] x86/sgx: Remove unnecessary try_to_freeze()
2023-12-13 9:03 [PATCH] x86/sgx: Remove unnecessary try_to_freeze() Kevin Hao
@ 2023-12-13 11:52 ` Huang, Kai
0 siblings, 0 replies; 2+ messages in thread
From: Huang, Kai @ 2023-12-13 11:52 UTC (permalink / raw)
To: linux-sgx@vger.kernel.org, haokexin@gmail.com, x86@kernel.org
Cc: tglx@linutronix.de, pavel@ucw.cz, mingo@redhat.com,
jarkko@kernel.org, rafael@kernel.org, bp@alien8.de
On Wed, 2023-12-13 at 17:03 +0800, Kevin Hao wrote:
> A freezable kernel thread can enter frozen state during freezing by
> either calling try_to_freeze() or using wait_event_freezable() and its
> variants. However, there is no need to use both methods simultaneously.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> ---
> arch/x86/kernel/cpu/sgx/main.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
> index 166692f2d501..318165b3ff78 100644
> --- a/arch/x86/kernel/cpu/sgx/main.c
> +++ b/arch/x86/kernel/cpu/sgx/main.c
> @@ -404,9 +404,6 @@ static int ksgxd(void *p)
> WARN_ON(__sgx_sanitize_pages(&sgx_dirty_page_list));
>
> while (!kthread_should_stop()) {
> - if (try_to_freeze())
> - continue;
> -
> wait_event_freezable(ksgxd_waitq,
> kthread_should_stop() ||
> sgx_should_reclaim(SGX_NR_HIGH_PAGES));
Reviewed-by: Kai Huang <kai.huang@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-13 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 9:03 [PATCH] x86/sgx: Remove unnecessary try_to_freeze() Kevin Hao
2023-12-13 11:52 ` Huang, Kai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox