RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 15:14 +, Pallala, Ramakrishna wrote:
> > On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
> > > > > How can I schedule driver's worker and threaded IRQ on the same core?
> > > > >
> > > > > For work queue we have schedule_delayed_work_on () API available.
> > > > > But how to schedule the threaded IRQ on the same core where my
> > > > > worker
> > > > thread is going to run?
> > > > Why do you need to worry about where your worker thread is going to run?
> > > > Or IOW what use case do you have in mind?
> > >
> > > In my driver I can get two independent events(IRQ and kernel
> > > notification). One will be handled by Threaded IRQ and other will be
> > > handled by a worker and the order is not guaranteed and with two cores
> > Sometimes both workers are being scheduled  parallel.
> > So what is the problem even if they run in parallel, it would be really 
> > help if we
> > know what problem you are trying to solve?
> > Even if you want to sync between these two then you can have some
> > synchronisation mechanism between the two.
> > What is the advantage you are going to get if they run on same core?
> > 
> > Sorry but these answers would really help community in resolving your 
> > problem.
> 
> I think I got what I was looking for...
> synchronize_irq()
  /*
   * We made sure that no hardirq handler is running. Now verify
   * that no threaded handlers are active.
   */
  wait_event(desc->wait_for_threads, !
atomic_read(>threads_active));

I think this makes sense now.
> 
> basically I need to wait/pause my worker thread execution until my threaded 
> handler is complete.
> 
> Thanks for response.
> 
> Thanks,
> Ram


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


RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread Pallala, Ramakrishna
> On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
> > > > How can I schedule driver's worker and threaded IRQ on the same core?
> > > >
> > > > For work queue we have schedule_delayed_work_on () API available.
> > > > But how to schedule the threaded IRQ on the same core where my
> > > > worker
> > > thread is going to run?
> > > Why do you need to worry about where your worker thread is going to run?
> > > Or IOW what use case do you have in mind?
> >
> > In my driver I can get two independent events(IRQ and kernel
> > notification). One will be handled by Threaded IRQ and other will be
> > handled by a worker and the order is not guaranteed and with two cores
> Sometimes both workers are being scheduled  parallel.
> So what is the problem even if they run in parallel, it would be really help 
> if we
> know what problem you are trying to solve?
> Even if you want to sync between these two then you can have some
> synchronisation mechanism between the two.
> What is the advantage you are going to get if they run on same core?
> 
> Sorry but these answers would really help community in resolving your problem.

I think I got what I was looking for...
synchronize_irq()

basically I need to wait/pause my worker thread execution until my threaded 
handler is complete.

Thanks for response.

Thanks,
Ram
N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a���
0��h���i

RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
> > > How can I schedule driver's worker and threaded IRQ on the same core?
> > >
> > > For work queue we have schedule_delayed_work_on () API available.
> > > But how to schedule the threaded IRQ on the same core where my worker
> > thread is going to run?
> > Why do you need to worry about where your worker thread is going to run?
> > Or IOW what use case do you have in mind?
> 
> In my driver I can get two independent events(IRQ and kernel notification). 
> One will be handled by
> Threaded IRQ and other will be handled by a worker and the order is not 
> guaranteed and with two cores
> Sometimes both workers are being scheduled  parallel.
So what is the problem even if they run in parallel, it would
be really help if we know what problem you are trying to solve?
Even if you want to sync between these two then you can have some
synchronisation mechanism between the two.
What is the advantage you are going to get if they run on same core?

Sorry but these answers would really help community in resolving your
problem.
> 
> The events I get from two sources are related so I wanted to run my workers 
> and threaded IRQ on single(same) core/cpu.
> 
> Thanks,
> Ram
>  
> 


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


RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread Pallala, Ramakrishna
> > How can I schedule driver's worker and threaded IRQ on the same core?
> >
> > For work queue we have schedule_delayed_work_on () API available.
> > But how to schedule the threaded IRQ on the same core where my worker
> thread is going to run?
> Why do you need to worry about where your worker thread is going to run?
> Or IOW what use case do you have in mind?

In my driver I can get two independent events(IRQ and kernel notification). One 
will be handled by
Threaded IRQ and other will be handled by a worker and the order is not 
guaranteed and with two cores
Sometimes both workers are being scheduled  parallel.

The events I get from two sources are related so I wanted to run my workers and 
threaded IRQ on single(same) core/cpu.

Thanks,
Ram
 

N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a���
0��h���i

Re: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 12:19 +, Pallala, Ramakrishna wrote:
> Hi,
> 
> How can I schedule driver's worker and threaded IRQ on the same core?
> 
> For work queue we have schedule_delayed_work_on () API available.
> But how to schedule the threaded IRQ on the same core where my worker thread 
> is going to run?
Why do you need to worry about where your worker thread is going to run?
Or IOW what use case do you have in mind?
> Thanks in Advance.
> 
> Thanks,
> Ram
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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


Re: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 12:19 +, Pallala, Ramakrishna wrote:
 Hi,
 
 How can I schedule driver's worker and threaded IRQ on the same core?
 
 For work queue we have schedule_delayed_work_on () API available.
 But how to schedule the threaded IRQ on the same core where my worker thread 
 is going to run?
Why do you need to worry about where your worker thread is going to run?
Or IOW what use case do you have in mind?
 Thanks in Advance.
 
 Thanks,
 Ram
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/


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


RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread Pallala, Ramakrishna
  How can I schedule driver's worker and threaded IRQ on the same core?
 
  For work queue we have schedule_delayed_work_on () API available.
  But how to schedule the threaded IRQ on the same core where my worker
 thread is going to run?
 Why do you need to worry about where your worker thread is going to run?
 Or IOW what use case do you have in mind?

In my driver I can get two independent events(IRQ and kernel notification). One 
will be handled by
Threaded IRQ and other will be handled by a worker and the order is not 
guaranteed and with two cores
Sometimes both workers are being scheduled  parallel.

The events I get from two sources are related so I wanted to run my workers and 
threaded IRQ on single(same) core/cpu.

Thanks,
Ram
 

N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�j:+v���zZ+��+zf���h���~i���z��w���?��)ߢf��^jǫy�m��@A�a���
0��h���i

RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
   How can I schedule driver's worker and threaded IRQ on the same core?
  
   For work queue we have schedule_delayed_work_on () API available.
   But how to schedule the threaded IRQ on the same core where my worker
  thread is going to run?
  Why do you need to worry about where your worker thread is going to run?
  Or IOW what use case do you have in mind?
 
 In my driver I can get two independent events(IRQ and kernel notification). 
 One will be handled by
 Threaded IRQ and other will be handled by a worker and the order is not 
 guaranteed and with two cores
 Sometimes both workers are being scheduled  parallel.
So what is the problem even if they run in parallel, it would
be really help if we know what problem you are trying to solve?
Even if you want to sync between these two then you can have some
synchronisation mechanism between the two.
What is the advantage you are going to get if they run on same core?

Sorry but these answers would really help community in resolving your
problem.
 
 The events I get from two sources are related so I wanted to run my workers 
 and threaded IRQ on single(same) core/cpu.
 
 Thanks,
 Ram
  
 


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


RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread Pallala, Ramakrishna
 On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
How can I schedule driver's worker and threaded IRQ on the same core?
   
For work queue we have schedule_delayed_work_on () API available.
But how to schedule the threaded IRQ on the same core where my
worker
   thread is going to run?
   Why do you need to worry about where your worker thread is going to run?
   Or IOW what use case do you have in mind?
 
  In my driver I can get two independent events(IRQ and kernel
  notification). One will be handled by Threaded IRQ and other will be
  handled by a worker and the order is not guaranteed and with two cores
 Sometimes both workers are being scheduled  parallel.
 So what is the problem even if they run in parallel, it would be really help 
 if we
 know what problem you are trying to solve?
 Even if you want to sync between these two then you can have some
 synchronisation mechanism between the two.
 What is the advantage you are going to get if they run on same core?
 
 Sorry but these answers would really help community in resolving your problem.

I think I got what I was looking for...
synchronize_irq()

basically I need to wait/pause my worker thread execution until my threaded 
handler is complete.

Thanks for response.

Thanks,
Ram
N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�j:+v���zZ+��+zf���h���~i���z��w���?��)ߢf��^jǫy�m��@A�a���
0��h���i

RE: How to schedule worker and threaded IRQ on same cpu/core

2012-10-02 Thread anish kumar
On Tue, 2012-10-02 at 15:14 +, Pallala, Ramakrishna wrote:
  On Tue, 2012-10-02 at 12:54 +, Pallala, Ramakrishna wrote:
 How can I schedule driver's worker and threaded IRQ on the same core?

 For work queue we have schedule_delayed_work_on () API available.
 But how to schedule the threaded IRQ on the same core where my
 worker
thread is going to run?
Why do you need to worry about where your worker thread is going to run?
Or IOW what use case do you have in mind?
  
   In my driver I can get two independent events(IRQ and kernel
   notification). One will be handled by Threaded IRQ and other will be
   handled by a worker and the order is not guaranteed and with two cores
  Sometimes both workers are being scheduled  parallel.
  So what is the problem even if they run in parallel, it would be really 
  help if we
  know what problem you are trying to solve?
  Even if you want to sync between these two then you can have some
  synchronisation mechanism between the two.
  What is the advantage you are going to get if they run on same core?
  
  Sorry but these answers would really help community in resolving your 
  problem.
 
 I think I got what I was looking for...
 synchronize_irq()
  /*
   * We made sure that no hardirq handler is running. Now verify
   * that no threaded handlers are active.
   */
  wait_event(desc-wait_for_threads, !
atomic_read(desc-threads_active));

I think this makes sense now.
 
 basically I need to wait/pause my worker thread execution until my threaded 
 handler is complete.
 
 Thanks for response.
 
 Thanks,
 Ram


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