Ingo Molnar [Tue, 13 Aug 2002 07:36:26 +0000 (00:36 -0700)]
[PATCH] clone-detached-2.5.31-B0
the attached patch implements the per-CPU thread-structure cache to do
detached exit, if the parent does not want to be notified of child exit
via a signal.
Badari Pulavarty [Tue, 13 Aug 2002 07:29:36 +0000 (00:29 -0700)]
[PATCH] embarrassing 2.5.31 small bug fix for blkdev_reread_part()
Here is a trivial bug fix for blkdev_reread_part() in 2.5.31.
Without this fix, "fdisk" hangs with following messages:
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16:
Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Rusty Russell [Tue, 13 Aug 2002 03:27:49 +0000 (20:27 -0700)]
[PATCH] DECLARE_PER_CPU/DEFINE_PER_CPU patch
This old __per_cpu_data define wasn't enough if an arch wants to
use the gcc __thread prefix (thread local storage), which needs to
go *before* the type in the definition. So we have to go for a
DECLARE macro, and while we're there, separate DECLARE and DEFINE,
as definitions of per-cpu data cannot live in modules. This also
means that accidental direct references to per-cpu variables will
be caught at compile time.
Rusty Russell [Tue, 13 Aug 2002 03:27:45 +0000 (20:27 -0700)]
[PATCH] get_cpu_var patch
This makes introduces get_cpu_var()/put_cpu_var() which gets a
per-cpu variable and disables preemption, and renames the (unsafe
under preemption) "this_cpu()" macro to __get_cpu_var(). It also
deletes the redundant definitions in linux/smp.h.
Tom Rini [Tue, 13 Aug 2002 01:22:12 +0000 (18:22 -0700)]
[PATCH] A generic RTC driver [3/3]
This is part 3 of 3 of the genrtc patches. This is my own slight bit
of work, as well as some work by Randolph Chung. This changes
set_rtc_time(struct *rtc_time) to return an int instead of void.
This was done so that the arch-specific code here could do additional
checks on the time and return an error if needed. This then introduces
include/asm-generic/rtc.h, include/asm-i386/rtc.h and
include/asm-alpha/rtc.h. include/asm-generic/rtc.h contains the
get_rtc_time and set_rtc_time logic that is in drivers/char/rtc.c and
has been tested on SMP i386. This also modifies include/asm-ppc/rtc.h
to return -ENODEV if no rtc hardware is present.
Additionally, Dave Jones pointed out to me a place where we might not be
safe when jiffies wraps, so this switches that to time_after().
From Randolph Chung, support for a 64bit kernel and a 32bit userland.
Tom Rini [Tue, 13 Aug 2002 01:22:07 +0000 (18:22 -0700)]
[PATCH] A generic RTC driver [2/3]
This is part 2 of 3 of the genrtc driver work. This is the PPC portion
of the patch, which creates include/asm-ppc/rtc.h. This has been in the
PPC bitkeeper tree for over a month now.
Tom Rini [Tue, 13 Aug 2002 01:22:03 +0000 (18:22 -0700)]
[PATCH] A generic RTC driver [1/3]
This is the current version of the genrtc driver from the m68k
community. This is slightly different than the version I have sent
previously in that it has been switched to C99-style initializers,
which was done in the current m68k CVS tree by Geert Uytterhoeven, and
the needed changes to select/compile it in general. I had previously
asked the m68k community if anyone objected to this being submitted by me,
and I got Richard Zidlicky's (who's at the top of the file) approval, as
well as Geert Uytterhoeven's approval.
Albert Cranford [Tue, 13 Aug 2002 01:13:54 +0000 (18:13 -0700)]
[PATCH] 2.5.31 i2c updates
i2c update:
o Support for SMBus 2.0 PEC Packet Error Checking
o New adapter-i2c-frodo for SA 1110 board
o New adapter-i2c-rpx for embeded MPC8XX
o Replace depreciated cli()&sti() with spin_{un}lock_irq()
o Updated documentation
[PATCH] i_sem-less generic_file_write for O_DIRECT & XFS
There are a number of places where generic_file_write could be used if
it didn't take i_sem by itself or where it doesn't need it:
(1) XFS needs to do some preparation in it's write file operation
(most notably taking it's own per-inode locks), after taking
i_sem, but before calling the guts of generic_file_write.
(2) blockdevices are happy with parralel get_block() operations,
and there is nothing i_sem could protect.
This patch introduces a generic_file_write_nolock and makes the good old
generic_file_write a wrapper around. The block device code is switched
over to it.
Rusty Russell [Tue, 13 Aug 2002 00:54:12 +0000 (17:54 -0700)]
[PATCH] Designated initializers for i386
The old form of designated initializers are obsolete: we need to
replace them with the ISO C forms before 2.6. Gcc has always supported
both forms anyway.
Jens Axboe [Tue, 13 Aug 2002 00:54:03 +0000 (17:54 -0700)]
[PATCH] sym53c8xx_2
The following patch from Anton Blanchard fixes a problem with the
sym53c8xx_2 driver in the 2.5 tree. It assumes that the eh error
handlers are not called with the host lock held, which they are.
Neil Brown [Tue, 13 Aug 2002 00:48:53 +0000 (17:48 -0700)]
[PATCH] PATCH - RPC/TCP 4 of 4 - Handle short read when reading RPC/TCP packet length
The code already copes with the possibility of having
read some of the 4byte length but not all, but can never
get into that situation. We just need to add a 'return'
for the case where read got some data but not enough.
Either 0 or -EAGAIN could be returned, they both have the
same effect.
Neil Brown [Tue, 13 Aug 2002 00:48:41 +0000 (17:48 -0700)]
[PATCH] Rearrange setting of snd/rcv buf size to avoid locking issue
Currently svc_sock_setbuf can be called under a spinlock,
but it can try to lock a socket, which can block....
Now when we decide that changing the size might be good we
set a flag (SK_CHNGBUF) and then later (when the next
packet arrives) we change the sizes appropriately.
NTFS: 2.0.25 - Small bug fixes and cleanups.
- Unlock the page in an out of memory error code path in
fs/ntfs/aops.c::ntfs_read_block().
- If fs/ntfs/aops.c::ntfs_read_page() is called on an uptodate page,
just unlock the page and return. (This can happen due to ->writepage
clearing PageUptodate() during write out of MstProtected()
attributes.
- Remove leaked write code again.
Rik van Riel [Mon, 12 Aug 2002 10:07:07 +0000 (03:07 -0700)]
[PATCH] rmap bugfix, try_to_unmap
The following patch corrects a bug where rmap would continue trying to
swap out a page even after it failed on one pte, which could result in
leaked pte chains and a bug when exiting applications which use mlock().
The bug was tracked down by Christian Ehrhardt, the reason it wasn't
found earlier was a subtlety in the code, so I've taken the liberty of
changing Christian's patch into something more explicit, we shouldn't
let this one happen again ;)
Ingo Molnar [Mon, 12 Aug 2002 07:07:09 +0000 (00:07 -0700)]
[PATCH] tls-2.5.31-D9
3 TLS entries, 9 cycles copying and no branches in the context-switch
path. The patch also adds Christoph's suggestion and renames
modify_ldt_ldt_s (yuck!) to user_desc.
Simon Evans [Mon, 12 Aug 2002 03:49:18 +0000 (20:49 -0700)]
[PATCH] misc fixes for konicawc driver
This patch against 2.5.31 fixes some problems in the konicawc driver
- add new video mode 160x120
- add konicawc_camera_on/off()
- initially send out URBs in status,data order
- fix konicawc_isoc_irq to always resubmit status then data URBs
- tidy up debug messages
- make konicawc_compress_iso look for frame start on initial image
Pete Zaitcev [Sun, 11 Aug 2002 10:56:43 +0000 (03:56 -0700)]
SPARC: More work to get sparc32 working in 2.5.x
- page-size PTE directory with 16-word pmd_t as suggested by RMK and Riel
- support for 2.5.x softirq infrastructure
- other miscellanea
Andrew Morton [Sat, 10 Aug 2002 11:40:05 +0000 (04:40 -0700)]
[PATCH] Infrastructure for atomic user accesses
Well the optimum solution there would be to create and use
`inc_preempt_count_non_preempt()'. I don't see any
way of embedding this in kmap_atomic() or copy_to_user_atomic()
without loss of flexibility or incurring a double-inc somewhere.
Andrew Morton [Sat, 10 Aug 2002 09:44:55 +0000 (02:44 -0700)]
[PATCH] fix a race between set_page_dirty and truncate
Fix a race between set_page_dirty() and truncate.
The page could have been removed from the mapping while this CPU is
spinning on the lock. __free_pages_ok() will go BUG.
This has not been observed in practice - most callers of
set_page_dirty() hold the page lock which gives exclusion from
truncate. But zap_pte_range() does not.
Andrew Morton [Sat, 10 Aug 2002 09:44:47 +0000 (02:44 -0700)]
[PATCH] sync get_user_pages with 2.4
Forward port of get_user_pages() change from 2.4.
- If the vma is marked as VM_IO area then fail the map.
This prevents kernel deadlocks which occur when applications which
have frame buffers mapped try to dump core. Also prevents a kernel
oops when a debugger is attached to a process which has an IO mmap.
- Check that the mapped page is inside mem_map[] (pfn_valid).
- inline follow_page() and remove the preempt_disable()s. It has
only a single callsite and is called under spinloclk.
Andrew Morton [Sat, 10 Aug 2002 09:44:42 +0000 (02:44 -0700)]
[PATCH] tunable ext3 commit interval
The patch from Stephen Tweedie allows users to modify the journal
commit interval for the ext3 filesystem.
The commit interval is normally five seconds. For portable computers
with spun-down drives it is advantageous to be able to increase the
commit interval.
There may also be advantages in decreasing the commit interval for
specialised applications such as heavily-loaded NFS servers which are
using synchronous exports.
The laptop users will also need to increase the pdflush periodic
writeback interval (/proc/sys/vm/dirty_writeback_centisecs), because
the `kupdate' activity also forces a commit.
To specify the commit interval, use
mount -o commit=30 /dev/hda1 /mnt/whatever
or
mount -o remount,commit=30 /dev/hda1
The commit interval is specified in units of seconds.
Andrew Morton [Sat, 10 Aug 2002 09:44:38 +0000 (02:44 -0700)]
[PATCH] copy_strings speedup
This is the first of three patches which reduce the amount of
kmap/kunmap traffic on highmem machines.
The workload which was tested was RAM-only dbench. This is dominated
by copy_*_user() costs.
The three patches speed up my 4xPIII by 3%
The three patches speed up a 16P NUMA-Q by 100 to 150%
The first two patches (copy_strings and pagecache reads) speed up an
8-way by 15%. I expect that all three patches will speed up the 8-way
by 40%.
Some of the benefit is from reduced pressure on kmap_lock. Most of it
is from reducing the number of global TLB invalidations.
This patch fixes up copy_strings(). copy_strings does a huge amount of
kmapping. Martin Bligh has noted that across a kernel compile this
function is the second or third largest user of kmaps in the kernel.
The fix is pretty simple: just hang onto the previous kmap as we we go
around the loop. It reduces the number of kmappings from copy_strings
by a factor of 30.
Andrew Morton [Sat, 10 Aug 2002 09:44:34 +0000 (02:44 -0700)]
[PATCH] 3c905B fix
Patch from Zwane which fixes a transceiver problem on his 3c905B.
Apparently the 905B's MII status register is saying that it doesn't
need preamble, but the datasheet says that it does. So add a 905B
override for that in the device table.
This could break other 3c905B's. I don't know. There's only one way
to find out.
Russell King [Sat, 10 Aug 2002 09:44:30 +0000 (02:44 -0700)]
[PATCH] build warning fix
This patch has been verified to apply cleanly to 2.5.30
This patch fixes a build warning in smp.h. register_cpu_notifier uses
struct notifier_block in its argument list. Unfortunately, there are
places where smp.h is included before the definition of this structure.
Pavel Machek [Sat, 10 Aug 2002 09:44:25 +0000 (02:44 -0700)]
[PATCH] S3 and swsusp: fixing device_resume order
pci driver's resume must not be called during RESUME_POWER_ON because
interrupts are still off and i8259A is not initialized [OHCI kills
machine in such case, cardbus probably too. PCI drivers just assume
initialized interrupts.]
Second hunk fixes device_resume calls to be okay according to
documentation.
Alexander Viro [Sat, 10 Aug 2002 09:22:02 +0000 (02:22 -0700)]
[PATCH] fix check_disk_change() deadlocks
Small, but tricky: fix for check_disk_change() deadlocks.
What we do is
a) opening block device shifted from check_partition() to
grok_partitions(); check_partitions() takes opened
struct block_device.
b) all callers of check_disk_change() fall in two groups -
ones that are called only from some ->open() and ones
that are _never_ called from ->open(). There is no
middle ground. We split the thing in two functions -
check_disk_change() for the first class and full_check_....
for the second. The former (ones inside ->open()) doesn't
touch partition tables but marks the bdev as "had been
invalidated". In the end of do_open() we check if
bdev is marked and call wipe_partitions()/check_partition()
if it is - at that point bdev is fully set up and ready.
c) ->bd_part_sem kludge is gone - we use ->bd_sem instead.
That is, do_open() on a partition grabs ->bd_sem on entire
disk and picks partition data while under it; do_open() on
entire disk rereads partition if needed before dropping
->bd_sem (right before dropping it); BLKRRPART does
trylock on ->bd_sem and then checks ->bd_part_count -
same logics as before, except that we use ->bd_sem instead
of ->bd_part_sem.
That kills recursive open(), gives us the same exclusion rules as
we had and makes sure that actual IO (including rereading partition
tables) is done only when we are ready to do it.
It actually sounds a lot nastier than it is. do_open() is a one sick
puppy right now, but we have everything in one place and _out_ of drivers
(and 20-odd equally sick puppies are gone from them, along with about
the same number of races).
Now we are almost ready to clean it up for good - all that remains to
do before that is to get the rest of drivers (cciss, DAC960, i2o and
a couple of ancients - xd and acsi) using per-disk gendisks. Then
most of that crap will disappear.
BTW, the only generic ioctl remaining in the drivers is HDIO_GETGEO -
a lot of foo_ioctl() starts with if (cmd != HDIO_GETGEO) return -EINVAL; ;-)
Alexander Viro [Sat, 10 Aug 2002 09:21:49 +0000 (02:21 -0700)]
[PATCH] partition table flush/read cleanup
Big One. Flushing/rereading partition tables is taken from
->revalidate() for partitioned devices; now it's done in the
caller (check_disk_change()). BLKRRPART handling also moved
out of drivers - they are still allowed to override it (DAC960
and i2o are the only remaining ones), but common case is handled
in fs/block_dev.c.
Note: we are still only shifting stuff - bd_sem deadlocks in
check_disk_change() are still there. However, now we have all
relevant code outside of drivers and that will allow to fix the
thing (see next patches).
Alexander Viro [Sat, 10 Aug 2002 09:21:45 +0000 (02:21 -0700)]
[PATCH] ide subdrivers attach() cleanup
->attach() for ide subdrivers explicitly calls register_disk()
instead of ata_revalidate() now; revalidate_drives() is gone -
it's not needed anymore (we _know_ that we'll read partition
table as soon as driver claims the drive; no need to mess with
bogus rereading).
Alexander Viro [Sat, 10 Aug 2002 09:21:40 +0000 (02:21 -0700)]
[PATCH] clean up major_name
->major_name for per-disk gendisks set to full name - i.e.
IDE gendisks have "hda", "hdb", etc. instead of "hd".
As the result, we kill a lot of crap in check.c::disk_name().
In particular, now we can afford ->minor_shift set to 0
for ide-cd (disk_name() was the only obstacle)
Alexander Viro [Sat, 10 Aug 2002 09:21:36 +0000 (02:21 -0700)]
[PATCH] make check_disk_change() use struct block_device
check_disk_change() converted to passing struct block_device.
Old variant is still needed for a couple of places; wrapper
is provided (__check_disk_change(kdev)). do_open() logics
with setting ->bd_op sanitized - now we do that before calling
->open().