Andrew Morton [Sat, 15 May 2004 03:13:39 +0000 (20:13 -0700)]
[PATCH] autofs4: dnotify + autofs may create signal/restart syscall loop
From: Ian Kent <raven@themaw.net>
From: Jeff Mahoney <jeffm@suse.com>
I saw a recent bug report that showed when a process set up a dnotify
against the autofs root and then attempted an access(2) call inside the
autofs namespace on a mount that would fail, it would create a
signal/restart loop.
The cause is that the autofs code checks to see if any signals are pending
after it waits on a response from the autofs daemon. If it finds any, it
assumes that autofs_wait was interrupted, and that it should return
-ERESTARTNOINTR. The problem with this is that a signal_pending(current)
check will return true if *any* signals were received, not just if a signal
that interrupted the wait was received. autofs_wait explicitly blocks all
signals except for SIGKILL, SIGQUIT, and SIGINT before calling
interruptible_sleep_on.
The effect is that if a dnotify is set against the autofs root, when the
autofs daemon creates the directory, a dnotify event will be sent to the
originating process. Since the code in autofs_root_lookup doesn't check to
see what signals are actually pending, it bails early, telling the caller
to try again. The loop goes on forever until interrupted via one of the
actual interrupting signals.
The following patch makes both autofs_root_lookup and autofs4_root_lookup
verify that one of its defined "shutdown" signals are pending before
bailing out early. Any other signal should be delivered later, as
expected. It doesn't matter if the signal occured outside of the sleep in
autofs_wait. The calling process will either go away or try again.
Andrew Morton [Sat, 15 May 2004 03:13:17 +0000 (20:13 -0700)]
[PATCH] sched: reduce node balancing interval
From: Nick Piggin <nickpiggin@yahoo.com.au>
From: Suresh Siddha <suresh.b.siddha@intel.com>
Node max rebalance interval is too large. It is currently dependent on
number of online cpus. For 16 cpu system, max node balance interval in
busy case is 32 seconds. Agreed that it will use max 32 seconds only when
it doesn't find imbalance for a long time. But this will lead to slow
response time in cases where load runs for a second with no imbalance and
suddently creates an imbalance. My patch makes the busy max node rebalance
interval equal to the base [scheduler].
Andrew Morton [Sat, 15 May 2004 03:13:06 +0000 (20:13 -0700)]
[PATCH] sched: less locking in balancing
From: Nick Piggin <nickpiggin@yahoo.com.au>
Analysis and basic idea from Suresh Siddha <suresh.b.siddha@intel.com>
"This small change in load_balance() brings the performance back upto base
scheduler(infact I see a ~1.5% performance improvement now). Basically
this fix removes the unnecessary double_lock.."
Andrew Morton [Sat, 15 May 2004 03:12:56 +0000 (20:12 -0700)]
[PATCH] sched: fix scheduler for unsynched processor sched_clock
From: Nick Piggin <nickpiggin@yahoo.com.au>
Fine-tune the unsynched sched_clock handling.
Basically, you need to be careful about ensuring timestamps get correctly
adjusted when moving CPUs, and you *can't* look at your unadjusted
sched_clock() and a remote task's ->timestamp and try to come up with
anything meaningful.
I think this second problem will really hit hard in the activate_task path
on systems with unsynched sched_clock when you're waking up a remote task,
which happens very often. Andi, I thought some Opterons have unsynched
tscs? Maybe this is causing your unexplained bad interactivity?
Another problem is a fixup in pull_task. When adjusting ->timestamp from
one processor to another, you must use timestamp_last_tick for the local
processor too. Using sched_clock() will cause ->timestamp to creep
forward.
A final small fix is for sync wakeups. They were using __activate_task for
some reason, thus they don't get credited for sleeping at all AFAIKS.
And another thing, do we want to #ifdef timestamp_last_tick so it doesn't
show on UP?
Andrew Morton [Sat, 15 May 2004 03:12:44 +0000 (20:12 -0700)]
[PATCH] sched: improved cpu_load rounding
From: Nick Piggin <nickpiggin@yahoo.com.au>
"Siddha, Suresh B" <suresh.b.siddha@intel.com> noticed a problem in the
cpu_load averaging where the integer truncation could sometimes cause cpu_load
to never quite reach its target.
I'm not sure that you could demonstrate a real world problem, but I quite
like this fix.
Andrew Morton [Sat, 15 May 2004 03:12:33 +0000 (20:12 -0700)]
[PATCH] Fix writeback_inodes-vs-umount race
Fix bug identified by Chris Mason.
If writeback_inodes is left holding a ref on the superblock's last inode then
the superblock list walk can race with umount and the superblock can be
released.
Take and put a ref against the superblock to fix that.
Andrew Morton [Sat, 15 May 2004 03:12:23 +0000 (20:12 -0700)]
[PATCH] x86: stack dumps using frame pointers
From: Adam Litke <agl@us.ibm.com>
Teach the x86 stack tracing code to use frame pointers, if they are available.
It eliminates all the false-positives in the normal stack traces.
This is a big improvement, and -fomit-frame-pointer seems to make no
difference at all to generated code size. Maybe we should kill off
-fomit-frame-pointer.
Shai Fultheim [Sat, 15 May 2004 02:42:40 +0000 (19:42 -0700)]
[PATCH] Multiple (ICH3) IDE-controllers in a system
This fixes a problem with multiple IDE controllers in a system.
The problem is that pcibios_fixups table (in arch/i386/pci/fixup.c) uses
the pci_fixup_ide_trash() quirk for Intel's ICH3 (my case specifically
8086:248b). This clears any bogus BAR information set up by the BIOS.
In a system which has multiple ICH3's can't use any of the IDE
controllers beside the one on the first ICH3.
Anyhow, the fix is to make sure pci_fixup_ide_trash resets the BARs only
for first time being called, so the subsequent IDE controllers will use
the BIOS BARs. This is better than "loosing" all these IDE controllers
in the case their BARs set right.
The issue discussed and agreed with Bartlomiej Zolnierkiewicz (see below).
Santiago Leon [Fri, 14 May 2004 13:47:05 +0000 (06:47 -0700)]
[PATCH] PowerPC Virtual Ethernet duplicate MAC addresses
This fixes a bug where different partitions were assigned the same MAC
address. Also, according to Anton, gcc 3.5 didn't like our mac_addr_p
gymnastics, so this ends up fixing that as well.
Andrew Morton [Fri, 14 May 2004 12:56:29 +0000 (05:56 -0700)]
[PATCH] ppc64 iSeries: allow read only virtual disks
From: Stephen Rothwell <sfr@canb.auug.org.au>
It is possible to attach a virtual disk to a logical partition on an iSeries
machine so that it is read only to the partition. This patch allows Linux to
use such virtual disks.
Andrew Morton [Fri, 14 May 2004 12:56:19 +0000 (05:56 -0700)]
[PATCH] ppc64: strengthen I/O and memory barriers
From: Paul Mackerras <paulus@samba.org>
After I sent the recent patch to include/asm-ppc64/io.h which put stronger
barriers in the I/O accessor macros, Paul McKenney pointed out to me that a
writex/outx could still slide out from inside a spinlocked region. This patch
makes the barriers a bit stronger so that this can't happen. It means that we
need to use a sync instruction for wmb (a full "heavyweight" sync), since
drivers rely on wmb for ordering between writes to system memory and writes to
a device.
I have left smb_wmb() as a lighter-weight barrier that orders stores, and
doesn't impose an ordering between cacheable and non-cacheable accesses (the
amusingly-named eieio instruction). I am assuming here that smp_wmb is only
used for ordering stores to system memory so that another cpu will see them in
order. It can't be used for enforcing any ordering that a device will see,
because it is just a gcc barrier on UP.
This also changes the spinlock/rwlock unlock code to use lwsync ("light-weight
sync") rather than eieio, since eieio doesn't order loads, and we need to
ensure that loads stay inside the spinlocked region.
Andrew Morton [Fri, 14 May 2004 12:56:08 +0000 (05:56 -0700)]
[PATCH] ppc64: Kconfig bits for CONFIG_SPINLINE
From: Paul Mackerras <paulus@samba.org>
When I sent the patch to uninline the spinlocks, I inadvertently left out
the change to arch/ppc64/Kconfig which defines the config symbol for
inlining the locks (CONFIG_SPINLINE now). This patch adds it. It also
adds a symbol CONFIG_PPC_SPLPAR which enables the code for calling the
hypervisor on shared-processor logically-partitioned system to yield the
physical processor to the lock holder when spinning. (The code that
depends on this symbol is already present in arch/ppc64/lib/locks.c.)
Andrew Morton [Fri, 14 May 2004 12:55:37 +0000 (05:55 -0700)]
[PATCH] ppc64: align some heavily used variables
From: Anton Blanchard <anton@samba.org>
Based on feedback from the hardware guys align jiffies and tb_last_stamp.
We update both regularly and there are other read only, heavily accessed
things that share those cachelines.
Andrew Morton [Fri, 14 May 2004 12:55:05 +0000 (05:55 -0700)]
[PATCH] ppc32: Move declarations into headers
From: Paul Mackerras <paulus@samba.org>
The patch below moves some declarations from C files into the appropriate
header file in include/asm-ppc (and removes an unused local variable in a
function).
Andrew Morton [Fri, 14 May 2004 12:54:54 +0000 (05:54 -0700)]
[PATCH] ppc32: Fix pmac compile after OCP changes
From: Paul Mackerras <paulus@samba.org>
Matt Porter's recent changes broke the compile for non-4xx ppc32 systems,
unfortunately. I get an error that mfdcr is not defined in
include/asm-ppc/ocp.h when compiling for powermac (reasonable, since the
mfdcr instruction only exists on 4xx processors). The patch below fixes
it.
Andrew Morton [Fri, 14 May 2004 12:52:21 +0000 (05:52 -0700)]
[PATCH] PPC32: Fix copy prefetch on non coherent PPCs
From: Matt Porter <mporter@kernel.crashing.org>
This patch fixes the condition where prefetching cache lines beyond a
buffer can cause data corruption on non cache coherent PPCs. It is a port
of the version that went into 2.4. From Eugene Surovegin
<ebs@ebshome.net>.
Andrew Morton [Fri, 14 May 2004 12:52:10 +0000 (05:52 -0700)]
[PATCH] PPC32: Fix __flush_dcache_icache_phys() for Book E
From: Matt Porter <mporter@kernel.crashing.org>
This patch implements/uses __flush_dcache_icache_page() which kmaps on a
Book E part, but keeps the existing behavior on other PowerPCs which can
disable the MMU.
Andrew Morton [Fri, 14 May 2004 12:51:48 +0000 (05:51 -0700)]
[PATCH] befs: inode->i_flags thinko fix
Jorn Engel <joern@wohnheim.fh-wedel.de>
inode->i_flags should never contain fs-specific flags. In fact, it doesn't;
the checks against it cause "chattr +T" to be useless for ext[23]. Same bug
was in befs as well.
Andrew Morton [Fri, 14 May 2004 12:50:55 +0000 (05:50 -0700)]
[PATCH] befs: microoptimisation, use befs_bread() instead of befs_bread_iaddr()
From: "Sergey S. Kostyliov" <rathamahata@php4.ru>
We already have block number (inode->i_ino), so there is no need to calculate
it from befs_block_run before sb_bread() call (this is what befs_bread_iaddr()
do).
Andrew Morton [Fri, 14 May 2004 12:50:33 +0000 (05:50 -0700)]
[PATCH] s390: network driver
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Network driver changes:
- lcs: Add missing irb error checking.
- lcs: Fix multicasting.
- lcs: Use a seperate lock (ipm_lock) for multicast list.
- lcs: Add missing in_dev_put in multicase address list handling.
- iucv: Set static variables to NULL after kfree.
- iucv: Do bus_unregister if module initialization fails.
- netiucv: Convert iucvMagic to EBCDIC in con_action_start.
- netiucv: Remove administration of ifno-stuff for device name,
- netiucv: Add attribute to remove a netiucv device.
- qeth: Add version string that is displayed at driver load time.
- qeth: Fix memory leak in qeth_arp_query.
- qeth: Remove duplicate case statements in qeth_do_ioctl.
- qeth: Fix OSA broadcast filtering.
- qeth: Increase timeout for purge ARP cache IPA.
- qeth: Fix hsi device naming.
- qeth: Add do_QDIO count to qeth performance statistics.
- qeth: Allow writing to IP address takeover attribute only in
state DOWN or RECOVER.
- qeth: Fix hang when removing a vlan device.
- qeth: Cleanup error messages for ARP commands.
- qeth: Return EOPNOTSUPP for purge ARP on HiperSockets.
- qeth: Drop skbs if the net_device of a qeth device is down.
- qeth: Simplify ip address list processing.
Andrew Morton [Fri, 14 May 2004 12:50:22 +0000 (05:50 -0700)]
[PATCH] s390: zfcp host adapter
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
zfcp host adapter change:
- Prevent infinite retry of SCSI commands when FCP adapter is unavailable.
- Always queue error recovery structure to the error recovery running list.
- Add help text to zfcp config option.
Andrew Morton [Fri, 14 May 2004 12:50:11 +0000 (05:50 -0700)]
[PATCH] s390: 3270 console driver
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3270 device driver change:
- Don't allow activation of views while the initial size sensing is still
in progress. Replace RAW3270_FLAGS_SHUTDOWN with RAW3270_FLAGS_READY.
- Make 3270 views loadable as modules.
Andrew Morton [Fri, 14 May 2004 12:49:49 +0000 (05:49 -0700)]
[PATCH] s390: common i/o layer
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Common i/o layer changes:
- Delay unregister/register of ccw devices reappering on a different
subchannel. Search for the old ccw_device & subchannel for the
reattached device and deregister it too to avoid inconsistencies.
- Fix path grouping for devices that present command reject for
SetPGID but not for SensePGID.
Andrew Morton [Fri, 14 May 2004 12:49:38 +0000 (05:49 -0700)]
[PATCH] s390: core
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390 core changes:
- Rename idle_cpu_mask to nohz_cpu_mask as agreed with Dipankar.
- Refine compiler version check for "Q" constraints in uaccess.h.
- Store per process ptrace information to the correct place.
- Fix per cpu data access for 64-bit modules.
- Add topology_init function for cpu hotplug.
- Define TASK_SIZE dependent on TIF_31BIT and define MM_VM_SIZE
to 4TB to get rid of elf_map32 and arch_get_unmapped_area.
Andrew Morton [Fri, 14 May 2004 12:46:55 +0000 (05:46 -0700)]
[PATCH] dentry qstr consolidation
When dentries are given an external name we currently allocate an entire qstr
for the external name.
This isn't needed. We can use the internal qstr and kmalloc only the string
itself. This saves 12 bytes from externally-allocated names and 4 bytes from
the dentry itself.
The saving of 4 bytes from the dentry doesn't actually decrease the dentry's
storage requirements, but it makes four more bytes available for internal
names, taking the internal/external ratio from 89% up to 93% on my 1.5M files.
Fix:
The qstr consolidation wasn't quite right, because it can cause qstr->len to
be unstable during lookup lockless traverasl.
Fix that up by taking d_lock earlier in lookup. This serialises against
d_move.
Take the lock after comparing the parent and hash to preserve the
mostly-lockless behaviour.
Andrew Morton [Fri, 14 May 2004 12:46:12 +0000 (05:46 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o-makefile-cleanup.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* The Kconfig and Makefile in drivers/message/i2o still got a CONFIG_I2O_PCI
entry, which is not used anymore. This one is replaced by a
CONFIG_I2O_CONFIG entry, which now builds the i2o_config module.
Andrew Morton [Fri, 14 May 2004 12:46:01 +0000 (05:46 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o-64-bit-fix.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* provides i2o_context_list_*() functions, which maps 64-bit pointers to
32-bit context id's in a dynamic list. On 32-bit systems the functions are
replaced with a static inline.
* i2o_scsi now uses the i2o_context_list_*() functions for transaction
context, and therefore now work on 64-bit systems too.
Andrew Morton [Fri, 14 May 2004 12:45:50 +0000 (05:45 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o_block-cleanup.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* more than 3 "visible" disks (hda, hdb, hdc, hdd) lead to kernel panics.
* removes some unused code with partitions.
* I2O_LOCK was often called with the addresses of the controller, and not
with the address of the device. Fixed.
* the cleanup function for gendisk (del_gendisk) doesn't work if the queue
is shared between different devices. To workaround the queue is removed
before.
* redundant code removed in module initialization and remove, use
i2ob_new_device and i2ob_del_device instead.
* removed atomic_t queue_depth
* removed unnecessary and bogus code for queue handling
Andrew Morton [Fri, 14 May 2004 12:44:57 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: core
From: Ashok Raj <ashok.raj@intel.com>
Supports basic ability to enable hotplug functions for IA64.
Code is just evolving, and there are several loose ends to tie up.
What this code drop does
- Support logical online and offline
- Handles interrupt migration without loss of interrupts.
- Handles stress fine > 24+ hrs with make -j/ftp/rcp workloads
- Handles irq migration from a dying cpu without loss of interrupts.
What needs to be done
- Boot CPU removal support, with platform level authentication
- Putting cpu being removed in BOOT_RENDEZ mode.
With a hotplug capable kernel, there is a requirement to distinguish a
possible CPU from one actually present. The set of possible CPU numbers
doesn't change during a single system boot, but the set of present CPUs
changes as CPUs are physically inserted into or removed from a system. The
cpu_possible_map does not change once initialized at boot, but the
cpu_present_map changes dynamically as CPUs are inserted or removed.
Paul Jackson <pj@sgi.com> provided an expanded explanation:
Ashok's cpu hot plug patch adds a cpu_present_map, resulting in the following
cpu maps being available. All the following maps are fixed size bitmaps of
size NR_CPUS.
#ifdef CONFIG_HOTPLUG_CPU
cpu_possible_map - map with all NR_CPUS bits set
cpu_present_map - map with bit 'cpu' set iff cpu is populated
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler
#else
cpu_possible_map - map with bit 'cpu' set iff cpu is populated
cpu_present_map - copy of cpu_possible_map
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler
#endif
In either case, NR_CPUS is fixed at compile time, as the static size of these
bitmaps. The cpu_possible_map is fixed at boot time, as the set of CPU id's
that it is possible might ever be plugged in at anytime during the life of
that system boot. The cpu_present_map is dynamic(*), representing which CPUs
are currently plugged in. And cpu_online_map is the dynamic subset of
cpu_present_map, indicating those CPUs available for scheduling.
If HOTPLUG is enabled, then cpu_possible_map is forced to have all NR_CPUS
bits set, otherwise it is just the set of CPUs that ACPI reports present at
boot.
If HOTPLUG is enabled, then cpu_present_map varies dynamically, depending on
what ACPI reports as currently plugged in, otherwise cpu_present_map is just a
copy of cpu_possible_map.
(*) Well, cpu_present_map is dynamic in the hotplug case. If not hotplug,
it's the same as cpu_possible_map, hence fixed at boot.
Andrew Morton [Fri, 14 May 2004 12:44:34 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: /proc rework
From: Ashok Raj <ashok.raj@intel.com>
Changes proc entries for cpu hotplug to be created via the cpu hotplug
notifier callbacks. Also fixed a bug in the removal code that did not remove
proc entries as expected.
Andrew Morton [Fri, 14 May 2004 12:44:23 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: IRQ affinity work
From: Ashok Raj <ashok.raj@intel.com>
irq affinity setting via /proc was forcing iosapic rte programming by force.
The correct way to do this is to perform this when a interrupt is pending.
Andrew Morton [Fri, 14 May 2004 12:44:13 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: sysfs additions
From: Ashok Raj <ashok.raj@intel.com>
Creation of sysfs via topology_init() creates sysfs entries. The creation of
the online control file is created separately when the cpu_up is invoked in
arch independent code.
Andrew Morton [Fri, 14 May 2004 12:43:39 +0000 (05:43 -0700)]
[PATCH] swap speedups and fix
From: Andrea Arcangeli <andrea@suse.de>
I don't think we need an install_swap_bdev/remove_swap_bdev anymore, we should
use the swap_info->bdev, not the swap_bdevs. the swap_info already has a
->bdev field, the only point of remove_swap_bdev/install_swap_bdev was to
unplug all devices as efficiently as possible, we don't need that anymore with
the page parameter.
Plus the semaphore should be a rwsem to allow parallel unplug from multiple
pages.
After that I don't need to take the semaphore anymore during swapon, no
swapcache with swp_type() pointing to such bdev, will be allowed until swapon
is complete (SWP_ACTIVE is set a lot later after setting p->bdev).
In swapoff I only need a dummy serialization with the readers, after
try_to_unuse is complete:
Andrew Morton [Fri, 14 May 2004 12:43:07 +0000 (05:43 -0700)]
[PATCH] Add blk_run_page()
From: Andrea Arcangeli <andrea@suse.de>
From: Jens Axboe
Add blk_run_page() API. This is so that we can pass the target page all the
way down to (for example) the swap unplug function. So swap can work out
which blockdevs back this particular page.
Andrew Morton [Fri, 14 May 2004 12:42:56 +0000 (05:42 -0700)]
[PATCH] rmap-5-swap_unplug-page-revert
Revert the pre-2.6.6 per-address-space unplugging changes. This removes a
swapper_space exceptionality, syncs things with Andrea and provides for
simplification of the swap unplug function.
Andrew Morton [Fri, 14 May 2004 12:42:34 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: apply to buffer_head functions
From: William Lee Irwin III <wli@holomorphy.com>
This patch implements wake-one semantics for buffer_head wakeups in a single
step. The buffer_head being waited on is passed to the waiter's wakeup
function by the waker, and the wakeup function compares that to the a pointer
stored in its on-stack structure and checking the readiness of the bit there
also. Wake-one semantics are achieved by using WQ_FLAG_EXCLUSIVE in the
codepaths waiting to acquire the bit for mutual exclusion.