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.
Andrew Morton [Fri, 14 May 2004 12:42:25 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: apply to pagecache functions
From: William Lee Irwin III <wli@holomorphy.com>
This patch implements wake-one semantics for page wakeups in a single step.
Discrimination between distinct pages is achieved by passing the page to the
wakeup function, which compares it to a pointer in its own on-stack structure
containing the waitqueue element and the page. Bit discrimination is achieved
by storing the bit number in that same structure and testing the bit in the
wakeup function. Wake-one semantics are achieved by using WQ_FLAG_EXCLUSIVE
in the codepaths waiting to acquire the bit for mutual exclusion.
Andrew Morton [Fri, 14 May 2004 12:42:14 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: wakeup enhancements
From: William Lee Irwin III <wli@holomorphy.com>
This patch provides an additional argument to __wake_up_common() so that the
information wakefunc.patch made waiters ready to receive may be passed to them
by wakers. This is provided as a separate patch so that the overhead of the
additional argument to __wake_up_common() can be measured in isolation. No
change in performance was observable here.
Andrew Morton [Fri, 14 May 2004 12:42:03 +0000 (05:42 -0700)]
[PATCH] filtered wakeups
From: William Lee Irwin III <wli@holomorphy.com>
This patch series is solving the "thundering herd" problem that occurs in the
mainline implementation of hashed waitqueues. There are two sources of
spurious wakeups in such arrangements:
(a) Hash collisions that place waiters on different objects on the same
waitqueue, which wakes threads falsely when any of the objects hashed to
the same queue receives a wakeup. i.e. loss of information about which
object a wakeup event is related to.
(b) Loss of information about which object a given waiter is waiting on.
This precludes wake-one semantics for mutual exclusion scenarios. For
instance, a lock bit may be slept on. If there are any waiters on the
object, a lock bit release event must wake at least one of them so as to
prevent deadlock. But without information as to which waiter is waiting
on which object, we must resort to waking all waiters who could possibly
be waiting on it. Now, as the lock bit provides mutual exclusion, only
one of the waiters woken can proceed, and the remainder will go back to
sleep and wait for another event, creating unnecessary system load. Once
wake-one semantics are established, only one of the waiters waiting to
acquire a lock bit need to be woken, which measurably reduces system load
and improves efficiency (i.e. it's the subject of the benchmarking I've
been sending to you).
Even beyond the measurable efficiency gains, there are reasons of robustness
and responsiveness to motivate addressing the issue of thundering herds. In a
real-life scenario I've been personally involved in resolving, the thundering
herd issue caused powerful modern SMP machines with fast IO systems to be
unresponsive to user input for a minute at a time or more. Analogues of these
patches for the distro kernels involved fully resolved the issue to the
customer's satisfaction and obviated workarounds to limit the pagecache's
size.
The latest spin of these patches basically shoves more pieces of the logic
into the wakeup functions, with some efficiency gains from sharing the hot
codepath with the rest of the kernel, and a slightly larger diff than the
patches with the newly-introduced entrypoint. Writing these was motivated by
the push to insulate sched.c from more of the details of wakeup semantics by
putting more of the logic into the wakeup functions. In order to accomplish
this while still solving (b), the wakeup functions grew a new argument for
communication about what object a wakeup event is related to to be passed by
the waker.
=========
This patch provides an additional argument to wakeup functions so that
information may be passed from the waker to the waiter. This is provided as a
separate patch so that the overhead of the additional argument can be measured
in isolation. No change in performance was observable here.
Andrew Morton [Fri, 14 May 2004 12:41:41 +0000 (05:41 -0700)]
[PATCH] VM accounting fix
From: Hugh Dickins <hugh@veritas.com>
Stas Sergeev <stsp@aknet.ru> wrote:
mprotect() fails to merge VMAs because one VMA can end up with
VM_ACCOUNT flag set, and another without that flag. That makes several
apps of mine to malfuncate.
Great find! Someone has got their test the wrong way round. Since that
VM_MAYACCT macro is being used in one place only, and just hiding what it's
actually about, fold it into its callsite.
Andrew Morton [Fri, 14 May 2004 12:41:31 +0000 (05:41 -0700)]
[PATCH] revert the process-migration-speedup patch
David Mosberger asked that this be backed out:
"I do not believe that flushing the TLB before migration is be the right thing
to do on ia64 machines which support global TLB purges (i.e., all but SGI's
machines)."
It was of huge benefit for the SGI machines, so work is ongoing.
Andrew Morton [Fri, 14 May 2004 12:41:20 +0000 (05:41 -0700)]
[PATCH] MSEC_TO_JIFFIES to msec_to_jiffies
Switch all users of MSEC[S]_TO_JIFFIES and JIFFIES_TO_MSEC[S] over to use
jiffies_to_msecs() and msecs_to_jiffies(). Withdraw MSECS_TO_JIFFIES() and
JIFFIES_TO_MSECS() from the kernel API.
Andrew Morton [Fri, 14 May 2004 12:40:57 +0000 (05:40 -0700)]
[PATCH] MSEC_TO_JIFFIES consolidation
From: Ingo Molnar <mingo@elte.hu>
We have various different implementations of MSEC[S]_TO_JIFFIES and
JIFFIES_TO_MSEC[S]. We recently had a compile-time clash in USB.
Fix all that up.
- The SCTP version was very inefficient. Hopefully this version is accurate
enough.
- Optimise for the HZ=100 and HZ=1000 cases
- This version does round-up, so sleep(9 milliseconds) works OK on 100HZ.
- We still have lots of jiffies_to_msec and msec_to_jiffies implementations.
From: William Lee Irwin III <wli@holomorphy.com>
Optimize the cases where HZ is a divisor of 1000 or vice-versa in
JIFFIES_TO_MSECS() and MSECS_TO_JIFFIES() by allowing the nonvanishing(!)
integral ratios to appear as a parenthesized expressions eligible for
constant folding optimizations.
From: me
Use typesafe inlines for the jiffies-to-millisecond conversion functions.
This means that milliseconds officially takes the type `unsigned int'.
All current callers seem to be OK with that.
Drivers need to be fixed up to use this instead of their private versions.
The race occurs if the vmscan.c path sees page_count()==1 and then the
page_cache_release() path happens in that few-instruction "window 1" before
vmscan's page_cache_get().
The page_cache_release() path does put_page_testzero(), which returns true.
Then this CPU takes an interrupt...
The vmscan.c path then does page_cache_get(), taking the refcount to one.
Then it uses the page and does page_cache_release(), taking the refcount to
zero and the page is really freed.
Now, the CPU running page_cache_release() returns from the interrupt, takes
the LRU lock, sees the page still has a refcount of zero and frees it again.
Boom.
The patch fixes this by closing "window 1". We provide a
"get_page_testone()" which grabs a ref on the page and returns true if the
refcount was previously zero. If that happens the vmscan.c code simply drops
the page's refcount again and leaves the page on the LRU.
All this happens under the zone->lru_lock, which is also taken by
__page_cache_release() and release_pages(), so the vmscan code knows that the
page has not been returned to the page allocator yet.
In terms of implementation, the page counts are now offset by one: a free page
has page->_count of -1. This is so that we can use atomic_add_negative() and
atomic_inc_and_test() to provide put_page_testzero() and get_page_testone().
The macros hide all of this so the public interpretation of page_count() and
set_page_count() remains unaltered.
The compiler can usually constant-fold the offsetting of page->count. This
patch increases an x86 SMP kernel's text by 32 bytes.
The patch renames page->count to page->_count to break callers who aren't
using the macros.
This patch requires that the architecture implement atomic_add_negative(). It
is currently present on