Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 595856 Details for
Bug 837049
irqbalance 1.0.3 distributes network interrupts across cpus resulting in packet drops
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch irqbalance to add --affinity-helper option to allow a user-space program to supply affinity hints
irqbalance.affinity_helper.patch (text/plain), 4.54 KB, created by
Andrew J. Schorr
on 2012-07-03 02:02:47 UTC
(
hide
)
Description:
Patch irqbalance to add --affinity-helper option to allow a user-space program to supply affinity hints
Filename:
MIME Type:
Creator:
Andrew J. Schorr
Created:
2012-07-03 02:02:47 UTC
Size:
4.54 KB
patch
obsolete
>diff --git a/bitmap.c b/bitmap.c >index 4842b9d..bdb2d10 100644 >--- a/bitmap.c >+++ b/bitmap.c >@@ -377,3 +377,100 @@ int __bitmap_parse(const char *buf, unsigned int buflen, > > return 0; > } >+ >+/** >+ * __bitmap_parselist - convert list format ASCII string to bitmap >+ * @buf: read nul-terminated user string from this buffer >+ * @buflen: buffer size in bytes. If string is smaller than this >+ * then it must be terminated with a \0. >+ * @maskp: write resulting mask here >+ * @nmaskbits: number of bits in mask to be written >+ * >+ * Input format is a comma-separated list of decimal numbers and >+ * ranges. Consecutively set bits are shown as two hyphen-separated >+ * decimal numbers, the smallest and largest bit numbers set in >+ * the range. >+ * >+ * Returns 0 on success, -errno on invalid input strings. >+ * Error values: >+ * %-EINVAL: second number in range smaller than first >+ * %-EINVAL: invalid character in string >+ * %-ERANGE: bit number specified too large for mask >+ */ >+static int __bitmap_parselist(const char *buf, unsigned int buflen, >+ unsigned long *maskp, >+ int nmaskbits) >+{ >+ unsigned a, b; >+ int c, old_c, totaldigits; >+ int exp_digit, in_range; >+ >+ totaldigits = c = 0; >+ bitmap_zero(maskp, nmaskbits); >+ do { >+ exp_digit = 1; >+ in_range = 0; >+ a = b = 0; >+ >+ /* Get the next cpu# or a range of cpu#'s */ >+ while (buflen) { >+ old_c = c; >+ c = *buf++; >+ buflen--; >+ if (isspace(c)) >+ continue; >+ >+ /* >+ * If the last character was a space and the current >+ * character isn't '\0', we've got embedded whitespace. >+ * This is a no-no, so throw an error. >+ */ >+ if (totaldigits && c && isspace(old_c)) >+ return -EINVAL; >+ >+ /* A '\0' or a ',' signal the end of a cpu# or range */ >+ if (c == '\0' || c == ',') >+ break; >+ >+ if (c == '-') { >+ if (exp_digit || in_range) >+ return -EINVAL; >+ b = 0; >+ in_range = 1; >+ exp_digit = 1; >+ continue; >+ } >+ >+ if (!isdigit(c)) >+ return -EINVAL; >+ >+ b = b * 10 + (c - '0'); >+ if (!in_range) >+ a = b; >+ exp_digit = 0; >+ totaldigits++; >+ } >+ if (!(a <= b)) >+ return -EINVAL; >+ if (b >= nmaskbits) >+ return -ERANGE; >+ while (a <= b) { >+ set_bit(a, maskp); >+ a++; >+ } >+ } while (buflen && c == ','); >+ return 0; >+} >+ >+int bitmap_parselist(const char *bp, unsigned long *maskp, int nmaskbits) >+{ >+ char *nl = strchr(bp, '\n'); >+ int len; >+ >+ if (nl) >+ len = nl - bp; >+ else >+ len = strlen(bp); >+ >+ return __bitmap_parselist(bp, len, maskp, nmaskbits); >+} >diff --git a/classify.c b/classify.c >index ba46a3b..a3932a1 100644 >--- a/classify.c >+++ b/classify.c >@@ -201,6 +201,26 @@ assign_affinity_hint: > cpumask_parse_user(lcpu_mask, strlen(lcpu_mask), > new->affinity_hint); > free(lcpu_mask); >+ >+ if (affinity_helper) { >+ char cmd[strlen(affinity_helper)+24+strlen(devpath)]; >+ char *cpulist; >+ sprintf(cmd,"%s %d %s", >+ affinity_helper, irq, devpath); >+ if (!(fd = popen(cmd, "r"))) { >+ syslog(LOG_WARNING, "WARNING: command failed: %s\n", cmd); >+ goto out; >+ } >+ cpulist = NULL; >+ fscanf(fd, "%as", &cpulist); >+ pclose(fd); >+ if (!cpulist) >+ goto out; >+ if (cpulist_parse(cpulist, new->affinity_hint) < 0) >+ syslog(LOG_WARNING, "WARNING: cannot parse results from %s: %s\n", >+ cmd, cpulist); >+ free(cpulist); >+ } > out: > if (debug_mode) > printf("Adding IRQ %d to database\n", irq); >diff --git a/irqbalance.c b/irqbalance.c >index 7ef72af..d777be5 100644 >--- a/irqbalance.c >+++ b/irqbalance.c >@@ -52,6 +52,7 @@ enum hp_e hint_policy = HINT_POLICY_SUBSET; > unsigned long power_thresh = ULONG_MAX; > unsigned long long cycle_count = 0; > char *pidfile = NULL; >+char *affinity_helper = NULL; > > void sleep_approx(int seconds) > { >@@ -75,6 +76,7 @@ struct option lopts[] = { > {"hintpolicy", 1, NULL, 'h'}, > {"powerthresh", 1, NULL, 'p'}, > {"banirq", 1 , NULL, 'i'}, >+ {"affinity-helper", 1 , NULL, 'a'}, > {"pid", 1, NULL, 's'}, > {0, 0, 0, 0} > }; >@@ -92,13 +94,16 @@ static void parse_command_line(int argc, char **argv) > unsigned long val; > > while ((opt = getopt_long(argc, argv, >- "odfh:i:p:s:", >+ "a:odfh:i:p:s:", > lopts, &longind)) != -1) { > > switch(opt) { > case '?': > usage(); > exit(1); >+ case 'a': >+ affinity_helper = optarg; >+ break; > case 'd': > debug_mode=1; > foreground_mode=1; >diff --git a/irqbalance.h b/irqbalance.h >index 8ec7c23..37f1373 100644 >--- a/irqbalance.h >+++ b/irqbalance.h >@@ -68,6 +68,7 @@ extern int need_rescan; > extern enum hp_e hint_policy; > extern unsigned long long cycle_count; > extern unsigned long power_thresh; >+extern char *affinity_helper; > > /* > * Numa node access routines
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 837049
: 595856 |
596438