pandora-kernel.git
18 years ago[PATCH] use fget_light() in select/poll
Eric Dumazet [Tue, 28 Mar 2006 09:56:34 +0000 (01:56 -0800)]
[PATCH] use fget_light() in select/poll

Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Optimize select/poll by putting small data sets on the stack
Andi Kleen [Tue, 28 Mar 2006 09:56:33 +0000 (01:56 -0800)]
[PATCH] Optimize select/poll by putting small data sets on the stack

Optimize select and poll by a using stack space for small fd sets

This brings back an old optimization from Linux 2.0.  Using the stack is
faster than kmalloc.  On a Intel P4 system it speeds up a select of a
single pty fd by about 13% (~4000 cycles -> ~3500)

It also saves memory because a daemon hanging in select or poll will
usually save one or two less pages.  This can add up - e.g.  if you have 10
daemons blocking in poll/select you save 40KB of memory.

I did a patch for this long ago, but it was never applied.  This version is
a reimplementation of the old patch that tries to be less intrusive.  I
only did the minimal changes needed for the stack allocation.

The cut off point before external memory is allocated is currently at
832bytes.  The system calls always allocate this much memory on the stack.

These 832 bytes are divided into 256 bytes frontend data (for the select
bitmaps of the pollfds) and the rest of the space for the wait queues used
by the low level drivers.  There are some extreme cases where this won't
work out for select and it falls back to allocating memory too early -
especially with very sparse large select bitmaps - but the majority of
processes who only have a small number of file descriptors should be ok.
[TBD: 832/256 might not be the best split for select or poll]

I suspect more optimizations might be possible, but they would be more
complicated.  One way would be to cache the select/poll context over
multiple system calls because typically the input values should be similar.
 Problem is when to flush the file descriptors out though.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ide_generic_all_on() warning fix
Andrew Morton [Tue, 28 Mar 2006 09:56:32 +0000 (01:56 -0800)]
[PATCH] ide_generic_all_on() warning fix

drivers/ide/pci/generic.c:45: warning: `ide_generic_all_on' defined but not used

Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Small fixes backported to old IDE SiS driver
Alan Cox [Tue, 28 Mar 2006 09:56:31 +0000 (01:56 -0800)]
[PATCH] Small fixes backported to old IDE SiS driver

Some quick backport bits from the libata PATA work to fix things found in
the sis driver.  The piix driver needs some fixes too but those are way to
large and need someone working on old IDE with time to do them.

This patch fixes the case where random bits get loaded into SIS timing
registers according to the description of the correct behaviour from
Vojtech Pavlik.  It also adds the SiS5517 ATA16 chipset which is not
currently supported by the driver.  Thanks to Conrad Harriss for loaning me
the machine with the 5517 chipset.

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ide: AMD756 no host side cable detection
Rene Herman [Tue, 28 Mar 2006 09:56:30 +0000 (01:56 -0800)]
[PATCH] ide: AMD756 no host side cable detection

>From http://marc.theaimsgroup.com/?l=linux-kernel&m=110304128900342&w=2

AMD756 doesn't support host side cable detection. Do disk side only and
don't advice obsolete options.

Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] autofs4: proper prototype for autofs4_dentry_release()
Adrian Bunk [Tue, 28 Mar 2006 09:56:29 +0000 (01:56 -0800)]
[PATCH] autofs4: proper prototype for autofs4_dentry_release()

Add a proper prototype for autofs4_dentry_release() to autofs_i.h.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] drivers/block/acsi_slm.c: size_t can't be < 0
Alexey Dobriyan [Tue, 28 Mar 2006 09:56:28 +0000 (01:56 -0800)]
[PATCH] drivers/block/acsi_slm.c: size_t can't be < 0

A size_t can't be < 0.

(akpm: and rw_verify_area() already did that check)

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] remove relayfs_fs.h
Andrew Morton [Tue, 28 Mar 2006 09:56:27 +0000 (01:56 -0800)]
[PATCH] remove relayfs_fs.h

This is obsolete.

Cc: Tom Zanussi <zanussi@us.ibm.com>
Cc: Jens Axboe <axboe@suse.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Philip Gladstone has moved
Philip Gladstone [Tue, 28 Mar 2006 09:56:27 +0000 (01:56 -0800)]
[PATCH] Philip Gladstone has moved

I noticed that my email address is four jobs ago.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] fs/fat/: proper prototypes for two functions
Adrian Bunk [Tue, 28 Mar 2006 09:56:26 +0000 (01:56 -0800)]
[PATCH] fs/fat/: proper prototypes for two functions

Add proper prototypes for fat_cache_init() and fat_cache_destroy() in
msdos_fs.h.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] drivers/block/paride/pd.c: fix an off-by-one error
Adrian Bunk [Tue, 28 Mar 2006 09:56:25 +0000 (01:56 -0800)]
[PATCH] drivers/block/paride/pd.c: fix an off-by-one error

The Coverity checker found this off-by-one error.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Change dash2underscore() return value to char
Eric Sesterhenn [Tue, 28 Mar 2006 09:56:24 +0000 (01:56 -0800)]
[PATCH] Change dash2underscore() return value to char

Since dash2underscore() just operates and returns chars, I guess its safe
to change the return value to a char.  With my .config, this reduces its
size by 5 bytes.

   text    data     bss     dec     hex filename
   4155     152       0    4307    10d3 params.o.orig
   4150     152       0    4302    10ce params.o

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] mqueue comment typo fix
Serge E. Hallyn [Tue, 28 Mar 2006 09:56:23 +0000 (01:56 -0800)]
[PATCH] mqueue comment typo fix

(akpm: I don't do comment typos patches.  This one snuck through by accident)

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] alpha: make poll flags the same as other architectures
Andrew Morton [Tue, 28 Mar 2006 09:56:22 +0000 (01:56 -0800)]
[PATCH] alpha: make poll flags the same as other architectures

Renumber the recently-added POLLREMOVE and POLLRDHUP to line up with the other
architectures.

Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Add oprofile_add_ext_sample
Brian Rogan [Tue, 28 Mar 2006 09:56:20 +0000 (01:56 -0800)]
[PATCH] Add oprofile_add_ext_sample

On ppc64 we look at a profiling register to work out the sample address and
if it was in userspace or kernel.

The backtrace interface oprofile_add_sample does not allow this.  Create
oprofile_add_ext_sample and make oprofile_add_sample use it too.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Philippe Elie <phil.el@wanadoo.fr>
Cc: John Levon <levon@movementarian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] symversion warning fix
Andrew Morton [Tue, 28 Mar 2006 09:56:20 +0000 (01:56 -0800)]
[PATCH] symversion warning fix

gcc-4.2:

kernel/module.c: In function '__find_symbol':
kernel/module.c:158: warning: the address of '__start___kcrctab', will always evaluate as 'true'
kernel/module.c:165: warning: the address of '__start___kcrctab_gpl', will always evaluate as 'true'
kernel/module.c:182: warning: the address of '__start___kcrctab_gpl_future', will always evaluate as 'true'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] capi: register_chrdev() fix
Andrew Morton [Tue, 28 Mar 2006 09:56:19 +0000 (01:56 -0800)]
[PATCH] capi: register_chrdev() fix

If the user specified `major=0' (odd thing to do), capi.c will use dynamic
allocation.  We need to pick up that major for subsequent unregister_chrdev().

Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] paride-pt: register_chrdev fix
Andrew Morton [Tue, 28 Mar 2006 09:56:18 +0000 (01:56 -0800)]
[PATCH] paride-pt: register_chrdev fix

If the user specified `major=0' (odd thing to do), pt.c will use dynamic
allocation.  We need to pick up that major for subsequent unregister_chrdev().

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] paride: register_chrdev fix
Andrew Morton [Tue, 28 Mar 2006 09:56:18 +0000 (01:56 -0800)]
[PATCH] paride: register_chrdev fix

If the user specified `major=0' (odd thing to do), pg.c will use dynamic
allocation.  We need to pick up that major for subsequent unregister_chrdev().

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] let BLK_DEV_RAM_COUNT depend on BLK_DEV_RAM
Adrian Bunk [Tue, 28 Mar 2006 09:56:17 +0000 (01:56 -0800)]
[PATCH] let BLK_DEV_RAM_COUNT depend on BLK_DEV_RAM

It's purely cosmetic, but with the patch there's no longer a
BLK_DEV_RAM_COUNT setting in the .config if BLK_DEV_RAM=n.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] synclink_gt: remove uneeded async code
Paul Fulghum [Tue, 28 Mar 2006 09:56:16 +0000 (01:56 -0800)]
[PATCH] synclink_gt: remove uneeded async code

Remove code in async receive handling that serves no purpose with new tty
receive buffering.  Previously this code tried to free up receive buffer
space, but now does nothing useful while making expensive calls.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] synclink_gt add gpio feature
Paul Fulghum [Tue, 28 Mar 2006 09:56:15 +0000 (01:56 -0800)]
[PATCH] synclink_gt add gpio feature

Add driver support for general purpose I/O feature of the Synclink GT
adapters.

Signed-off-by: Paul Fulghum <paulkf@micrgate.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] synclink: remove dead code
Paul Fulghum [Tue, 28 Mar 2006 09:56:14 +0000 (01:56 -0800)]
[PATCH] synclink: remove dead code

Remove dead code from synclink driver.  This was used previously when the
write method had a from_user flag, which has been removed.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Decrapify asm-generic/local.h
Kyle McMartin [Tue, 28 Mar 2006 09:56:11 +0000 (01:56 -0800)]
[PATCH] Decrapify asm-generic/local.h

Now that Christoph Lameter's atomic_long_t support is merged in mainline,
might as well convert asm-generic/local.h to use it, so the same code can
be used for both sizes of 32 and 64-bit unsigned longs.

akpm sayeth:

Q:

  Is there any particular reason why these routines weren't simply
  implemented with local_save/restore_flags, if they are only meant to
  guarantee atomicity to the local cpu?  I'm sure on most platforms this
  would be more efficient than using an atomic...

A:

  The whole _point_ of local_t is to avoid local_irq_disable().  It's
  designed to exploit the fact that many CPUs can do incs and decs in a way
  which is atomic wrt local interrupts, but not atomic wrt SMP.

But this patch makes sense, because asm-generic/local.h is just a fallback
implementation for architectures which either cannot perform these
local-irq-atomic operations, or its maintainers haven't yet got around to
implementing them.

We need more work done on local_t in the 2.6.17 timeframe - they're defined as
unsigned long, but some architectures implement them as signed long.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove some duplicate BCD definitions
Matt Mackall [Tue, 28 Mar 2006 09:56:10 +0000 (01:56 -0800)]
[PATCH] RTC: Remove some duplicate BCD definitions

Remove some duplicate BCD definitions

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Fix up some RTC whitespace and style
Matt Mackall [Tue, 28 Mar 2006 09:56:09 +0000 (01:56 -0800)]
[PATCH] RTC: Fix up some RTC whitespace and style

Fix up some RTC whitespace and style

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on Alpha
Matt Mackall [Tue, 28 Mar 2006 09:56:09 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on Alpha

The sync may still be needed for CPU clock calibration but we don't sync in
the regular case.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on SH MPC1211
Matt Mackall [Tue, 28 Mar 2006 09:56:08 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on SH MPC1211

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on SH03
Matt Mackall [Tue, 28 Mar 2006 09:56:07 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on SH03

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on MIPS-based DEC
Matt Mackall [Tue, 28 Mar 2006 09:56:06 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on MIPS-based DEC

Move real_year inside the read loop and move the spinlock up as well

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on MIPS MC146818
Matt Mackall [Tue, 28 Mar 2006 09:56:05 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on MIPS MC146818

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on ARM
Matt Mackall [Tue, 28 Mar 2006 09:56:05 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on ARM

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on PPC Maple
Matt Mackall [Tue, 28 Mar 2006 09:56:04 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on PPC Maple

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on CHRP (arch/powerpc)
Matt Mackall [Tue, 28 Mar 2006 09:56:03 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on CHRP (arch/powerpc)

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on PPC CHRP (arch/ppc)
Matt Mackall [Tue, 28 Mar 2006 09:56:02 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on PPC CHRP (arch/ppc)

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on Sparc64
Matt Mackall [Tue, 28 Mar 2006 09:56:01 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on Sparc64

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on x86_64
Matt Mackall [Tue, 28 Mar 2006 09:56:01 +0000 (01:56 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on x86_64

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] RTC: Remove RTC UIP synchronization on x86
Matt Mackall [Tue, 28 Mar 2006 09:55:58 +0000 (01:55 -0800)]
[PATCH] RTC: Remove RTC UIP synchronization on x86

Reading the CMOS clock on x86 and some other arches currently takes up to one
second because it synchronizes with the CMOS second tick-over.  This delay
shows up at boot time as well a resume time.

This is the currently the most substantial boot time delay for machines that
are working towards instant-on capability.  Also, a quick back of the envelope
calculation (.5sec * 2M users * 1 boot a day * 10 years) suggests it has cost
Linux users in the neighborhood of a million man-hours.

An earlier thread on this topic is here:

http://groups.google.com/group/linux.kernel/browse_frm/thread/8a24255215ff6151/2aa97e66a977653d?hl=en&lr=&ie=UTF-8&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D1To2R-2S7-11%40gated-at.bofh.it#2aa97e66a977653d

..from which the consensus seems to be that it's no longer desirable.

In my view, there are basically four cases to consider:

1) networked, need precise walltime: use NTP
2) networked, don't need precise walltime: use NTP anyway
3) not networked, don't need sub-second precision walltime: don't care
4) not networked, need sub-second precision walltime:
   get a network or a radio time source because RTC isn't good enough anyway

So this patch series simply removes the synchronization in favor of a simple
seqlock-like approach using the seconds value.

Note that for purposes of timer accuracy on wakeup, this patch will cause us
to fire timers up to one second late.  But as the current timer resume code
will already sync once (or more!), it's no worse for short timers.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] powerpc: Kill _machine and hard-coded platform numbers
Benjamin Herrenschmidt [Tue, 28 Mar 2006 12:15:54 +0000 (23:15 +1100)]
[PATCH] powerpc: Kill _machine and hard-coded platform numbers

This removes statically assigned platform numbers and reworks the
powerpc platform probe code to use a better mechanism.  With this,
board support files can simply declare a new machine type with a
macro, and implement a probe() function that uses the flattened
device-tree to detect if they apply for a given machine.

We now have a machine_is() macro that replaces the comparisons of
_machine with the various PLATFORM_* constants.  This commit also
changes various drivers to use the new macro instead of looking at
_machine.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years agoppc: Fix compile error in arch/ppc/lib/strcase.c
Paul Mackerras [Tue, 28 Mar 2006 10:13:44 +0000 (21:13 +1100)]
ppc: Fix compile error in arch/ppc/lib/strcase.c

Now that the strncasecmp implementation takes a size_t third parameter,
we need to get a definition of size_t from somewhere.

Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[BLOCK] cfq-iosched: seek and async performance fixes
Jens Axboe [Tue, 28 Mar 2006 11:03:44 +0000 (13:03 +0200)]
[BLOCK] cfq-iosched: seek and async performance fixes

Detect whether a given process is seeky and if so disable (mostly) the
idle window if it is. We still allow just a little idle time, just enough
to allow that process to submit a new request. That is needed to maintain
fairness across priority groups.

In some cases, we could setup several async queues. This is not optimal
from a performance POV, since we want all async io in one queue to perform
good sorting on it. It also impacted sync queues, as async io got too much
slice time.

Signed-off-by: Jens Axboe <axboe@suse.de>
18 years ago[PATCH] git-powerpc: WARN was a dumb idea
Andrew Morton [Tue, 28 Mar 2006 07:42:49 +0000 (23:42 -0800)]
[PATCH] git-powerpc: WARN was a dumb idea

There are at least 14 different implementations of WARN() in the tree already.
The build fails all over the place.

Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: a couple of trivial compile warning fixes
Stephen Rothwell [Tue, 28 Mar 2006 06:14:44 +0000 (17:14 +1100)]
[PATCH] powerpc: a couple of trivial compile warning fixes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[ARM] Move ice-dcc code into misc.c
Russell King [Tue, 28 Mar 2006 09:34:05 +0000 (10:34 +0100)]
[ARM] Move ice-dcc code into misc.c

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
18 years ago[ARM] Fix decompressor serial IO to give CRLF not LFCR
Russell King [Tue, 28 Mar 2006 09:24:33 +0000 (10:24 +0100)]
[ARM] Fix decompressor serial IO to give CRLF not LFCR

As per the corresponding change to the serial drivers, arrange
for ARM decompressors to give CRLF.  Move the common putstr code
into misc.c such that machines only need to supply "putc" and
"flush" functions.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
18 years ago[SPARC64]: Implement futex_atomic_cmpxchg_inatomic().
David S. Miller [Tue, 28 Mar 2006 09:00:08 +0000 (01:00 -0800)]
[SPARC64]: Implement futex_atomic_cmpxchg_inatomic().

Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[PATCH] ll_rw_blk: fix 80-col offender in put_io_context()
Jens Axboe [Tue, 28 Mar 2006 07:00:28 +0000 (09:00 +0200)]
[PATCH] ll_rw_blk: fix 80-col offender in put_io_context()

This makes akpm more happy.

Signed-off-by: Jens Axboe <axboe@suse.de>
18 years ago[PATCH] cfq-iosched: small cfq_choose_req() optimization
Andreas Mohr [Tue, 28 Mar 2006 06:59:49 +0000 (08:59 +0200)]
[PATCH] cfq-iosched: small cfq_choose_req() optimization

this is a small optimization to cfq_choose_req() in the CFQ I/O scheduler
(this function is a semi-often invoked candidate in an oprofile log):
by using a bit mask variable, we can use a simple switch() to check
the various cases instead of having to query two variables for each check.
Benefit: 251 vs. 285 bytes footprint of cfq_choose_req().
Also, common case 0 (no request wrapping) is now checked first in code.

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Jens Axboe <axboe@suse.de>
18 years ago[PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree
Jens Axboe [Tue, 28 Mar 2006 06:59:01 +0000 (08:59 +0200)]
[PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree

On setups with many disks, we spend a considerable amount of time
looking up the process-disk mapping on each queue of io. Testing with
a NULL based block driver, this costs 40-50% reduction in throughput
for 1000 disks.

Signed-off-by: Jens Axboe <axboe@suse.de>
18 years agoMerge branch '85xx' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc
Paul Mackerras [Tue, 28 Mar 2006 06:03:19 +0000 (17:03 +1100)]
Merge branch '85xx' of git://git./linux/kernel/git/galak/powerpc

18 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc
Paul Mackerras [Tue, 28 Mar 2006 06:02:14 +0000 (17:02 +1100)]
Merge branch 'misc' of git://git./linux/kernel/git/galak/powerpc

18 years agopowerpc: remove OCP references
Kumar Gala [Tue, 28 Mar 2006 05:48:37 +0000 (23:48 -0600)]
powerpc: remove OCP references

OCP isn't used in arch/powerpc and hopefully will never be.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
18 years ago[PATCH] powerpc: make ISA floppies work again
Stephen Rothwell [Tue, 28 Mar 2006 03:40:58 +0000 (14:40 +1100)]
[PATCH] powerpc: make ISA floppies work again

We used to assume that a DMA mapping request with a NULL dev was for
ISA DMA.  This assumption was broken at some point.  Now we explicitly
pass the detected ISA PCI device in the floppy setup.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: Fix some initcall return values
Anton Blanchard [Tue, 28 Mar 2006 03:08:39 +0000 (14:08 +1100)]
[PATCH] powerpc: Fix some initcall return values

Non zero initcalls (except for -ENODEV) have started warning at boot.
Fix smt_setup and init_ras_IRQ.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: Workaround for pSeries RTAS bug
Mike Kravetz [Mon, 27 Mar 2006 23:20:00 +0000 (15:20 -0800)]
[PATCH] powerpc: Workaround for pSeries RTAS bug

A bug in the RTAS services incorrectly interprets some bits in the CR
when called from the OS.  Specifically, bits in CR4.  The result could
be a firmware crash that also takes down the partition.  A firmware
fix is in the works.  We have seen this situation when performing DLPAR
operations.  As a temporary workaround, clear the CR in enter_rtas().
Note that enter_rtas() will not set any bits in CR4 before calling RTAS.

Also note that the 32 bit version of enter_rtas() should have the same
work around even though the chances of hitting the bug are much smaller
due to the lack of DLPAR on 32 bit kernels.  However, my assembly skills
are a bit rusty and the 32 bit code doesn't seem to follow the conventions
for where things should be saved.  In addition, I don't have a system
to test 32 bit kernels.  Help creating and at least touch testing the
same workaround for 32 bit would be appreciated.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] spufs: fix __init/__exit annotations
Arnd Bergmann [Mon, 27 Mar 2006 19:27:40 +0000 (21:27 +0200)]
[PATCH] spufs: fix __init/__exit annotations

spufs_init and spufs_exit should be marked correctly so
they can be removed when not needed.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: add hvc backend for rtas
Arnd Bergmann [Mon, 27 Mar 2006 19:26:03 +0000 (21:26 +0200)]
[PATCH] powerpc: add hvc backend for rtas

Current Cell hardware is using the console through a set
of rtas calls. This driver is needed to get console
output on those boards.

Signed-off-by: Arnd Bergmann <abergman@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: hvc_console updates
Ryan S. Arnold [Mon, 27 Mar 2006 19:25:16 +0000 (21:25 +0200)]
[PATCH] powerpc: hvc_console updates

These are some updates from both Ryan and Arnd for the hvc_console
driver:

The main point is to enable the inclusion of a console driver
for rtas, which is currrently needed for the cell platform.

Also shuffle around some data-type declarations and moves some
functions out of include/asm-ppc64/hvconsole.h and into a new
drivers/char/hvc_console.h file.

Signed-off-by: "Ryan S. Arnold" <rsa@us.ibm.com>
Signed-off-by: Arnd Bergmann <abergman@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: fix incorrect SA_ONSTACK behaviour for 64-bit processes
Laurent MEYER [Mon, 27 Mar 2006 09:37:41 +0000 (11:37 +0200)]
[PATCH] powerpc: fix incorrect SA_ONSTACK behaviour for 64-bit processes

*) When setting a sighandler using sigaction() call, if the flag
SA_ONSTACK is set and no alternate stack is provided via sigaltstack(),
the kernel still try to install the alternate stack. This behavior is
the opposite of the one which is documented in Single Unix
Specifications V3.

*) Also when setting an alternate stack using sigaltstack() with the
flag SS_DISABLE, the kernel try to install the alternate stack on
signal delivery.

These two use cases makes the process crash at signal delivery.

This fixes it.

Signed-off-by: Laurent Meyer <meyerlau@fr.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: Cope with duplicate node & property names in /proc/device-tree
Michael Ellerman [Mon, 27 Mar 2006 03:26:26 +0000 (14:26 +1100)]
[PATCH] powerpc: Cope with duplicate node & property names in /proc/device-tree

Various dodgy firmware might give us nodes and/or properties in the device
tree with conflicting names. That's generally ok, except for when we export
the device tree via /proc, so check when we're creating the proc device tree
and munge names accordingly.

Tested on a faked device tree with kexec, would be good if someone with
actual bogus firmware could try it, but just for completeness.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: Rename and export ppc64_firmware_features
Michael Ellerman [Mon, 27 Mar 2006 03:26:25 +0000 (14:26 +1100)]
[PATCH] powerpc: Rename and export ppc64_firmware_features

We need to export ppc64_firmware_features for modules. Before we do that
I think we should probably rename it to powerpc_firmware_features.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years agopowerpc: Make uImage default build output for MPC8540 ADS
Kumar Gala [Tue, 28 Mar 2006 05:44:37 +0000 (23:44 -0600)]
powerpc: Make uImage default build output for MPC8540 ADS

When we build for the MPC8540 ADS produce a uImage by default.
Updated the defconfig to reflect this as well.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
18 years agopowerpc: move math-emu over to arch/powerpc
Kumar Gala [Tue, 28 Mar 2006 05:43:27 +0000 (23:43 -0600)]
powerpc: move math-emu over to arch/powerpc

Towards the goal of having arch/powerpc not build anything over in arch/ppc
move math-emu over.  Also, killed some references to arch/ppc/ in the
arch/powerpc Makefile which should belong in drivers/ when the particular
sub-arch's move over to arch/powerpc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
18 years ago[PATCH] powerpc: export validate_sp for oprofile calltrace
Anton Blanchard [Mon, 27 Mar 2006 00:46:18 +0000 (11:46 +1100)]
[PATCH] powerpc: export validate_sp for oprofile calltrace

Export validate_sp so we can use it in the oprofile calltrace code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[PATCH] powerpc: Remove some ifdefs in oprofile_impl.h
Anton Blanchard [Mon, 27 Mar 2006 00:23:29 +0000 (11:23 +1100)]
[PATCH] powerpc: Remove some ifdefs in oprofile_impl.h

- No one uses op_counter_config.valid, so remove it
- No need to ifdef around function protypes.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years agopowerpc: use memparse() for mem= command line parsing
Kumar Gala [Tue, 28 Mar 2006 00:26:42 +0000 (18:26 -0600)]
powerpc: use memparse() for mem= command line parsing

Use memparse() instead of our own code for handling the parsing of mem=

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
18 years agoppc: fix strncasecmp prototype
Kumar Gala [Tue, 28 Mar 2006 00:26:18 +0000 (18:26 -0600)]
ppc: fix strncasecmp prototype

Match, Linus's fix to arch/powerpc in arch/ppc. strcasecmp takes a size_t,
not an int, as its third argument.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
18 years agoppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc
Paul Mackerras [Mon, 27 Mar 2006 23:22:10 +0000 (10:22 +1100)]
ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc

32-bit CHRP machines are now supported only in arch/powerpc, as are
all 64-bit PowerPC processors.  This means that we don't use
Open Firmware on any platform in arch/ppc any more.

This makes PReP support a single-platform option like every other
platform support option in arch/ppc now, thus CONFIG_PPC_MULTIPLATFORM
is gone from arch/ppc.  CONFIG_PPC_PREP is the option that selects
PReP support and is generally what has replaced
CONFIG_PPC_MULTIPLATFORM within arch/ppc.

_machine is all but dead now, being #defined to 0.

Updated Makefiles, comments and Kconfig options generally to reflect
these changes.

Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years agopowerpc: Fix goof in 6xx and POWER4 idle power-save functions
Paul Mackerras [Mon, 27 Mar 2006 22:28:14 +0000 (09:28 +1100)]
powerpc: Fix goof in 6xx and POWER4 idle power-save functions

This fixes a mistake I made when editing these functions - when I
took out the interrupt disabling code (because interrupts are now
disabled by the caller) I left the register that is used for the MSR
value to be used during doze/nap uninitialized.  This fixes it.

Also updated some of the comments in idle_power4.S and removed some
code that was copied over from idle_6xx.S but is no longer relevant
(we don't ever clear the CPU_FTR_CAN_NAP bit at runtime for POWER4).

Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[CPUFREQ] powernow: remove private for_each_cpu_mask()
Andrew Morton [Sat, 25 Mar 2006 09:51:23 +0000 (01:51 -0800)]
[CPUFREQ] powernow: remove private for_each_cpu_mask()

It is unneeded and wrong.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
18 years ago[CPUFREQ] hotplug cpu fix for powernow-k8
shin, jacob [Mon, 27 Mar 2006 15:57:20 +0000 (09:57 -0600)]
[CPUFREQ] hotplug cpu fix for powernow-k8

Andi's previous fix to initialise powernow_data on all siblings
will not work properly with CPU Hotplug.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Signed-off-by: Dave Jones <davej@redhat.com>
18 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufreq-2.6
Dave Jones [Mon, 27 Mar 2006 19:56:39 +0000 (14:56 -0500)]
Merge git://git./linux/kernel/git/brodo/cpufreq-2.6

18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Mon, 27 Mar 2006 16:47:54 +0000 (08:47 -0800)]
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix off-by-1 error in TSB grow check.

18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 27 Mar 2006 16:47:29 +0000 (08:47 -0800)]
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: drop duplicate assignment in request_sock
  [IPSEC]: Fix tunnel error handling in ipcomp6

18 years agoMerge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block
Linus Torvalds [Mon, 27 Mar 2006 16:46:49 +0000 (08:46 -0800)]
Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block

* 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [PATCH] Don't make debugfs depend on DEBUG_KERNEL
  [PATCH] Fix blktrace compile with sysfs not defined
  [PATCH] unused label in drivers/block/cciss.
  [BLOCK] increase size of disk stat counters
  [PATCH] blk_execute_rq_nowait-speedup
  [PATCH] ide-cd: quiet down GPCMD_READ_CDVD_CAPACITY failure
  [BLOCK] ll_rw_blk: kmalloc -> kzalloc conversion
  [PATCH] kzalloc() conversion in drivers/block
  [PATCH] update max_sectors documentation

18 years ago[PATCH] md: Convert reconfig_sem to reconfig_mutex
NeilBrown [Mon, 27 Mar 2006 09:18:20 +0000 (01:18 -0800)]
[PATCH] md: Convert reconfig_sem to reconfig_mutex

... being careful that mutex_trylock is inverted wrt down_trylock

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] sem2mutex: drivers/md
Arjan van de Ven [Mon, 27 Mar 2006 09:18:20 +0000 (01:18 -0800)]
[PATCH] sem2mutex: drivers/md

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Restore 'remaining' count when retrying an write operation
NeilBrown [Mon, 27 Mar 2006 09:18:19 +0000 (01:18 -0800)]
[PATCH] md: Restore 'remaining' count when retrying an write operation

When retrying a write due to barrier failure, we don't reset 'remaining', so
it goes negative and never hits 0 again.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Fix md grow/size code to correctly find the maximum available space
NeilBrown [Mon, 27 Mar 2006 09:18:18 +0000 (01:18 -0800)]
[PATCH] md: Fix md grow/size code to correctly find the maximum available space

An md array can be asked to change the amount of each device that it is using,
and in particular can be asked to use the maximum available space.  This
currently only works if the first device is not larger than the rest.  As
'size' gets changed and so 'fit' becomes wrong.  So check if a 'fit' is
required early and don't corrupt it.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Remove bi_end_io call out from under a spinlock
NeilBrown [Mon, 27 Mar 2006 09:18:17 +0000 (01:18 -0800)]
[PATCH] md: Remove bi_end_io call out from under a spinlock

raid5 overloads bi_phys_segments to count the number of blocks that the
request was broken in to so that it knows when the bio is completely handled.

Accessing this must always be done under a spinlock.  In one case we also call
bi_end_io under that spinlock, which probably isn't ideal as bi_end_io could
be expensive (even though it isn't allowed to sleep).

So we reducde the range of the spinlock to just accessing bi_phys_segments.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Remove some stray semi-colons after functions called in macro..
NeilBrown [Mon, 27 Mar 2006 09:18:16 +0000 (01:18 -0800)]
[PATCH] md: Remove some stray semi-colons after functions called in macro..

wait_event_lock_irq puts a ';' after its usage of the 4th arg, so we don't
need to.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Improve comments about locking situation in raid5 make_request
NeilBrown [Mon, 27 Mar 2006 09:18:15 +0000 (01:18 -0800)]
[PATCH] md: Improve comments about locking situation in raid5 make_request

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Support suspending of IO to regions of an md array
NeilBrown [Mon, 27 Mar 2006 09:18:14 +0000 (01:18 -0800)]
[PATCH] md: Support suspending of IO to regions of an md array

This allows user-space to access data safely.  This is needed for raid5
reshape as user-space needs to take a backup of the first few stripes before
allowing reshape to commence.

It will also be useful in cluster-aware raid1 configurations so that all
cluster members can leave a section of the array untouched while a
resync/recovery happens.

A 'start' and 'end' of the suspended range are written to 2 sysfs attributes.
Note that only one range can be suspended at a time.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Make 'reshape' a possible sync_action action
NeilBrown [Mon, 27 Mar 2006 09:18:13 +0000 (01:18 -0800)]
[PATCH] md: Make 'reshape' a possible sync_action action

This allows reshape to be triggerred via sysfs (which is the only way to start
it happening).

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Split reshape handler in check_reshape and start_reshape
NeilBrown [Mon, 27 Mar 2006 09:18:13 +0000 (01:18 -0800)]
[PATCH] md: Split reshape handler in check_reshape and start_reshape

check_reshape checks validity and does things that can be done instantly -
like adding devices to raid1.  start_reshape initiates a restriping process to
convert the whole array.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Only checkpoint expansion progress occasionally
NeilBrown [Mon, 27 Mar 2006 09:18:12 +0000 (01:18 -0800)]
[PATCH] md: Only checkpoint expansion progress occasionally

Instead of checkpointing at each stripe, only checkpoint when a new write
would overwrite uncheckpointed data.  Block any write to the uncheckpointed
area.  Arbitrarily checkpoint at least every 3Meg.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Checkpoint and allow restart of raid5 reshape
NeilBrown [Mon, 27 Mar 2006 09:18:11 +0000 (01:18 -0800)]
[PATCH] md: Checkpoint and allow restart of raid5 reshape

We allow the superblock to record an 'old' and a 'new' geometry, and a
position where any conversion is up to.  The geometry allows for changing
chunksize, layout and level as well as number of devices.

When using verion-0.90 superblock, we convert the version to 0.91 while the
conversion is happening so that an old kernel will refuse the assemble the
array.  For version-1, we use a feature bit for the same effect.

When starting an array we check for an incomplete reshape and restart the
reshape process if needed.  If the reshape stopped at an awkward time (like
when updating the first stripe) we refuse to assemble the array, and let
user-space worry about it.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Final stages of raid5 expand code
NeilBrown [Mon, 27 Mar 2006 09:18:10 +0000 (01:18 -0800)]
[PATCH] md: Final stages of raid5 expand code

This patch adds raid5_reshape and end_reshape which will start and finish the
reshape processes.

raid5_reshape is only enabled in CONFIG_MD_RAID5_RESHAPE is set, to discourage
accidental use.

Read the 'help' for the CONFIG_MD_RAID5_RESHAPE entry.

and Make sure that you have backups, just in case.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Core of raid5 resize process
NeilBrown [Mon, 27 Mar 2006 09:18:09 +0000 (01:18 -0800)]
[PATCH] md: Core of raid5 resize process

This patch provides the core of the resize/expand process.

sync_request notices if a 'reshape' is happening and acts accordingly.

It allocated new stripe_heads for the next chunk-wide-stripe in the target
geometry, marking them STRIPE_EXPANDING.

Then it finds which stripe heads in the old geometry can provide data needed
by these and marks them STRIPE_EXPAND_SOURCE.  This causes stripe_handle to
read all blocks on those stripes.

Once all blocks on a STRIPE_EXPAND_SOURCE stripe_head are read, any that are
needed are copied into the corresponding STRIPE_EXPANDING stripe_head.  Once a
STRIPE_EXPANDING stripe_head is full, it is marks STRIPE_EXPAND_READY and then
is written out and released.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Infrastructure to allow normal IO to continue while array is expanding
NeilBrown [Mon, 27 Mar 2006 09:18:08 +0000 (01:18 -0800)]
[PATCH] md: Infrastructure to allow normal IO to continue while array is expanding

We need to allow that different stripes are of different effective sizes, and
use the appropriate size.  Also, when a stripe is being expanded, we must
block any IO attempts until the stripe is stable again.

Key elements in this change are:
 - each stripe_head gets a 'disk' field which is part of the key,
   thus there can sometimes be two stripe heads of the same area of
   the array, but covering different numbers of devices.  One of these
   will be marked STRIPE_EXPANDING and so won't accept new requests.
 - conf->expand_progress tracks how the expansion is progressing and
   is used to determine whether the target part of the array has been
   expanded yet or not.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Allow stripes to be expanded in preparation for expanding an array
NeilBrown [Mon, 27 Mar 2006 09:18:07 +0000 (01:18 -0800)]
[PATCH] md: Allow stripes to be expanded in preparation for expanding an array

Before a RAID-5 can be expanded, we need to be able to expand the stripe-cache
data structure.

This requires allocating new stripes in a new kmem_cache.  If this succeeds,
we copy cache pages over and release the old stripes and kmem_cache.

We then allocate new pages.  If that fails, we leave the stripe cache at it's
new size.  It isn't worth the effort to shrink it back again.

Unfortuanately this means we need two kmem_cache names as we, for a short
period of time, we have two kmem_caches.  So they are raid5/%s and
raid5/%s-alt

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Split disks array out of raid5 conf structure so it is easier to grow
NeilBrown [Mon, 27 Mar 2006 09:18:06 +0000 (01:18 -0800)]
[PATCH] md: Split disks array out of raid5 conf structure so it is easier to grow

The remainder of this batch implements raid5 reshaping.  Currently the only
shape change that is supported is added a device, but it is envisioned that
changing the chunksize and layout will also be supported, as well as changing
the level (e.g.  1->5, 5->6).

The reshape process naturally has to move all of the data in the array, and so
should be used with caution.  It is believed to work, and some testing does
support this, but wider testing would be great for increasing my confidence.

You will need a version of mdadm newer than 2.3.1 to make use of raid5 growth.
 This is because mdadm need to take a copy of a 'critical section' at the
start of the array incase there is a crash at an awkward moment.  On restart,
mdadm will restore the critical section and allow reshape to continue.

I hope to release a 2.4-pre by early next week - it still needs a little more
polishing.

This patch:

Previously the array of disk information was included in the raid5 'conf'
structure which was allocated to an appropriate size.  This makes it awkward
to change the size of that array.  So we split it off into a separate
kmalloced array which will require a little extra indexing, but is much easier
to grow.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Update status_resync to handle LARGE devices
NeilBrown [Mon, 27 Mar 2006 09:18:04 +0000 (01:18 -0800)]
[PATCH] md: Update status_resync to handle LARGE devices

status_resync - used by /proc/mdstat to report the status of a resync, assumes
that device sizes will always fit into an 'unsigned long' This is no longer
the case...

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Fix the 'failed' count for version-0 superblocks
NeilBrown [Mon, 27 Mar 2006 09:18:03 +0000 (01:18 -0800)]
[PATCH] md: Fix the 'failed' count for version-0 superblocks

We are counting failed devices twice, once of the device that is failed, and
once for the hole that has been left in the array.  Remove the former so
'failed' matches 'missing'.  Storing these counts in the superblock is a bit
silly anyway....

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Add '4' to the list of levels for which bitmaps are supported
NeilBrown [Mon, 27 Mar 2006 09:18:03 +0000 (01:18 -0800)]
[PATCH] md: Add '4' to the list of levels for which bitmaps are supported

I really should make this a function of the personality....

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: Make sure QUEUE_FLAG_CLUSTER is set properly for md.
NeilBrown [Mon, 27 Mar 2006 09:18:02 +0000 (01:18 -0800)]
[PATCH] md: Make sure QUEUE_FLAG_CLUSTER is set properly for md.

This flag should be set for a virtual device iff it is set for all underlying
devices.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] dm: remove unnecessary typecast
Kevin Corry [Mon, 27 Mar 2006 09:18:01 +0000 (01:18 -0800)]
[PATCH] dm: remove unnecessary typecast

Signed-off-by: Kevin Corry <kevcorry@us.ibm.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] dm/md dependency tree in sysfs: convert bd_sem to bd_mutex
Jun'ichi Nomura [Mon, 27 Mar 2006 09:18:00 +0000 (01:18 -0800)]
[PATCH] dm/md dependency tree in sysfs: convert bd_sem to bd_mutex

Convert bd_sem to bd_mutex

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] dm/md dependency tree in sysfs: dm to use bd_claim_by_disk
Jun'ichi Nomura [Mon, 27 Mar 2006 09:17:59 +0000 (01:17 -0800)]
[PATCH] dm/md dependency tree in sysfs: dm to use bd_claim_by_disk

Use bd_claim_by_disk.

Following symlinks are created if dm-0 maps to sda:
  /sys/block/dm-0/slaves/sda --> /sys/block/sda
  /sys/block/sda/holders/dm-0 --> /sys/block/dm-0

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] dm/md dependency tree in sysfs: md to use bd_claim_by_disk
Jun'ichi Nomura [Mon, 27 Mar 2006 09:17:58 +0000 (01:17 -0800)]
[PATCH] dm/md dependency tree in sysfs: md to use bd_claim_by_disk

Use bd_claim_by_disk.

Following symlinks are created if md0 is built from sda and sdb
  /sys/block/md0/slaves/sda --> /sys/block/sda
  /sys/block/md0/slaves/sdb --> /sys/block/sdb
  /sys/block/sda/holders/md0 --> /sys/block/md0
  /sys/block/sdb/holders/md0 --> /sys/block/md0

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>