summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_intr.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-06-22 11:32:23 +0000
committermelifaro <melifaro@FreeBSD.org>2014-06-22 11:32:23 +0000
commit3f08add0c8586ab8a27181b32dba1d4a66da01b1 (patch)
tree0feb60dce856f3032ddc5841cc1bc825f0654b32 /sys/kern/kern_intr.c
parentfe156048d8ff669c6f66517f92ba7fcc7816c6a5 (diff)
downloadFreeBSD-src-3f08add0c8586ab8a27181b32dba1d4a66da01b1.zip
FreeBSD-src-3f08add0c8586ab8a27181b32dba1d4a66da01b1.tar.gz
Permit changing cpu mask for cpu set 1 in presence of drivers
binding their threads to particular CPU. Changing ithread cpu mask is now performed by special cpuset_setithread(). It creates additional cpuset root group on first bind invocation. No objection: jhb Tested by: hiren MFC after: 2 weeks Sponsored by: Yandex LLC
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r--sys/kern/kern_intr.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index e4f1c82..5555d68 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -295,7 +295,6 @@ intr_event_create(struct intr_event **event, void *source, int flags, int irq,
int
intr_event_bind(struct intr_event *ie, u_char cpu)
{
- cpuset_t mask;
lwpid_t id;
int error;
@@ -316,14 +315,9 @@ intr_event_bind(struct intr_event *ie, u_char cpu)
*/
mtx_lock(&ie->ie_lock);
if (ie->ie_thread != NULL) {
- CPU_ZERO(&mask);
- if (cpu == NOCPU)
- CPU_COPY(cpuset_root, &mask);
- else
- CPU_SET(cpu, &mask);
id = ie->ie_thread->it_thread->td_tid;
mtx_unlock(&ie->ie_lock);
- error = cpuset_setthread(id, &mask);
+ error = cpuset_setithread(id, cpu);
if (error)
return (error);
} else
@@ -332,14 +326,10 @@ intr_event_bind(struct intr_event *ie, u_char cpu)
if (error) {
mtx_lock(&ie->ie_lock);
if (ie->ie_thread != NULL) {
- CPU_ZERO(&mask);
- if (ie->ie_cpu == NOCPU)
- CPU_COPY(cpuset_root, &mask);
- else
- CPU_SET(ie->ie_cpu, &mask);
+ cpu = ie->ie_cpu;
id = ie->ie_thread->it_thread->td_tid;
mtx_unlock(&ie->ie_lock);
- (void)cpuset_setthread(id, &mask);
+ (void)cpuset_setithread(id, cpu);
} else
mtx_unlock(&ie->ie_lock);
return (error);
OpenPOWER on IntegriCloud