irqbalance.1: remove misleading comment

It appears this is now the source and the original has been lost, so
don't scare people away from editing it.
irqbalance.1: update homepage
irqbalance.1: fix some typos
irqbalance.1: always capitalize CPU
irqbalance.1: always capitalize NUMA
irqbalance.1: always capitalize IRQ
irqbalance.1: line wrap description and fix grammar
irqbalance.1: use full stops when appropriate
Merge pull request #4 from toofishes/manpage

Manpage cleanups and fixes
fix memory leak in classify code

If a system has no pci devices the opening of the pci bus directory in
rebuild_irq_db will fail, leading to a memory leak.  Fix it by freeing the list
we create in that function always on exit

Reported-by: Tom Li <biergaizi2009@gmail.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Tom Li <biergaizi2009@gmail.com>
irqbalance: separate cmomand line banned irqs from listed banned irqs

irqbalance was using one list for tracking banned irqs, but the list was being
used for disperate pruposes in different places.  It was tracking command line
banned irqs and irqs that were banned via banscript and policyscript.  The
former needs to be remembered accross db rebuilds, while the latter needs to be
rebuilt every time.  This patch separates the two in to two lists, so that we
don't stop banning command line specified irqs after the first db rebuild.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
track hint policy on a per-irq basis

Currently the hintpolicy for irqbalance is a global setting, applied equally to
all irqs.  Thats undesireable however, as different devices may want to follow
different policies.  Track the hint policy in each irq_info struct instead.
This still just follows the global policy, but paves the way to allow overriding
through the policyscript option

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
make hintpolicy user policy configurable

Add hintpolicy to the list of keys that the policy script can return.  This
allows individual device classes/irqs to override the global hint policy

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Add logging for policyscript overrides

Be a bit more vocal about overrides imposed by policyscripts, so admins
understand whats going on

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Balance correctly IRQs reappearing

If IRQ disappears and reappears later (this happens frequently for Xen)
the IRQ is not balanced correctly due to overflow in irq_count (as the
counter got smaller and difference cause overflow).
Rescan if this happens fix the problem.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Merge pull request #8 from freddy77/reappearing

Rescan IRQs if we detect an irq count overflow (caused by irqs being free and reallocated)
classify.c: Initialize struct user_irq_policy

commit 2139f8a8952c9eeea6e77e5587f13cd17724e23d "make hintpolicy user
policy configurable" introduced a regression where if the user does not
provide a policy script the user_irq_policy struct will not be
initialized.

The common pattern for get_irq_user_policy() is that a struct
user_irq_policy is allocated on the stack, get_irq_user_policy() is
called, and then pol.ban == 1 is tested.  Without a policy script this
became undefined since the struct was not being initialized.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Mark functions and variable static where appropriate

This makes functions and globals static when then can be.  Additionally
this makes add_new_irq() return void since nothing used the returned
struct irq_info*

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Merge pull request #9 from sbohrer/master

Initialization bugfix and marking functions static where appropriate
Fix inconsequential bug in bitmap_scnprintf

Fix incorrect code in bitmap_scnprintf that could cause it to give truncated
output when nmaskbits > 32 and nmaskbits % 32 != 0.  In practice this problem
was never encountered because NR_CPUS % 32 == 0.  So this change fixes the
code for the sake of correctness even though the bug did not actually cause a
real problem.