Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399676 > unrolled thread

[PATCH] genirq: export __irq_set_affinity symbol

Started byXie XiuQi <xiexiuqi@huawei.com>
First post2016-05-12 07:50 +0200
Last post2016-05-14 17:40 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] genirq: export __irq_set_affinity symbol Xie XiuQi <xiexiuqi@huawei.com> - 2016-05-12 07:50 +0200
    Re: [PATCH] genirq: export __irq_set_affinity symbol Christoph Hellwig <hch@infradead.org> - 2016-05-12 09:30 +0200
    Re: [PATCH] genirq: export __irq_set_affinity symbol Thomas Gleixner <tglx@linutronix.de> - 2016-05-12 09:50 +0200
      Re: [PATCH] genirq: export __irq_set_affinity symbol Xie XiuQi <xiexiuqi@huawei.com> - 2016-05-12 13:50 +0200
        Re: [PATCH] genirq: export __irq_set_affinity symbol Thomas Gleixner <tglx@linutronix.de> - 2016-05-14 17:40 +0200

#1399676 — [PATCH] genirq: export __irq_set_affinity symbol

FromXie XiuQi <xiexiuqi@huawei.com>
Date2016-05-12 07:50 +0200
Subject[PATCH] genirq: export __irq_set_affinity symbol
Message-ID<rxRFw-7z3-1@gated-at.bofh.it>
__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

[toc] | [next] | [standalone]


#1399712

FromChristoph Hellwig <hch@infradead.org>
Date2016-05-12 09:30 +0200
Message-ID<rxTeh-WJ-1@gated-at.bofh.it>
In reply to#1399676
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.

[toc] | [prev] | [next] | [standalone]


#1399722

FromThomas Gleixner <tglx@linutronix.de>
Date2016-05-12 09:50 +0200
Message-ID<rxTxD-17U-5@gated-at.bofh.it>
In reply to#1399676
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

[toc] | [prev] | [next] | [standalone]


#1399957

FromXie XiuQi <xiexiuqi@huawei.com>
Date2016-05-12 13:50 +0200
Message-ID<rxXhU-4OQ-13@gated-at.bofh.it>
In reply to#1399722
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
> 
> 

[toc] | [prev] | [next] | [standalone]


#1401100

FromThomas Gleixner <tglx@linutronix.de>
Date2016-05-14 17:40 +0200
Message-ID<ryJPA-37I-15@gated-at.bofh.it>
In reply to#1399957
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web