Re: Work queue questions

2012-09-24 Thread anish singh
On Tue, Sep 25, 2012 at 1:38 AM, Tejun Heo wrote: > Hello, > > On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote: >> May be I misunderstood, I read in the documentation about max_active. >> In this case, max_active is 1, but I created three workqueues, do you > > I see. Why are you

Re: Work queue questions

2012-09-24 Thread Tejun Heo
On Mon, Sep 24, 2012 at 09:52:14PM +0100, Deepawali Verma wrote: > I do not have ordering as requirement. I can use system work queue as > well. what is max_active by default for system wq per cpu? For system_unbound_wq, it's the larger one of 512 and 4 * #cpus. -- tejun -- To unsubscribe from

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, I do not have ordering as requirement. I can use system work queue as well. what is max_active by default for system wq per cpu? Regards, Deepa On Mon, Sep 24, 2012 at 9:08 PM, Tejun Heo wrote: > Hello, > > On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote: >> May be I

Re: Work queue questions

2012-09-24 Thread Tejun Heo
Hello, On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote: > May be I misunderstood, I read in the documentation about max_active. > In this case, max_active is 1, but I created three workqueues, do you I see. Why are you doing that? Is there ordering requirement? Why not just

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, May be I misunderstood, I read in the documentation about max_active. In this case, max_active is 1, but I created three workqueues, do you mean to say for this case, single thread can process three requests queued up in the three different workqueues. Sorry, if I misunderstood.

Re: Work queue questions

2012-09-24 Thread Tejun Heo
On Mon, Sep 24, 2012 at 05:56:10PM +0100, Deepawali Verma wrote: > Hi, > > This is sample code snippet as I cannot post my project code. In > reality here, this work handler is copying the big chunks of data that > code is > here in my driver. This is running on quad core cortex A9 Thats why I >

Re: Work queue questions

2012-09-24 Thread Chinmay V S
Hi, Looking at the timestamps in your previous logs(copied below for reference), kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped kworker/u:1-21[000] 110.965137: task_event:

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi, This is sample code snippet as I cannot post my project code. In reality here, this work handler is copying the big chunks of data that code is here in my driver. This is running on quad core cortex A9 Thats why I asked. If there are 4 cpu cores, then there must be parallelism. Now Tajun,

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, Here are some code snippets from my device driver: #defind NUMBER_OF_SUBTASKS 3 struct my_driver_object { struct workqueue_struct *sub_task_wq; struct work_struct sub_task_work; char my_obj_wq_name[80]; int task_id; }; struct my_driver_object obj[3];

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, Here are some code snippets from my device driver: #defind NUMBER_OF_SUBTASKS 3 struct my_driver_object { struct workqueue_struct *sub_task_wq; struct work_struct sub_task_work; char my_obj_wq_name[80]; int task_id; }; struct my_driver_object obj[3];

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi, This is sample code snippet as I cannot post my project code. In reality here, this work handler is copying the big chunks of data that code is here in my driver. This is running on quad core cortex A9 Thats why I asked. If there are 4 cpu cores, then there must be parallelism. Now Tajun,

Re: Work queue questions

2012-09-24 Thread Chinmay V S
Hi, Looking at the timestamps in your previous logs(copied below for reference), kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped kworker/u:1-21[000] 110.965137: task_event:

Re: Work queue questions

2012-09-24 Thread Tejun Heo
On Mon, Sep 24, 2012 at 05:56:10PM +0100, Deepawali Verma wrote: Hi, This is sample code snippet as I cannot post my project code. In reality here, this work handler is copying the big chunks of data that code is here in my driver. This is running on quad core cortex A9 Thats why I asked.

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, May be I misunderstood, I read in the documentation about max_active. In this case, max_active is 1, but I created three workqueues, do you mean to say for this case, single thread can process three requests queued up in the three different workqueues. Sorry, if I misunderstood.

Re: Work queue questions

2012-09-24 Thread Tejun Heo
Hello, On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote: May be I misunderstood, I read in the documentation about max_active. In this case, max_active is 1, but I created three workqueues, do you I see. Why are you doing that? Is there ordering requirement? Why not just use

Re: Work queue questions

2012-09-24 Thread Deepawali Verma
Hi Tejun, I do not have ordering as requirement. I can use system work queue as well. what is max_active by default for system wq per cpu? Regards, Deepa On Mon, Sep 24, 2012 at 9:08 PM, Tejun Heo t...@kernel.org wrote: Hello, On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote:

Re: Work queue questions

2012-09-24 Thread Tejun Heo
On Mon, Sep 24, 2012 at 09:52:14PM +0100, Deepawali Verma wrote: I do not have ordering as requirement. I can use system work queue as well. what is max_active by default for system wq per cpu? For system_unbound_wq, it's the larger one of 512 and 4 * #cpus. -- tejun -- To unsubscribe from

Re: Work queue questions

2012-09-24 Thread anish singh
On Tue, Sep 25, 2012 at 1:38 AM, Tejun Heo t...@kernel.org wrote: Hello, On Mon, Sep 24, 2012 at 08:57:40PM +0100, Deepawali Verma wrote: May be I misunderstood, I read in the documentation about max_active. In this case, max_active is 1, but I created three workqueues, do you I see. Why

RE: Work queue questions

2012-09-22 Thread Daniel Taylor
... > >> So on so forth. > >> Anyway how can you write chunks of data in parallel when > >> already some worker > >> thread is writing i.e. the system is busy. > >> Analogy: Suppose you are ambidextrous and you are eating.Can > >> you eat with > >> both of your hands at a time?So worker thread

Re: Work queue questions

2012-09-22 Thread Tejun Heo
Hello, On Fri, Sep 21, 2012 at 11:05 PM, anish singh wrote: > Assuming single core,Is my explanation correct about concurrency? Yes, for bound workqueues, that's correct. Concurrency management doesn't apply to unbound ones tho. Didn't notice Deepawali's test case either just didn't take long

Re: Work queue questions

2012-09-22 Thread anish singh
pawali Verma >> Cc: Tejun Heo; linux-kernel@vger.kernel.org >> Subject: Re: Work queue questions >> >> On Sat, Sep 22, 2012 at 1:05 AM, Deepawali Verma >> wrote: >> > Hi Tajun, >> > >> > These three tasks are writing the three chunks of dat

Re: Work queue questions

2012-09-22 Thread anish singh
; linux-kernel@vger.kernel.org Subject: Re: Work queue questions On Sat, Sep 22, 2012 at 1:05 AM, Deepawali Verma dverma...@gmail.com wrote: Hi Tajun, These three tasks are writing the three chunks of data in parallel. I am not getting improvement here otherwise what is difference between

Re: Work queue questions

2012-09-22 Thread Tejun Heo
Hello, On Fri, Sep 21, 2012 at 11:05 PM, anish singh anish198519851...@gmail.com wrote: Assuming single core,Is my explanation correct about concurrency? Yes, for bound workqueues, that's correct. Concurrency management doesn't apply to unbound ones tho. Didn't notice Deepawali's test case

RE: Work queue questions

2012-09-22 Thread Daniel Taylor
... So on so forth. Anyway how can you write chunks of data in parallel when already some worker thread is writing i.e. the system is busy. Analogy: Suppose you are ambidextrous and you are eating.Can you eat with both of your hands at a time?So worker thread are like your hands

RE: Work queue questions

2012-09-21 Thread Daniel Taylor
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of anish singh > Sent: Friday, September 21, 2012 9:25 PM > To: Deepawali Verma > Cc: Tejun Heo; linux-kernel@vger.kernel.org > Subject: Re:

Re: Work queue questions

2012-09-21 Thread anish singh
On Sat, Sep 22, 2012 at 1:05 AM, Deepawali Verma wrote: > Hi Tajun, > > These three tasks are writing the three chunks of data in parallel. I > am not getting improvement here otherwise what is difference between > writing these chunks one by one in single thread instead of trying to > write the

Re: Work queue questions

2012-09-21 Thread Tejun Heo
Hello, Deepawali. On Fri, Sep 21, 2012 at 08:35:13PM +0100, Deepawali Verma wrote: > These three tasks are writing the three chunks of data in parallel. I > am not getting improvement here otherwise what is difference between > writing these chunks one by one in single thread instead of trying to

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tajun, These three tasks are writing the three chunks of data in parallel. I am not getting improvement here otherwise what is difference between writing these chunks one by one in single thread instead of trying to write the data by scheduling the work on three different workqueues means 3

Re: Work queue questions

2012-09-21 Thread Tejun Heo
On Fri, Sep 21, 2012 at 08:26:01PM +0100, Deepawali Verma wrote: > kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted > kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped > kworker/u:1-21[000] 110.965137: task_event: MYTASKJOB2382

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tejun, I have put the ftrace markers in my code: kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped kworker/u:1-21[000] 110.965137: task_event: MYTASKJOB2382 XStarted

Re: Work queue questions

2012-09-21 Thread Tejun Heo
Hello, On Fri, Sep 21, 2012 at 07:30:21PM +0100, Deepawali Verma wrote: > Actually I want to make parallelization of one task into three tasks. > Therefore I created three single threaded work queues means divide the > task into three tasks. You are right that I can use one work queue as > well.

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tejun, Actually I want to make parallelization of one task into three tasks. Therefore I created three single threaded work queues means divide the task into three tasks. You are right that I can use one work queue as well. But when I am doing three times schedule on different work queues, I

Re: Work queue questions

2012-09-21 Thread Tejun Heo
On Fri, Sep 21, 2012 at 06:35:25PM +0100, Dinky Verma wrote: > I have one question regarding concurrency managed workqueue. In the > previous kernel versions, I was using > create_singlethread_workqueue("driver_wq") e.g workqueue name is > driver_wq. In my device driver with the latest kernel

Re: Work queue questions

2012-09-21 Thread Tejun Heo
On Fri, Sep 21, 2012 at 06:35:25PM +0100, Dinky Verma wrote: I have one question regarding concurrency managed workqueue. In the previous kernel versions, I was using create_singlethread_workqueue(driver_wq) e.g workqueue name is driver_wq. In my device driver with the latest kernel version, I

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tejun, Actually I want to make parallelization of one task into three tasks. Therefore I created three single threaded work queues means divide the task into three tasks. You are right that I can use one work queue as well. But when I am doing three times schedule on different work queues, I

Re: Work queue questions

2012-09-21 Thread Tejun Heo
Hello, On Fri, Sep 21, 2012 at 07:30:21PM +0100, Deepawali Verma wrote: Actually I want to make parallelization of one task into three tasks. Therefore I created three single threaded work queues means divide the task into three tasks. You are right that I can use one work queue as well. But

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tejun, I have put the ftrace markers in my code: kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped kworker/u:1-21[000] 110.965137: task_event: MYTASKJOB2382 XStarted

Re: Work queue questions

2012-09-21 Thread Tejun Heo
On Fri, Sep 21, 2012 at 08:26:01PM +0100, Deepawali Verma wrote: kworker/u:1-21[000] 110.964895: task_event: MYTASKJOB2381 XStarted kworker/u:1-21[000] 110.964909: task_event: MYTASKJOB2381 Xstopped kworker/u:1-21[000] 110.965137: task_event: MYTASKJOB2382

Re: Work queue questions

2012-09-21 Thread Deepawali Verma
Hi Tajun, These three tasks are writing the three chunks of data in parallel. I am not getting improvement here otherwise what is difference between writing these chunks one by one in single thread instead of trying to write the data by scheduling the work on three different workqueues means 3

Re: Work queue questions

2012-09-21 Thread Tejun Heo
Hello, Deepawali. On Fri, Sep 21, 2012 at 08:35:13PM +0100, Deepawali Verma wrote: These three tasks are writing the three chunks of data in parallel. I am not getting improvement here otherwise what is difference between writing these chunks one by one in single thread instead of trying to

Re: Work queue questions

2012-09-21 Thread anish singh
On Sat, Sep 22, 2012 at 1:05 AM, Deepawali Verma dverma...@gmail.com wrote: Hi Tajun, These three tasks are writing the three chunks of data in parallel. I am not getting improvement here otherwise what is difference between writing these chunks one by one in single thread instead of trying

RE: Work queue questions

2012-09-21 Thread Daniel Taylor
-Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of anish singh Sent: Friday, September 21, 2012 9:25 PM To: Deepawali Verma Cc: Tejun Heo; linux-kernel@vger.kernel.org Subject: Re: Work queue questions On Sat