Commit graph

163050 commits

Author SHA1 Message Date
Robin Getz 837ec2d56c Blackfin: catch hardware errors earlier during booting
Allow hardware errors to be caught during early portions of booting, and
leave something in the shadow console that people can use to debug their
system with (to be printed out by the bootloader on next reset).

This enables the hardare error interrupts in head.S, allowing us to find
hardware errors when they happen (well, as much as you can with a hardware
error) and prints out the trace if it is enabled.  This will catch errors
(like booting the wrong image on a 533) which previously resulted in a
infinite loop/hang, as well as random hardware errors before before
setup_arch().

To disable this debug only feature - turn off EARLY_PRINTK.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:44 -04:00
Robin Getz 3f871feaf3 Blackfin: add an early shadow console
Add a memory based shadow console to keep a copy of the printk buffer in a
location which can be found externally.  This allows bootloaders to locate
and utilize the log buffer in case of silent (early/resume/etc...) crashes.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:43 -04:00
Mike Frysinger 53e18df745 Blackfin: add support for common FDPIC ptrace requests
The FDPIC arches support a standard set of ptrace requests so rather than
define our own custom API, hook up those requests for common code to
leverage.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:42 -04:00
Mike Frysinger 81c969a8bc Blackfin: push SRAM locks down into related ifdefs
Rather than defining the locks and initializing them all the time, only do
so when we actually need them (i.e. the SRAM regions exist).  This avoids
dead data and code bloat during runtime.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:41 -04:00
Sonic Zhang 9c954f8941 Blackfin: unify duplicated SMP checks in L2 cache kconfig
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:59 -04:00
Michael Hennerich 204844ebd0 Blackfin: rename PCF8574 driver config
The "TWI_KEYPAD" driver was renamed to "INPUT_PCF8574", so update the
defines in the board resources accordingly.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:57 -04:00
Robin Getz 2f812c0bd5 Blackfin: clean up early memory setup code
Remove code duplication, and only print out memory warnings when they are
an actual problem.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:54 -04:00
Mike Frysinger a769094061 Blackfin: fix module reloc handling for all memory regions
The current module relocation code has spotty handling wrt different
memory regions (like L1 instruction).  Rather than try to fix each
little spot, use the new common memory functions to greatly simplify
everything and make sure it is always correct.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:52 -04:00
Mike Frysinger 459fec9073 Blackfin: cleanup module section checking
The current module section handling code has a lot of verbose statements
copied and pasted throughout which makes it pretty hard to digest at a
glance.  By unifying all of these up front, it is a lot easier to quickly
get an idea of what is actually going on.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:51 -04:00
Mike Frysinger 70deca9f9c Blackfin: convert malloc()/memset() to zalloc() in module code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:49 -04:00
Mike Frysinger dc6b1ac984 Blackfin: cleanup printk() usage in module code
Convert all printk() statements to use the common pr_xxx() funcs and use
the new pr_fmt() function to standardize all of the output.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:48 -04:00
Robin Getz 22532578ee Blackfin: reject outdated/unused/wrong relocation types
All kernel modules are required to be built with -mlong-calls and thus
should not generate any of these relocations.  If they do, it means the
module has not been compiled properly, so rather than trying to handle
them (and running into random run time errors) just error out on module
load to force the module to be compiled correctly.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:46 -04:00
Mike Frysinger c014e15a2f Blackfin: convert ptrace to new memory functions
Now that we have a Blackfin memory function to figure out how to properly
access the different regions, drop the custom memory range checks in our
ptrace code and use that.  It makes the code nicer and fixes bugs where
the ptrace logic wasn't handling all the different regions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:45 -04:00
Mike Frysinger 18070dd669 Blackfin: cleanup traps decode_address() a bit
Unify the address display to shrink the code, and add missing decoding of
a few special Blackfin-specific regions (L1 ROM and MMRs).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:43 -04:00
Philippe Gerum f4e129399c Blackfin: inline I-pipe bypass code in ret_from_exception
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:42 -04:00
Philippe Gerum 9ea7770fdb Blackfin: sanitize manual control of IPEND[4]
Cleanup is performed in two ways:

- remove extraneous updates of IPEND[4] w/ CONFIG_IPIPE,
  and document remaining use.

- substitute pop-reg-from-stack instructions with plain SP fixups in
  all save-RETI-then-discard patterns.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:40 -04:00
Philippe Gerum 7a7967dc1b Blackfin: document __ipipe_call_irqtail
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:38 -04:00
Philippe Gerum 70f4720232 Blackfin: allow EVT5 to preempt irqtail prologue (CONFIG_DEBUG_HWERR)
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:37 -04:00
Philippe Gerum fc9afb997f Blackfin: reuse evt_evt14 handler to perform irqtail epilogue
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:36 -04:00
Philippe Gerum 9703a73c98 Blackfin: use generic name for EVT14 handler
The purpose of the EVT14 handler may depend on whether CONFIG_IPIPE is
enabled, albeit its implementation can be the same in both cases. When
the interrupt pipeline is enabled, EVT14 can be used to raise the core
priority level for the running code; when CONFIG_IPIPE is off, EVT14
can be used to lower this level before running softirq handlers.

Rename evt14_softirq to evt_evt14 to pick an identifier that fits
both, which allows to reuse the same vector setup code as well.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:34 -04:00
Philippe Gerum 6b8019c85e Blackfin: allow high priority domains to preempt schedule_tail()
ret_from_fork is always entered with hw interrupts off, which prevents
real-time domains to preempt the Linux kernel during part of the
initial context switch to the new task, which could in turn raise the
worst-case latency figures.

To avoid this, stall the root domain stage in the interrupt pipeline
to keep the scheduling tail code free from Linux-handled IRQs, then
enable hardware interrupts again.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:33 -04:00
Philippe Gerum bc569f1a77 Blackfin: export show_stack() to modules
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:32 -04:00
Philippe Gerum b9c7eb498d Blackfin: fix misnomer of some I-pipe helpers
__ipipe_{stall, unstall}_root_raw() identifiers may leave the reader
under the impression that only the virtual state is affected by these
operations, which is wrong. Pick names following the convention used
throughout the interrupt pipeline code.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:30 -04:00
Philippe Gerum d8ca63955a Blackfin: checkpatch --file arch/blackfin/kernel/ipipe.c
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:29 -04:00
Robin Getz ae4f073c40 Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]
We handle many exceptions at EVT5 (hardware error level) so that we can
catch exceptions in our exception handling code.  Today - if the global
interrupt enable bit (IPEND[4]) is set (interrupts disabled) our trap
handling code goes into a infinite loop, since we need interrupts to be
on to defer things to EVT5.

Normal kernel code should not trigger this for any reason as IPEND[4] gets
cleared early (when doing an interrupt context save) and the kernel stack
there should be sane (or something much worse is happening in the system).
But there have been a few times where this has happened, so this change
makes sure we dump a proper crash message even when things have gone south.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:28 -04:00
Barry Song d4b834c139 Blackfin: bf537-stamp: add resources for AD1938 audio card
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:26 -04:00
Yi Li e68d1ebc30 Blackfin: bf537-stamp: declare SPI IRQ resources
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:24 -04:00
Michael Hennerich f39d56ec46 Blackfin: bf537-stamp: update ADP5588 header name
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:23 -04:00
Jens Rosenboom 3933fc952a ipv6: Ignore route option with ROUTER_PREF_INVALID
RFC4191 says that "If the Reserved (10) value is received, the Route
Information Option MUST be ignored.", so this patch makes us conform
to the RFC. This is different to the usage of the Default Router
Preference, where an invalid value must indeed be treated as
PREF_MEDIUM.

Signed-off-by: Jens Rosenboom <me@jayr.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-16 17:10:38 -07:00
Jiri Pirko b9f602533e bonding: make ab_arp select active slaves as other modes
When I was implementing primary_passive option (formely named primary_lazy) I've
run into troubles with ab_arp. This is the only mode which is not using
bond_select_active_slave() function to select active slave and instead it
selects it itself. This seems to be not the right behaviour and it would be
better to do it in bond_select_active_slave() for all cases. This patch makes
this happen. Please review.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-16 17:04:58 -07:00
David S. Miller c127bdf9f6 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-09-16 17:01:24 -07:00
Johannes Berg bbac31f4c0 cfg80211: fix SME connect
There's a check saying
	/* we're good if we have both BSSID and channel */
	if (wdev->conn->params.bssid && wdev->conn->params.channel) {

but that isn't true -- we need the BSS struct. This leads
to errors such as

    Trying to associate with 00:1b:53:11:dc:40 (SSID='TEST' freq=2412 MHz)
    ioctl[SIOCSIWFREQ]: No such file or directory
    ioctl[SIOCSIWESSID]: No such file or directory
    Association request to the driver failed
    Associated with 00:1b:53:11:dc:40

in wpa_supplicant, as reported by Holger.

Instead, we really need to have the BSS struct, and if we
don't, then we need to initiate a scan for it. But we may
already have the BSS struct here, so hang on to it if we
do and scan if we don't.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-16 16:21:00 -04:00
Pavel Roskin 8c6c03fe23 rc80211_minstrel: fix contention window calculation
The contention window is supposed to be a power of two minus one, i.e.
15, 31, 63, 127...  minstrel_rate_init() forgets to subtract 1, so the
sequence becomes 15, 32, 66, 134...

Bug reported by Dan Halperin <dhalperi@cs.washington.edu>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-16 16:21:00 -04:00
Randy Dunlap de32cce132 ssb/sdio: fix printk format warnings
Fix printk format warnings:

drivers/ssb/sdio.c:336: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'size_t'
drivers/ssb/sdio.c:443: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-16 16:21:00 -04:00
Christian Lamparter f7f71173ea p54usb: add Zcomax XG-705A usbid
This patch adds a new usbid for Zcomax XG-705A to the device table.

Cc: stable@kernel.org
Reported-by: Jari Jaakola <jari.jaakola@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-16 16:20:59 -04:00
Huang Weiyi d4e54e871f ASoC: remove unused #include <linux/version.h>
Remove unused #include <linux/version.h>('s) in
  sound/soc/codecs/ad1836.c
  sound/soc/codecs/ad1938.c
  sound/soc/codecs/wm8974.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-16 21:08:54 +01:00
Anirban Sinha f4c3f03838 Fix ia64 build breakage in head.S
The "cleanup console_print()" patch in commit
353f6dd2de introduced an "extern"
declaration into an assembly language file.  Remove it.

Signed-off-by: Anirban Sinha <asinha@zeugmasystems.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-16 12:28:52 -07:00
Ingo Molnar 40d9d82c8a Merge branch 'tip/tracing/core4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/core 2009-09-16 21:16:37 +02:00
Linus Torvalds ab86e5765d Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  Driver Core: devtmpfs - kernel-maintained tmpfs-based /dev
  debugfs: Modify default debugfs directory for debugging pktcdvd.
  debugfs: Modified default dir of debugfs for debugging UHCI.
  debugfs: Change debugfs directory of IWMC3200
  debugfs: Change debuhgfs directory of trace-events-sample.h
  debugfs: Fix mount directory of debugfs by default in events.txt
  hpilo: add poll f_op
  hpilo: add interrupt handler
  hpilo: staging for interrupt handling
  driver core: platform_device_add_data(): use kmemdup()
  Driver core: Add support for compatibility classes
  uio: add generic driver for PCI 2.3 devices
  driver-core: move dma-coherent.c from kernel to driver/base
  mem_class: fix bug
  mem_class: use minor as index instead of searching the array
  driver model: constify attribute groups
  UIO: remove 'default n' from Kconfig
  Driver core: Add accessor for device platform data
  Driver core: move dev_get/set_drvdata to drivers/base/dd.c
  Driver core: add new device to bus's list before probing
2009-09-16 08:27:10 -07:00
Linus Torvalds 7ea61767e4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (641 commits)
  Staging: remove sxg driver
  Staging: remove heci driver
  Staging: remove at76_usb wireless driver.
  Staging: rspiusb: remove the driver
  Staging: meilhaus: remove the drivers
  Staging: remove me4000 driver.
  Staging: line6: ffzb returns an unsigned integer
  Staging: line6: pod.c: style cleanups
  Staging: iio: introduce missing kfree
  Staging: dream: introduce missing kfree
  Staging: comedi: addi-data: NULL dereference of amcc in v_pci_card_list_init()
  Staging: vt665x: fix built-in compiling
  Staging: rt3090: enable NATIVE_WPA_SUPPLICANT_SUPPORT option
  Staging: rt3090: port changes in WPA_MIX_PAIR_CIPHER to rt3090
  Staging: rt3090: rename device from raX to wlanX
  Staging: rt3090: remove possible conflict with rt2860
  Staging: rt2860/rt2870/rt3070/rt3090: fix compiler warning on x86_64
  Staging: rt2860: add new device ids
  Staging: rt3090: add device id 1462:891a
  Staging: asus_oled: Cleaned up checkpatch issues.
  ...
2009-09-16 08:11:54 -07:00
Linus Torvalds 0950efd1a1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pcmcia-2.6:
  pcmcia: document return value of pcmcia_loop_config
  pcmcia: dtl1_cs: fix pcmcia_loop_config logic
  pcmcia: drop non-existant includes
  pcmcia: disable prefetch/burst for OZ6933
  pcmcia: fix incorrect argument order to list_add_tail()
  pcmcia: drivers/pcmcia/pcmcia_resource.c: Remove unnecessary semicolons
  pcmcia: Use phys_addr_t for physical addresses
  pcmcia: drivers/pcmcia: Make static
2009-09-16 08:11:23 -07:00
Linus Torvalds 4406c56d0a Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (75 commits)
  PCI hotplug: clean up acpi_run_hpp()
  PCI hotplug: acpiphp: use generic pci_configure_slot()
  PCI hotplug: shpchp: use generic pci_configure_slot()
  PCI hotplug: pciehp: use generic pci_configure_slot()
  PCI hotplug: add pci_configure_slot()
  PCI hotplug: clean up acpi_get_hp_params_from_firmware() interface
  PCI hotplug: acpiphp: don't cache hotplug_params in acpiphp_bridge
  PCI hotplug: acpiphp: remove superfluous _HPP/_HPX evaluation
  PCI: Clear saved_state after the state has been restored
  PCI PM: Return error codes from pci_pm_resume()
  PCI: use dev_printk in quirk messages
  PCI / PCIe portdrv: Fix pcie_portdrv_slot_reset()
  PCI Hotplug: convert acpi_pci_detect_ejectable() to take an acpi_handle
  PCI Hotplug: acpiphp: find bridges the easy way
  PCI: pcie portdrv: remove unused variable
  PCI / ACPI PM: Propagate wake-up enable for devices w/o ACPI support
  ACPI PM: Replace wakeup.prepared with reference counter
  PCI PM: Introduce device flag wakeup_prepared
  PCI / ACPI PM: Rework some debug messages
  PCI PM: Simplify PCI wake-up code
  ...

Fixed up conflict in arch/powerpc/kernel/pci_64.c due to OF device tree
scanning having been moved and merged for the 32- and 64-bit cases.  The
'needs_freset' initialization added in 6e19314cc ("PCI/powerpc: support
PCIe fundamental reset") is now in arch/powerpc/kernel/pci_of_scan.c.
2009-09-16 07:49:54 -07:00
Linus Torvalds 6b7b352f21 Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: fix linkage problem with blk_iopoll and !CONFIG_BLOCK
2009-09-16 07:46:34 -07:00
Linus Torvalds a3eb51ecfa Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block
* 'writeback' of git://git.kernel.dk/linux-2.6-block:
  writeback: fix possible bdi writeback refcounting problem
  writeback: Fix bdi use after free in wb_work_complete()
  writeback: improve scalability of bdi writeback work queues
  writeback: remove smp_mb(), it's not needed with list_add_tail_rcu()
  writeback: use schedule_timeout_interruptible()
  writeback: add comments to bdi_work structure
  writeback: splice dirty inode entries to default bdi on bdi_destroy()
  writeback: separate starting of sync vs opportunistic writeback
  writeback: inline allocation failure handling in bdi_alloc_queue_work()
  writeback: use RCU to protect bdi_list
  writeback: only use bdi_writeback_all() for WB_SYNC_NONE writeout
  fs: Assign bdi in super_block
  writeback: make wb_writeback() take an argument structure
  writeback: merely wakeup flusher thread if work allocation fails for WB_SYNC_NONE
  writeback: get rid of wbc->for_writepages
  fs: remove bdev->bd_inode_backing_dev_info
2009-09-16 07:45:38 -07:00
Peter Zijlstra 182a85f8a1 sched: Disable wakeup balancing
Sysbench thinks SD_BALANCE_WAKE is too agressive and kbuild doesn't
really mind too much, SD_BALANCE_NEWIDLE picks up most of the
slack.

On a dual socket, quad core, dual thread nehalem system:

sysbench (--num_threads=16):

 SD_BALANCE_WAKE-: 13982 tx/s
 SD_BALANCE_WAKE+: 15688 tx/s

kbuild (-j16):

 SD_BALANCE_WAKE-: 47.648295846  seconds time elapsed   ( +-   0.312% )
 SD_BALANCE_WAKE+: 47.608607360  seconds time elapsed   ( +-   0.026% )

(same within noise)

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-16 16:44:33 +02:00
Peter Zijlstra 5a9b86f647 sched: Rename flags to wake_flags
For consistencies sake, rename the argument (again).

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-16 16:44:33 +02:00
Peter Zijlstra 5158f4e442 sched: Clean up the load_idx selection in select_task_rq_fair
Clean up the code a little.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-16 16:44:32 +02:00
Peter Zijlstra 3b64089422 sched: Optimize cgroup vs wakeup a bit
We don't need to call update_shares() for each domain we iterate,
just got the largets one.

However, we should call it before wake_affine() as well, so that
that can use up-to-date values too.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-16 16:44:32 +02:00
Nick Piggin 1ef7d9aa32 writeback: fix possible bdi writeback refcounting problem
wb_clear_pending AFAIKS should not be called after the item has been
put on the list, except by the worker threads. It could lead to the
situation where the refcount is decremented below 0 and cause lots of
problems.

Presumably the !wb_has_dirty_io case is not a common one, so it can
be discovered when the thread wakes up to check?

Also add a comment in bdi_work_clear.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-09-16 15:18:53 +02:00
Nick Piggin 77b9d059cb writeback: Fix bdi use after free in wb_work_complete()
By the time bdi_work_on_stack gets evaluated again in bdi_work_free, it
can already have been deallocated and used for something else in the
!on stack case, giving a false positive in this test and causing
corruption.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-09-16 15:18:52 +02:00