2021-01-25 04:04:03

by Zhang, Qiang

[permalink] [raw]
Subject: [PATCH] PM: remove PF_WQ_WORKER mask

From: Zqiang <[email protected]>

Due to kworker also is kernel thread, it's already included
PF_KTHREAD mask, so remove PF_WQ_WORKER mask.

Signed-off-by: Zqiang <[email protected]>
---
kernel/power/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index 45b054b7b5ec..50cc63534486 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -235,7 +235,7 @@ void thaw_kernel_threads(void)

read_lock(&tasklist_lock);
for_each_process_thread(g, p) {
- if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
+ if (p->flags & PF_KTHREAD)
__thaw_task(p);
}
read_unlock(&tasklist_lock);
--
2.17.1


2021-01-27 21:16:59

by Zhang, Qiang

[permalink] [raw]
Subject: 回复: [PATCH] PM: remove PF_WQ_WORKER mask


________________________________________
??????: Zhang, Qiang <[email protected]>
????ʱ??: 2021??1??25?? 12:00
?ռ???: [email protected]
????: [email protected]; [email protected]
????: [PATCH] PM: remove PF_WQ_WORKER mask

From: Zqiang <[email protected]>

Due to kworker also is kernel thread, it's already included
PF_KTHREAD mask, so remove PF_WQ_WORKER mask.

Signed-off-by: Zqiang <[email protected]>
---
kernel/power/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index 45b054b7b5ec..50cc63534486 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -235,7 +235,7 @@ void thaw_kernel_threads(void)

read_lock(&tasklist_lock);
for_each_process_thread(g, p) {
- if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
+ if (p->flags & PF_KTHREAD)
__thaw_task(p);
}
read_unlock(&tasklist_lock);
--
2.17.1

2021-01-28 00:10:58

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] PM: remove PF_WQ_WORKER mask

On Mon, Jan 25, 2021 at 5:01 AM <[email protected]> wrote:
>
> From: Zqiang <[email protected]>
>
> Due to kworker also is kernel thread, it's already included
> PF_KTHREAD mask, so remove PF_WQ_WORKER mask.

So you are saying that all threads having PF_WQ_WORKER set must also
have PF_KTHREAD set, right?

That sounds correct, so I'm going to rewrite the changelog and apply
the patch as 5.12 material, thanks!

> Signed-off-by: Zqiang <[email protected]>
> ---
> kernel/power/process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 45b054b7b5ec..50cc63534486 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -235,7 +235,7 @@ void thaw_kernel_threads(void)
>
> read_lock(&tasklist_lock);
> for_each_process_thread(g, p) {
> - if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
> + if (p->flags & PF_KTHREAD)
> __thaw_task(p);
> }
> read_unlock(&tasklist_lock);
> --
> 2.17.1
>

2021-01-28 01:46:56

by Zhang, Qiang

[permalink] [raw]
Subject: 回复: [PATCH] PM: remove PF_WQ_WORKER mask



________________________________________
??????: Rafael J. Wysocki <[email protected]>
????ʱ??: 2021??1??28?? 2:16
?ռ???: Zhang, Qiang
????: Rafael Wysocki; Linux PM; Linux Kernel Mailing List
????: Re: [PATCH] PM: remove PF_WQ_WORKER mask

[Please note: This e-mail is from an EXTERNAL e-mail address]

On Mon, Jan 25, 2021 at 5:01 AM <[email protected]> wrote:
>
> From: Zqiang <[email protected]>
>
> Due to kworker also is kernel thread, it's already included
> PF_KTHREAD mask, so remove PF_WQ_WORKER mask.

>So you are saying that all threads having PF_WQ_WORKER set must also
>have PF_KTHREAD set, right?

yes
#define PF_KTHREAD 0x00200000
#define PF_WQ_WORKER 0x00000020
I tracing kwoker's task->flags as follows:
comm kworker/1:0, cpu 1, task->flags 0x4208060, delayed 3, func intel_fbc_work_fn

Thanks
Qiang

>That sounds correct, so I'm going to rewrite the changelog and apply
>the patch as 5.12 material, thanks!

> Signed-off-by: Zqiang <[email protected]>
> ---
> kernel/power/process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 45b054b7b5ec..50cc63534486 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -235,7 +235,7 @@ void thaw_kernel_threads(void)
>
> read_lock(&tasklist_lock);
> for_each_process_thread(g, p) {
> - if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
> + if (p->flags & PF_KTHREAD)
> __thaw_task(p);
> }
> read_unlock(&tasklist_lock);
> --
> 2.17.1
>