Martin J. Bligh [Sat, 8 Mar 2003 14:39:04 +0000 (06:39 -0800)]
[PATCH] NUMA scheduler fixup
From: Ingo Molnar <mingo@elte.hu>
This cleans up the NUMA scheduler to have separate triggers for idle
and busy rebalance ratio, preventing some complex interactions where
idle cpus can cause busy ones to busy rebalance more often. The core
functionality of this patch is rebalace_tick().
Tested in -mjb tree for over 1 month ... no problems at all found -
retested on top of 64-bk3 with new scheduler updates.
Andrew Morton [Sat, 8 Mar 2003 14:05:45 +0000 (06:05 -0800)]
[PATCH] remove compile warning from serial console initcall
Patch from: "Martin J. Bligh" <mbligh@aracnet.com>
This tiny patch removes the new compiler warning from my build - the new
console_initcall mechanism seems to require int from console_init ... I made
serial8250_console_init look like con_init
Andrew Morton [Sat, 8 Mar 2003 14:05:36 +0000 (06:05 -0800)]
[PATCH] rpc_delete_timer race fix
Patch from Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de>
Fix a race wherein timer_pending() returns false, but the timer handler is
actually running on another CPU. We need to call del_timer_sync()
regardless, so we wait for completion of the handler.
Andrew Morton [Sat, 8 Mar 2003 11:28:57 +0000 (03:28 -0800)]
[PATCH] raw.c: dev_t cleanup and oops fix
Patch from Andries.Brouwer@cwi.nl
The next patch in the dev_t series eliminates the last applied use
of MAX_BLKDEV - only the definition in major.h remains.
Sneaky as I am, I combine this patch with the fix for an Oops:
On open, raw_open does
filp->f_dentry->d_inode->i_mapping =
bdev->bd_inode->i_mapping;
storing a pointer to bdev stuff.
But on release this pointer stayed, the block device is not
referenced anymore and disappears, and the next open references
undefined stuff.
I checked, and this can actually cause an Oops - scenario:
More precisely the problem is that dentry_open does
file_ra_state_init(&f->f_ra, inode->i_mapping);
And file_ra_state_init uses mapping->backing_dev_info->ra_pages.
Ugly, to use so much information about the inode even before
the inode has been opened.
In the patch below I reset i_mapping upon release of the raw device.
akpm: I fixed a typo and exported default_backing_dev_info to GPL modules for
this.
Andrew Morton [Sat, 8 Mar 2003 11:28:30 +0000 (03:28 -0800)]
[PATCH] fix SMP lockup in eepro100 with ethtool on unused
Patch from Jason Lunz <lunz@falooley.org>
When support for the GSET and SSET ethtool ioctls was added to eepro100.c in
2.4.20, the tx lock was overloaded to serialize their use. Unfortunately,
this lock is only initialized in dev->open(), causing ethtool to deadlock the
machine when used on an unconfigured eepro100 interface.
The fix is to initialize the spinlock at probe time.
Andrew Morton [Sat, 8 Mar 2003 11:27:42 +0000 (03:27 -0800)]
[PATCH] Extended attribute sharing and debug macro typo fixes
Patch from Andreas Gruenbacher <agruen@suse.de>
Tony Dziedzic has found two bugs in the extended attributes code. Patches with
explanations are attached.
1: Extended attribute sharing on ext2/ext3 not working
The mb_cache_entry_insert function constantly returns an -EBUSY error
instead of 0, which causes the xattr cache that is needed by the xattr
sharing mechanism on ext2/ext3 to not share anything. This patch fixes
the problem. (It is possible that after applying this fix we will hit
bugs in code that wasn't used before.)
2: Oops in one of the xattr debug statements: The old_bh variable is NULL
if an inode that previously had no EA's assigned would share an EA block
with another inode. (This was hidden by the xattr sharing bug).
Andrew Morton [Sat, 8 Mar 2003 11:27:24 +0000 (03:27 -0800)]
[PATCH] fix memory leak in load_elf_binary()
- Fix an error-path leak of memory and a dentry in load_elf_binary()
(spotted by Oleg Drokin).
- Tidy up the handling of bad executable images: return -ENOEXEC rather
than 0. (We've committed suicide anyway, so probably nobody gets to see
this).
- Fix up the logic in load_aout_interp(). It gets itself all set up to
return -ENOEXEC but there is in fact no path by which it can do this. Just
return ~0UL on errors, like load_elf_interp().
Andrew Morton [Sat, 8 Mar 2003 11:26:43 +0000 (03:26 -0800)]
[PATCH] hugetlb unmap_vmas() SMP && PREEMPT fix
Patch from Kevin Pedretti <pedretti@ieee.org>
The unmap_vmas() logic is designed to chew away at all the pages without
holding off preemption for too long. But with CONFIG_SMP=y and
CONFIG_PREEMPT=y the number of pages which we batch up between rescheduling
opportunities is not a multiple of HPAGE_SIZE. So unmap_vmas() ends up
calling unmap_hugepage_range() with a poorly aligned&sized region, and it
goes BUG.
Fix that up by ensuring that we always work across hugepage regions in
HPAGE_SIZE chunks.
Andrew Morton [Sat, 8 Mar 2003 11:25:58 +0000 (03:25 -0800)]
[PATCH] fix div-by-zero in bonding.c
Patch from: Shmulik Hen <hshmulik@intel.com>
The following patch fixes a division by zero bug in the bonding module that
happens when transmitting through a bond with no slaves, in the XOR bonding
mode.
Andrew Morton [Sat, 8 Mar 2003 11:24:48 +0000 (03:24 -0800)]
[PATCH] Fix copy_page_range()'s handling of invalid pages
Patch from Xavier Bru <Xavier.Bru@bull.net>
If copy_page_range encounters a pte which maps an invalid pageframe it will
proceed to try to add an rmap entry against that page. This causes oopses
when an application which has mapped an IO device via /dev/mem forks.
Fix that up by correctly skipping the page_add_rmap() for these pte's.
Andrew Morton [Sat, 8 Mar 2003 11:23:55 +0000 (03:23 -0800)]
[PATCH] slab use-after-free detector
Patch from Petr Vandrovec <vandrove@vc.cvut.cz>
Modifies check_poison function to not only verify that last byte is
POISON_END, but also that all preceeding bytes are either POISON_BEFORE or
POISON_AFTER bytes.
Andrew Morton [Sat, 8 Mar 2003 11:23:39 +0000 (03:23 -0800)]
[PATCH] Fix vm_area_struct slab corruption
Patch from Hugh Dickins <hugh@veritas.com>
Hugh's patch fixes vm_area_struct slab corruption due to mremap's move_vma
mistaking how do_munmap splits vmas in one case.
Neither of us are very happy with it - it is fragile, and obscure. Hugh will
revisit this later, but for now it should fix up the potential memory
corruption.
Andrew Morton [Sat, 8 Mar 2003 11:23:08 +0000 (03:23 -0800)]
[PATCH] Allow VFS readahead to fall to zero
Some workloads really, really want to have no readahead. Databases which are
perfoming small synchronous I/Os against a file which has extremely poor
layout. Any readahead at all is a lose here.
But the current readahead code refuses to adapt that low.
Fix it up so that we can indeed adaptively disable readahead altogether, and
do not start it again until we have seen max_readahead()'s worth of
consecutive reads.
Andrew Morton [Sat, 8 Mar 2003 11:22:49 +0000 (03:22 -0800)]
[PATCH] fix possible latency in balance_dirty_pages()
Tasks which throttle in balance_dirty_pages() will loop until the amount of
dirty memory falls below the configured dirty_ratio.
This exposes the possibility that one task could be stuck in there for
arbitrary periods of time due to page dirtying activity by other tasks.
The patch changes the logic so that tasks will break out of the loop if they
have written enough pages, regardless of the current dirty memory limits.
Here "enough" pages is 1.5x the number of pages which they just dirtied.
If the amount of dirty memory in the machine happens to still exceed
dirty_ratio (say, due to MAP_SHARED activity) then the task will again
throttle after dirtying a single page. But there is now an upper limit on
the time for which a single task will be captured in balance_dirty_pages().
Andrew Morton [Sat, 8 Mar 2003 11:22:37 +0000 (03:22 -0800)]
[PATCH] register_blkdev cleanups
Patch from Andries.Brouwer@cwi.nl
The following patch does the following:
- static const char *blkdevs[MAX_BLKDEV]; disappears
- get_blkdev_list, (un)register_blkdev, __bdevname
are moved from block_dev.c to genhd.c
- the third "fops" parameter of register_blkdev was unused;
now removed everywhere
- zillions of places had printk("cannot get major") upon
error return from register_blkdev; removed all of these
and inserted a single printk in register_blkdev.
Of course the reason for the patch is that one fixed size
array is eliminated.
Martin J. Bligh [Sat, 8 Mar 2003 02:24:13 +0000 (18:24 -0800)]
[PATCH] 6/6 cacheline align files_lock
I'm getting a lot of cacheline bounce from .text.lock.file_table due to
false sharing of the cahceline. The following patch just aligns the lock
in it's own cacheline.
Martin J. Bligh [Sat, 8 Mar 2003 02:24:04 +0000 (18:24 -0800)]
[PATCH] 5/6 Provide basic documentation for profiling
People keep asking for this info, and Andrew asked me to put it under the
Documentation directory ... provides really simple instructions for taking
a profile so that users can report performance changes in a useful way.
Robert Love [Fri, 7 Mar 2003 23:42:49 +0000 (15:42 -0800)]
[PATCH] no need for kernel_flag on UP
This is a minor cleanup. We currently define and declare the BKL's
kernel_flag spinlock on either SMP or PREEMPT, which means a UP+PREEMPT
machine gets it.
Steve French [Fri, 7 Mar 2003 11:01:46 +0000 (05:01 -0600)]
Fix oops in getdfs when null path passed in on mount. Fix oops when changed readsize caused readpages problem. Add support for altering rsize so can reduce pages read across net
below default of 4
[PATCH] remove some braindamage from drivers/scsi/pcmcia/Kconfig
It contains one user-selectable option that does nothing but hiding the
four pcmcia drivers if not seleted (although we have an extra menu for
them!) one one that does exactly nothing. Remove those two.
Ingo Molnar [Fri, 7 Mar 2003 04:19:30 +0000 (20:19 -0800)]
[PATCH] "interactivity changes", sched-2.5.64-B2
This fixes the SMP runqueue locking bug when updating the wakers
priority. It also includes:
- only update the priority and do a requeueing if the sleep average has
changed. (this does not happen for pure CPU hogs or pure interactive
tasks, so no need to requeue/recalc-prio in that case.) [All the
necessary values are available at that point already, so gcc should
have an easy job making this branch really cheap.]
- do not do a full task activation in the migration-thread path - that is
supposed to be near-atomic anyway.
- fix up comments
I solved the SMP locking bug by moving the requeueing outside of
try_to_wake_up(). It does not matter that the priority update is not
atomically done now, since the current process wont do anything
inbetween. (well, it could get preempted in a preemptible kernel, but
even that wont do any harm.)
Matthew Wilcox [Fri, 7 Mar 2003 03:14:42 +0000 (21:14 -0600)]
[PATCH] Some parisc updates for SCSI
The config stanza for SCSI_ZALON was in the wrong place, so move it.
Make SCSI_NCR53C8XX conflict with SCSI_ZALON.
Give ncr53c8xx and sym53c8xx names
Fill in detach and release methods unconditionally.
Call pci_set_master() in sym53c8xx.
Both these drivers need interrupt.h, not sched.h
Ingo Molnar [Fri, 7 Mar 2003 02:41:00 +0000 (18:41 -0800)]
[PATCH] more "interactivity changes", sched-B2
- fix a (now-) bug in kernel/softirq.c, it did a wakeup outside any
atomic regions, which falsely identified random processes as a
non-atomic wakeup, and which causes random priority boost to be
distributed.
- reset the initial idle thread's priority back to PRIO_MAX after doing
the wakeup_forked_process() - correct preemption relies on this.
- update current->prio immediately after a backboost.
- clean up effective_prio() & sleep_avg calculations so that there are
fewer RT-task special cases. This has the advantage of the sleep_avg
being maintained even for RT tasks - this could be advantegous for
tasks that briefly enter/exit RT mode.
Zwane Mwaikambo [Thu, 6 Mar 2003 23:43:51 +0000 (15:43 -0800)]
[PATCH] noirqbalance still doesn't do anything
This one simply sets TARGET_CPUS to cpu_callout_map instead of
cpu_online_map so that when we finally do boot we actually use the other
cpus for servicing interrupts.
David Gibson [Thu, 6 Mar 2003 23:43:30 +0000 (15:43 -0800)]
[PATCH] Squash warning in ohci-pci.c on PowerBooks
Apple PowerBooks want <asm/prom.h> in ohci-pci.c for the prototype of
pci_device_to_OF_node(). This patch adds it to the already present
list of PowerBook specific #includes:
Just separate the setup_*() functions of hisax subdrivers
into calls to *_probe() functions, a step towards using
standard initialization and modularization of hisax.
Patrick Mochel [Thu, 6 Mar 2003 14:21:40 +0000 (08:21 -0600)]
sysfs: Fix binary file handling.
From Rusty Lynch:
* makes sysfs cleanup the buffer->data allocated by the attribute write
functions
* fixes a bug that causes the kernel to oops when somebody attempts to
write to the file.
Patrick Mochel [Thu, 6 Mar 2003 14:19:40 +0000 (08:19 -0600)]
sysfs: fix up directory removal, once and for all.
This patch was previously integrated, but dropped erroneously by a bk
merge.
This fixes file cleanup during a sysfs directory removal by deleting files
from ->d_subdirs as they're iterated over, then checking if we can get a
reference on them.
Linus Torvalds [Thu, 6 Mar 2003 13:29:33 +0000 (05:29 -0800)]
Fix a very theoretical race between the new RCU lookup and
concurrent renames in another directory.
I doubt this can be triggered in practice, and the fix is
a bit heavy-handed, but let's see if numbers can show that
the simple fix doesn't show any real lock contention.
Matthew Wilcox [Thu, 6 Mar 2003 12:52:50 +0000 (06:52 -0600)]
[PATCH] Remove naked GFP_DMA from drivers/scsi/sr.c
In get_sectorsize(), we can already sleep in scsi_wait_req().
In get_capabilities(), we can use GFP_KERNEL because it is only called
from sr_attach() which already does a GFP_KERNEL allocation.
H. Peter Anvin [Thu, 6 Mar 2003 09:57:26 +0000 (01:57 -0800)]
[PATCH] bootsect removal
This is the "boot sector removal" patch for i386 updated for Linux
2.5.63-bk7. The only change against the 2.5.59 version is that the
FDOPTS Makefile variable, which lets one create a floppy image with
arbitrary kernel options, has been merged from the x86-64 version, and
the comments have been updated.
The patch removes the in-kernel boot sector, which these days rarely
work correctly (it only supports up to 1 MB kernels, and only work on
legacy floppies -- not on IDE or USB devices, nor on any kind of
emulated devices like El Torito), replaces it with a placeholder stub,
and sets up the Makefile targets to create floppies or floppy images
using SYSLINUX. The FDOPTS Makefile variable can be used to set
kernel command line options (thanks to a suggestion by Andi Kleen.)
Note that the same change has already been applied to the x86-64
architecture. The last hunk of the patch corrects a comment in that
architecture.
Russell King [Thu, 6 Mar 2003 09:49:37 +0000 (01:49 -0800)]
[PATCH] Fix up pci_scan_bridge and friends
Now we tackle pci_add_new_bus and pci_scan_bridge. The hotplug code
currently uses this, but I'd like it to die off; pci_scan_bridge()
should be used to scan behind bridges. This may mean hotplug needs
some changes to pci_scan_bridge - if so, we need to find out what
changes are required and fix it.
pci_alloc_child_bus() does what pci_add_new_bus() did, except it
doesn't attach the new bus to the parents list of child buses. The
only way this bus can be reached from the parent bus is by scanning
the parents devices list, and locating a device with a non-NULL
subordinate bus. The only code which should be doing this is the
PCI code.
Since the new bus will have an empty list head for bus->node, we can
detect unattached buses prety easily. (see pci-3.diff.)
pci_scan_bridge() changes slightly - we use our new pci_scan_child_bus()
function from pci-3.diff, which doesn't attach devices to the global
tree. This means callers of pci_scan_child_bus() and pci_scan_bridge()
(ie, hotplug) will need to call pci_bus_add_devices().