linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] genirq: export __irq_set_affinity symbol
@ 2016-05-12  5:51 Xie XiuQi
  2016-05-12  7:28 ` Christoph Hellwig
  2016-05-12  7:43 ` Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: Xie XiuQi @ 2016-05-12  5:51 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, huawei.libin, wangyijing

__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 <huawei.libin@huawei.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
---
 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(&desc->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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] genirq: export __irq_set_affinity symbol
  2016-05-12  5:51 [PATCH] genirq: export __irq_set_affinity symbol Xie XiuQi
@ 2016-05-12  7:28 ` Christoph Hellwig
  2016-05-12  7:43 ` Thomas Gleixner
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2016-05-12  7:28 UTC (permalink / raw)
  To: Xie XiuQi; +Cc: tglx, linux-kernel, huawei.libin, wangyijing

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] genirq: export __irq_set_affinity symbol
  2016-05-12  5:51 [PATCH] genirq: export __irq_set_affinity symbol Xie XiuQi
  2016-05-12  7:28 ` Christoph Hellwig
@ 2016-05-12  7:43 ` Thomas Gleixner
  2016-05-12 11:42   ` Xie XiuQi
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2016-05-12  7:43 UTC (permalink / raw)
  To: Xie XiuQi; +Cc: linux-kernel, huawei.libin, wangyijing

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] genirq: export __irq_set_affinity symbol
  2016-05-12  7:43 ` Thomas Gleixner
@ 2016-05-12 11:42   ` Xie XiuQi
  2016-05-14 15:29     ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Xie XiuQi @ 2016-05-12 11:42 UTC (permalink / raw)
  To: Thomas Gleixner, hch; +Cc: linux-kernel, huawei.libin, wangyijing

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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] genirq: export __irq_set_affinity symbol
  2016-05-12 11:42   ` Xie XiuQi
@ 2016-05-14 15:29     ` Thomas Gleixner
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2016-05-14 15:29 UTC (permalink / raw)
  To: Xie XiuQi; +Cc: hch, linux-kernel, huawei.libin, wangyijing

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-14 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12  5:51 [PATCH] genirq: export __irq_set_affinity symbol Xie XiuQi
2016-05-12  7:28 ` Christoph Hellwig
2016-05-12  7:43 ` Thomas Gleixner
2016-05-12 11:42   ` Xie XiuQi
2016-05-14 15:29     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).