Re: [PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-16 Thread Oleg Nesterov
On 02/16, Jiri Slaby wrote:
> 
> unify queue_delayed_work and queue_delayed_work_on fix
> 
> Since cwq->wq is unset for other than singlethread_cpu when singlethread
> workqueue was created, an oops occurs during bootup.

And I thought I tested this...

>   Fix it by setting
> correct private value for workqueue.

Thanks!!!

> Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>
> 
> ---
> commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
> tree 7795008066bb89e7489384cde95e63260602d5af
> parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
> author Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100
> committer Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100
> 
>  kernel/workqueue.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index f2089bf..af5e597 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct 
> workqueue_struct *wq,
>  
>   /* This stores cwq for the moment, for the timer_fn */
>   set_wq_data(work,
> - per_cpu_ptr(wq->cpu_wq, raw_smp_processor_id()));
> + per_cpu_ptr(wq->cpu_wq, wq->singlethread ?
> + singlethread_cpu : raw_smp_processor_id()));
>   timer->expires = jiffies + delay;
>   timer->data = (unsigned long)dwork;
>   timer->function = delayed_work_timer_fn;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-16 Thread Oleg Nesterov
On 02/16, Jiri Slaby wrote:
 
 unify queue_delayed_work and queue_delayed_work_on fix
 
 Since cwq-wq is unset for other than singlethread_cpu when singlethread
 workqueue was created, an oops occurs during bootup.

And I thought I tested this...

   Fix it by setting
 correct private value for workqueue.

Thanks!!!

 Signed-off-by: Jiri Slaby [EMAIL PROTECTED]
 
 ---
 commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
 tree 7795008066bb89e7489384cde95e63260602d5af
 parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
 author Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100
 committer Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100
 
  kernel/workqueue.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/kernel/workqueue.c b/kernel/workqueue.c
 index f2089bf..af5e597 100644
 --- a/kernel/workqueue.c
 +++ b/kernel/workqueue.c
 @@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct 
 workqueue_struct *wq,
  
   /* This stores cwq for the moment, for the timer_fn */
   set_wq_data(work,
 - per_cpu_ptr(wq-cpu_wq, raw_smp_processor_id()));
 + per_cpu_ptr(wq-cpu_wq, wq-singlethread ?
 + singlethread_cpu : raw_smp_processor_id()));
   timer-expires = jiffies + delay;
   timer-data = (unsigned long)dwork;
   timer-function = delayed_work_timer_fn;

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-15 Thread Jiri Slaby

Jiri Slaby napsal(a):
[...]

unify queue_delayed_work and queue_delayed_work_on fix


Oh sorry, the name should be
make queue_delayed_work() friendly to flush_fork() fix


Since cwq->wq is unset for other than singlethread_cpu when singlethread
workqueue was created, an oops occurs during bootup. Fix it by setting
correct private value for workqueue.

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>

---
commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
tree 7795008066bb89e7489384cde95e63260602d5af
parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
author Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100
committer Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100

 kernel/workqueue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f2089bf..af5e597 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct 
*wq,
 
 		/* This stores cwq for the moment, for the timer_fn */

set_wq_data(work,
-   per_cpu_ptr(wq->cpu_wq, raw_smp_processor_id()));
+   per_cpu_ptr(wq->cpu_wq, wq->singlethread ?
+   singlethread_cpu : raw_smp_processor_id()));
timer->expires = jiffies + delay;
timer->data = (unsigned long)dwork;
timer->function = delayed_work_timer_fn;



regards,
--
http://www.fi.muni.cz/~xslaby/Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-15 Thread Jiri Slaby
Andrew Morton wrote:
> Temporarily at
> 
>   http://userweb.kernel.org/~akpm/2.6.20-mm1/
[...]
> +unify-queue_delayed_work-and-queue_delayed_work_on.patch

I'm getting oops in delayed_work_timer_fn, since cwq->wq is NULL and accessed
there. The patch below fixes the problem for me.

--

unify queue_delayed_work and queue_delayed_work_on fix

Since cwq->wq is unset for other than singlethread_cpu when singlethread
workqueue was created, an oops occurs during bootup. Fix it by setting
correct private value for workqueue.

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>

---
commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
tree 7795008066bb89e7489384cde95e63260602d5af
parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
author Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100
committer Jiri Slaby <[EMAIL PROTECTED]> Fri, 16 Feb 2007 00:49:15 +0100

 kernel/workqueue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f2089bf..af5e597 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct 
*wq,
 
/* This stores cwq for the moment, for the timer_fn */
set_wq_data(work,
-   per_cpu_ptr(wq->cpu_wq, raw_smp_processor_id()));
+   per_cpu_ptr(wq->cpu_wq, wq->singlethread ?
+   singlethread_cpu : raw_smp_processor_id()));
timer->expires = jiffies + delay;
timer->data = (unsigned long)dwork;
timer->function = delayed_work_timer_fn;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-15 Thread Jiri Slaby
Andrew Morton wrote:
 Temporarily at
 
   http://userweb.kernel.org/~akpm/2.6.20-mm1/
[...]
 +unify-queue_delayed_work-and-queue_delayed_work_on.patch

I'm getting oops in delayed_work_timer_fn, since cwq-wq is NULL and accessed
there. The patch below fixes the problem for me.

--

unify queue_delayed_work and queue_delayed_work_on fix

Since cwq-wq is unset for other than singlethread_cpu when singlethread
workqueue was created, an oops occurs during bootup. Fix it by setting
correct private value for workqueue.

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]

---
commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
tree 7795008066bb89e7489384cde95e63260602d5af
parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
author Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100
committer Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100

 kernel/workqueue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f2089bf..af5e597 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct 
*wq,
 
/* This stores cwq for the moment, for the timer_fn */
set_wq_data(work,
-   per_cpu_ptr(wq-cpu_wq, raw_smp_processor_id()));
+   per_cpu_ptr(wq-cpu_wq, wq-singlethread ?
+   singlethread_cpu : raw_smp_processor_id()));
timer-expires = jiffies + delay;
timer-data = (unsigned long)dwork;
timer-function = delayed_work_timer_fn;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix

2007-02-15 Thread Jiri Slaby

Jiri Slaby napsal(a):
[...]

unify queue_delayed_work and queue_delayed_work_on fix


Oh sorry, the name should be
make queue_delayed_work() friendly to flush_fork() fix


Since cwq-wq is unset for other than singlethread_cpu when singlethread
workqueue was created, an oops occurs during bootup. Fix it by setting
correct private value for workqueue.

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]

---
commit 7bc281be5811f9b1dd01c25eaf492f4765737fd0
tree 7795008066bb89e7489384cde95e63260602d5af
parent 61c2024a2dd044e32747542cfbf4b22251df3bc2
author Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100
committer Jiri Slaby [EMAIL PROTECTED] Fri, 16 Feb 2007 00:49:15 +0100

 kernel/workqueue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f2089bf..af5e597 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -210,7 +210,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct 
*wq,
 
 		/* This stores cwq for the moment, for the timer_fn */

set_wq_data(work,
-   per_cpu_ptr(wq-cpu_wq, raw_smp_processor_id()));
+   per_cpu_ptr(wq-cpu_wq, wq-singlethread ?
+   singlethread_cpu : raw_smp_processor_id()));
timer-expires = jiffies + delay;
timer-data = (unsigned long)dwork;
timer-function = delayed_work_timer_fn;



regards,
--
http://www.fi.muni.cz/~xslaby/Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/