From: Michael Ellerman <michael@ellerman.id.au>
To: Michael Neuling <mikey@neuling.org>
Cc: linuxppc-dev@ozlabs.org,
Arjen Van De Ven <arjanvandeven@gmail.com>,
linux-kernel@vger.kernel.org, Neil Horman <nhorman@gmail.com>
Subject: Re: [PATCH] irqbalance, powerpc: add IRQs without settable SMP affinity to banned list
Date: Thu, 23 Sep 2010 18:22:39 +1000 [thread overview]
Message-ID: <1285230159.30617.2.camel@concordia> (raw)
In-Reply-To: <12972.1285135457@neuling.org>
[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]
On Wed, 2010-09-22 at 16:04 +1000, Michael Neuling wrote:
> When irqblance attempts writes to the IPI smp_affinity (ie.
> /proc/irq/16/smp_affinity in the above example) it fails but irqbalance
> ignores currently ignores this.
>
> This patch catches these write fails and in this case adds that IRQ
> number to the banned IRQ list. This will catch the above IPI case and
> any other IRQ where the SMP affinity can't be set.
Cool!
> Index: irqbalance/irqlist.c
> ===================================================================
> --- irqbalance.orig/irqlist.c
> +++ irqbalance/irqlist.c
> @@ -67,7 +67,7 @@
> DIR *dir;
> struct dirent *entry;
> char *c, *c2;
> - int nr , count = 0;
> + int nr , count = 0, can_set = 1;
> char buf[PATH_MAX];
> sprintf(buf, "/proc/irq/%i", number);
> dir = opendir(buf);
> @@ -80,7 +80,7 @@
> size_t size = 0;
> FILE *file;
> sprintf(buf, "/proc/irq/%i/smp_affinity", number);
> - file = fopen(buf, "r");
> + file = fopen(buf, "r+");
> if (!file)
> continue;
> if (getline(&line, &size, file)==0) {
> @@ -89,7 +89,14 @@
> continue;
> }
> cpumask_parse_user(line, strlen(line), irq->mask);
> - fclose(file);
> + /*
> + * Check that we can write the affinity, if
> + * not take it out of the list.
> + */
> + if (fwrite(line, strlen(line) - 1, 1, file) == 0)
if (fputs(line, file) == EOF)
?
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <michael@ellerman.id.au>
To: Michael Neuling <mikey@neuling.org>
Cc: Arjen Van De Ven <arjanvandeven@gmail.com>,
Neil Horman <nhorman@gmail.com>,
linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqbalance, powerpc: add IRQs without settable SMP affinity to banned list
Date: Thu, 23 Sep 2010 18:22:39 +1000 [thread overview]
Message-ID: <1285230159.30617.2.camel@concordia> (raw)
In-Reply-To: <12972.1285135457@neuling.org>
[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]
On Wed, 2010-09-22 at 16:04 +1000, Michael Neuling wrote:
> When irqblance attempts writes to the IPI smp_affinity (ie.
> /proc/irq/16/smp_affinity in the above example) it fails but irqbalance
> ignores currently ignores this.
>
> This patch catches these write fails and in this case adds that IRQ
> number to the banned IRQ list. This will catch the above IPI case and
> any other IRQ where the SMP affinity can't be set.
Cool!
> Index: irqbalance/irqlist.c
> ===================================================================
> --- irqbalance.orig/irqlist.c
> +++ irqbalance/irqlist.c
> @@ -67,7 +67,7 @@
> DIR *dir;
> struct dirent *entry;
> char *c, *c2;
> - int nr , count = 0;
> + int nr , count = 0, can_set = 1;
> char buf[PATH_MAX];
> sprintf(buf, "/proc/irq/%i", number);
> dir = opendir(buf);
> @@ -80,7 +80,7 @@
> size_t size = 0;
> FILE *file;
> sprintf(buf, "/proc/irq/%i/smp_affinity", number);
> - file = fopen(buf, "r");
> + file = fopen(buf, "r+");
> if (!file)
> continue;
> if (getline(&line, &size, file)==0) {
> @@ -89,7 +89,14 @@
> continue;
> }
> cpumask_parse_user(line, strlen(line), irq->mask);
> - fclose(file);
> + /*
> + * Check that we can write the affinity, if
> + * not take it out of the list.
> + */
> + if (fwrite(line, strlen(line) - 1, 1, file) == 0)
if (fputs(line, file) == EOF)
?
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-09-23 8:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-22 6:04 [PATCH] irqbalance, powerpc: add IRQs without settable SMP affinity to banned list Michael Neuling
2010-09-22 6:04 ` Michael Neuling
2010-09-23 8:22 ` Michael Ellerman [this message]
2010-09-23 8:22 ` Michael Ellerman
2010-09-23 10:57 ` Michael Neuling
2010-09-23 10:57 ` Michael Neuling
2010-09-23 13:13 ` Neil Horman
2010-09-23 13:13 ` Neil Horman
2010-09-24 5:03 ` Michael Ellerman
2010-09-24 5:03 ` Michael Ellerman
2010-09-24 6:56 ` Michael Neuling
2010-09-24 6:56 ` Michael Neuling
2010-09-24 10:37 ` Neil Horman
2010-09-24 10:37 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285230159.30617.2.camel@concordia \
--to=michael@ellerman.id.au \
--cc=arjanvandeven@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=nhorman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.