Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-14 Thread Thomas Gleixner
On Thu, 12 May 2016, Xie XiuQi wrote:

> On 2016/5/12 15:43, Thomas Gleixner wrote:
> > On Thu, 12 May 2016, Xie XiuQi wrote:
> > 
> >> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> >> been exported.
> >>
> >> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> >> and irq_force_affinity in kernel modules.
> > 
> > Please show the code using the exports first. We don't export symbols w/o
> > knowing the usecase.
> 
> The default affinity of the interrupts for all devices is always CPU0,
> this may cause the latency on CPU0 is very high when some interrupt
> occurs very frequently.
> 
> I want to migrate an interrupt to another cpu when the driver loading.

What's wrong with setting the affinity from user space?
 
> My code like this:
> 
> /* I want to bind irq_vector to cpu 3 */

And that CPU 3 is hard coded into the driver? That's just wrong. 

Thanks,

tglx


Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-14 Thread Thomas Gleixner
On Thu, 12 May 2016, Xie XiuQi wrote:

> On 2016/5/12 15:43, Thomas Gleixner wrote:
> > On Thu, 12 May 2016, Xie XiuQi wrote:
> > 
> >> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> >> been exported.
> >>
> >> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> >> and irq_force_affinity in kernel modules.
> > 
> > Please show the code using the exports first. We don't export symbols w/o
> > knowing the usecase.
> 
> The default affinity of the interrupts for all devices is always CPU0,
> this may cause the latency on CPU0 is very high when some interrupt
> occurs very frequently.
> 
> I want to migrate an interrupt to another cpu when the driver loading.

What's wrong with setting the affinity from user space?
 
> My code like this:
> 
> /* I want to bind irq_vector to cpu 3 */

And that CPU 3 is hard coded into the driver? That's just wrong. 

Thanks,

tglx


Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Xie XiuQi
On 2016/5/12 15:43, Thomas Gleixner wrote:
> On Thu, 12 May 2016, Xie XiuQi wrote:
> 
>> __irq_set_affinity is declared in include/linux/interrupt.h, but not
>> been exported.
>>
>> We export it now, so we could use __irq_set_affinity, irq_set_affinity
>> and irq_force_affinity in kernel modules.
> 
> Please show the code using the exports first. We don't export symbols w/o
> knowing the usecase.

The default affinity of the interrupts for all devices is always CPU0,
this may cause the latency on CPU0 is very high when some interrupt
occurs very frequently.

I want to migrate an interrupt to another cpu when the driver loading.

My code like this:

/* I want to bind irq_vector to cpu 3 */
...
cpumask_var_t mask;
cpumask_set_cpu(3, mask);
irq_set_affinity(irq_vector, mask);
...

build wanring:
WARNING: "__irq_set_affinity" [/root/drivers/dr.ko] undefined!

insmod error:
dr: Unknown symbol __irq_set_affinity (err 0)

Thanks,
Xie XiuQi

> 
> Thanks,
> 
>   tglx
> 
> 



Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Xie XiuQi
On 2016/5/12 15:43, Thomas Gleixner wrote:
> On Thu, 12 May 2016, Xie XiuQi wrote:
> 
>> __irq_set_affinity is declared in include/linux/interrupt.h, but not
>> been exported.
>>
>> We export it now, so we could use __irq_set_affinity, irq_set_affinity
>> and irq_force_affinity in kernel modules.
> 
> Please show the code using the exports first. We don't export symbols w/o
> knowing the usecase.

The default affinity of the interrupts for all devices is always CPU0,
this may cause the latency on CPU0 is very high when some interrupt
occurs very frequently.

I want to migrate an interrupt to another cpu when the driver loading.

My code like this:

/* I want to bind irq_vector to cpu 3 */
...
cpumask_var_t mask;
cpumask_set_cpu(3, mask);
irq_set_affinity(irq_vector, mask);
...

build wanring:
WARNING: "__irq_set_affinity" [/root/drivers/dr.ko] undefined!

insmod error:
dr: Unknown symbol __irq_set_affinity (err 0)

Thanks,
Xie XiuQi

> 
> Thanks,
> 
>   tglx
> 
> 



Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Thomas Gleixner
On Thu, 12 May 2016, Xie XiuQi wrote:

> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> been exported.
> 
> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> and irq_force_affinity in kernel modules.

Please show the code using the exports first. We don't export symbols w/o
knowing the usecase.

Thanks,

tglx


Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Thomas Gleixner
On Thu, 12 May 2016, Xie XiuQi wrote:

> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> been exported.
> 
> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> and irq_force_affinity in kernel modules.

Please show the code using the exports first. We don't export symbols w/o
knowing the usecase.

Thanks,

tglx


Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Christoph Hellwig
On Thu, May 12, 2016 at 01:51:27PM +0800, Xie XiuQi wrote:
> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> been exported.
> 
> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> and irq_force_affinity in kernel modules.

Err, no.  Please explain your use case and show the module first.


Re: [PATCH] genirq: export __irq_set_affinity symbol

2016-05-12 Thread Christoph Hellwig
On Thu, May 12, 2016 at 01:51:27PM +0800, Xie XiuQi wrote:
> __irq_set_affinity is declared in include/linux/interrupt.h, but not
> been exported.
> 
> We export it now, so we could use __irq_set_affinity, irq_set_affinity
> and irq_force_affinity in kernel modules.

Err, no.  Please explain your use case and show the module first.


[PATCH] genirq: export __irq_set_affinity symbol

2016-05-11 Thread Xie XiuQi
__irq_set_affinity is declared in include/linux/interrupt.h, but not
been exported.

We export it now, so we could use __irq_set_affinity, irq_set_affinity
and irq_force_affinity in kernel modules.

Cc: Li Bin 
Cc: Yijing Wang 
Signed-off-by: Xie XiuQi 
---
 kernel/irq/manage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index cc1cc64..e131245 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -239,6 +239,7 @@ int __irq_set_affinity(unsigned int irq, const struct 
cpumask *mask, bool force)
raw_spin_unlock_irqrestore(>lock, flags);
return ret;
 }
+EXPORT_SYMBOL_GPL(__irq_set_affinity);
 
 int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
 {
-- 
1.8.3.1



[PATCH] genirq: export __irq_set_affinity symbol

2016-05-11 Thread Xie XiuQi
__irq_set_affinity is declared in include/linux/interrupt.h, but not
been exported.

We export it now, so we could use __irq_set_affinity, irq_set_affinity
and irq_force_affinity in kernel modules.

Cc: Li Bin 
Cc: Yijing Wang 
Signed-off-by: Xie XiuQi 
---
 kernel/irq/manage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index cc1cc64..e131245 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -239,6 +239,7 @@ int __irq_set_affinity(unsigned int irq, const struct 
cpumask *mask, bool force)
raw_spin_unlock_irqrestore(>lock, flags);
return ret;
 }
+EXPORT_SYMBOL_GPL(__irq_set_affinity);
 
 int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
 {
-- 
1.8.3.1