Greg Ungerer [Sun, 15 Dec 2002 09:00:07 +0000 (01:00 -0800)]
[PATCH] m68knommu definition of TASK_UNMAPPED_BASE
This patch adds a definition for TASK_UNMAPPED_BASE in m68knommu
process.h. Recent changes need a definition for this, although its
value is unsed for nommu targets.
Greg Ungerer [Sun, 15 Dec 2002 08:59:55 +0000 (00:59 -0800)]
[PATCH] m68knommu current include thread_info.h
This changes m68knommu current.h to include the linux/thread_info.h
instead of asm/thread_info.h. This is needed to get the restart_block
definition from linux/thread_info.h first.
Greg Ungerer [Sun, 15 Dec 2002 08:59:50 +0000 (00:59 -0800)]
[PATCH] m68knommu fix ELF_CORE_COPY_REGS macro
This fixes the broken ELF_CORE_COPY_REGS macro for m68knommu arch. It
is missing a ";" after the pr_reg[16] setting, and attempts to set the
non-existant a2 field.
Stelian Pop [Sun, 15 Dec 2002 08:59:25 +0000 (00:59 -0800)]
[PATCH] sonypi driver update
This little patch changes the way button release events are reported
by the sonypi driver to the application: previously, separate
release events were detected for each button. However, many buttons
(example: the jogdial, the capture button, the back button etc) share
the same release event.
The attached patch propagates a single 'ANYBUTTON_RELEASED' event
to the userspace, leaving all state machine intelligence to the
application.
Kunihiko IMAI should be credited for his ideas and tests.
Ben Collins [Sun, 15 Dec 2002 08:27:06 +0000 (00:27 -0800)]
[PATCH] IEEE-1394/Firewire update
This covers a lot of ground in the Linux1394 SVN tree. I haven't had
time to keep in sync with you in a more granular way, so here's a
bohemoth patch. However, consider it well tested.
Trond Myklebust [Sun, 15 Dec 2002 08:11:24 +0000 (00:11 -0800)]
[PATCH] Add helper routines for fixing up page alignment on xdr_buf
In order to speed up NFS reads, we attempt to copy directly from
skbuffs into the pagecache pages. As we cannot do XDR decoding in the
soft interrupts, we attempt to estimate the size of the RPC header (+
attributes,...) that will precede the actual data that goes in the
pagecache. If we get the estimate wrong, the XDR decode routines
perform a realignment of the data into the pagecache.
In the existing code, we do a multi-page kmap() from the xdr_buf into
an iovec array, in order to do the shift.
The following patch adds tools for doing the realigment without going
through the iovec array (and without having to do the deadlock-prone
multi-page kmap()).
It also adds the 2 helper routines xdr_read_pages()/xdr_write_pages()
which will be needed for NFSv4 reads/writes in order to add pre/post
operation GETATTR calls.
Trond Myklebust [Sun, 15 Dec 2002 08:11:18 +0000 (00:11 -0800)]
[PATCH] NFSv4 cleanups
- Move the encoding/decoding of the actual COMPOUND XDR header out of
encode_compound()/decode_compound().
- Make each NFSv4 operation 'decode_' routine also take care of
decoding its own header, and checking it for correctness.
Also allows us to get rid of the 'nfserr' parameter...
Trond Myklebust [Sun, 15 Dec 2002 08:11:12 +0000 (00:11 -0800)]
[PATCH] Fix buffer reservations in nfs4xdr.c
This fixes a couple of incorrect XDR buffer reservations. The values
passed to RESERVE_SPACE() must reflect precisely the number of bytes
that we wish to send down the wire.
Ingo Molnar [Sun, 15 Dec 2002 07:48:05 +0000 (23:48 -0800)]
[PATCH] ptrace-sigfix-2.5.51-A1
This fixes a threading/ptrace bug noticed by the gdb people: when a
thread is ptraced but other threads in the thread group are not then a
SIGTRAP (via int3 or any of the other debug traps) causes the child
thread(s) to die unexpectedly. This is because the default behavior for
a no-handler SIGTRAP is to broadcast it.
The solution is to make all such signals specific, then the ptracer (gdb)
can filter the signal and upon continuation it's being handled properly
(or put on the shared signal queue). SIGKILL and SIGSTOP are an exception.
The patch only affects threaded and ptrace-d processes.
Rusty Russell [Sun, 15 Dec 2002 04:13:23 +0000 (20:13 -0800)]
[PATCH] MODULE_PARM support for older modules
This is the backwards compatibility code for MODULE_PARM, and moves
__MODULE_STRING() down to the graveyard at the bottom of module.h.
It's complicated by the fact that many modules place MODULE_PARM()
before the declaration (some do MODULE_PARM() for non-existant
variables, too). To avoid breaking them, we have to do the name
lookups at load time, rather than just storing a pointer 8(
CONFIG_OBSOLETE_MODPARM is set to y without prompting: it's a useful
marker for deprecating in 2.7.
Rusty Russell [Sun, 15 Dec 2002 04:13:11 +0000 (20:13 -0800)]
[PATCH] Module Parameter Core Patch
This patch is a rewrite of the insmod and boot parameter handling,
to unify them.
The new format is fairly simple: built on top of __module_param_call there
are several helpers, eg "module_param(foo, int, 000)". The final argument
is the permissions bits, for exposing parameters in sysfs (if
non-zero) at a later stage.
Warning fixes: remove an unused variable and make bitops complain if the
pointer isn't of type long. Make 31 bit BUG() emit 4 0-bytes instead of 2.
This improves the readability of the listing.
Makefile changes by Sam Ravnborg. Summary of changes:
o Added FORCE prerequisite in boot/Makefile
o Do not use shorthand targets when calling the boot/Makefile
o No longer use BOOT_IMAGE, not needed now
o Use kbuild clean infrastructure when cleaning up in boot
o Offset generation shrinked with one rule
o removed inclusion of Rules.make in all Makefiles
o no longer use the descend macro, use $(Q)$(MAKE) as replacement
This patch moves some basic per-CPU static information (minimum frequency,
maximum frequency and maximum transition latency) into a struct
cpufreq_cpuinfo. This offers a much cleaner struct cpufreq_driver and
struct cpufreq_policy.
sr_ioctl.c uses virt_to_phys, which is defined in asm/io.h.
On x86, this accidentally works, due to other indirect includes,
but on Alpha results in a link error.
Ingo Molnar [Sun, 15 Dec 2002 03:44:20 +0000 (19:44 -0800)]
[PATCH] threaded coredumps, tcore-fixes-2.5.51-A0
This fixes one more threaded-coredumps detail reported by the glibc
people: all threads taken down by the coredump code should report the
proper exit code. We can do this rather easily via the group_exit
mechanism. 'Other' threads used to report SIGKILL, which was highly
confusing as the shell often displayed the 'Killed' message instead of a
'Segmentation fault' message.
Another missing bit was the 0x80 bit set in the exit status for all
threads, if the coredump was successful. (it's safe to set this bit in
->sig->group_exit_code in an unlocked way because all threads are
artificially descheduled by the coredump code.)
Brian Gerst [Sun, 15 Dec 2002 03:41:56 +0000 (19:41 -0800)]
[PATCH] Remove Rules.make from Makefiles (3/3)
Makefiles no longer need to include Rules.make, which is currently an
empty file. This patch removes it from the remaining Makefiles, and
removes the empty Rules.make file.
Kai Mäkisara [Sat, 14 Dec 2002 12:46:29 +0000 (04:46 -0800)]
[PATCH] SCSI tape driver fixes for 2.5.51
This contains the following changes for the SCSI tape driver in 2.5.51:
- fix module bugs that prevent finding any devices
- allow opening a device with O_NONBLOCK | O_RDWR even if the tape in drive
is write protected
Andrew Morton [Sat, 14 Dec 2002 11:19:27 +0000 (03:19 -0800)]
[PATCH] ext2 synchronous mount fix
The optimisation for synchronous mounts was only correct for S_ISREG
files. Directories do not pass through generic_osync_inode() and we
still need to synchronously write out their indirect blocks.
Andrew Morton [Sat, 14 Dec 2002 11:19:11 +0000 (03:19 -0800)]
[PATCH] tidier atomic check in mempool_alloc()
From Hugh.
Be more explicit in the "can we sleep" test. It doesn't change
anything unless someone is performing __GFP_IO && !__GFP_WAIT
allocations, which is nonsensical.
Andrew Morton [Sat, 14 Dec 2002 11:19:05 +0000 (03:19 -0800)]
[PATCH] provide a default super_block_operations
A little cleanup suggested by Chris Mason or Al Viro.
Quite a number of codepaths are testing whether a superblock has a
non-null ->s_op pointer. We can remove all those by making sure that
all superblocks have a valid ->s_op.
Andrew Morton [Sat, 14 Dec 2002 11:18:58 +0000 (03:18 -0800)]
[PATCH] madvise_willneed() maximum readahead checking
madvise_willneed() currently has a very strange check on how much readahead
it is prepared to do.
It is based on the user's rss limit. But this is usually enormous, and
the user isn't necessarily going to map all that memory at the same time
anyway.
And the logic is wrong - it is comparing rss (which is in bytes) with
`end - start', which is in pages.
And it returns -EIO on error, which is not mentioned in the Open Group
spec and doesn't make sense.
This patch takes it all out and applies the same upper limit as is used in
sys_readahead() - half the inactive list.
Andrew Morton [Sat, 14 Dec 2002 11:18:52 +0000 (03:18 -0800)]
[PATCH] remove a vm debug check
This ad-hoc assertion is no longer true. If all zones are in the `all
unreclaimable' state it can trigger. When testing with a tiny amount
of physical memory.
Andrew Morton [Sat, 14 Dec 2002 11:18:36 +0000 (03:18 -0800)]
[PATCH] ext2/ext3_free_blocks() extra check
From Andreas Dilger.
Additional sanity checks in the ext2 and ext3 block allocators: if
someone tries to free a negative number of blocks, detect and handle
that rather than wrecking the fs.
Andrew Morton [Sat, 14 Dec 2002 11:18:30 +0000 (03:18 -0800)]
[PATCH] bootmem allocator merging fix
Patch from "Juan M. de la Torre" <jmtorre@gmx.net>
If the requested align is PAGE_SIZE, it is impossible to merge with the
previous allocation request, because the allocated area must begin in a
page boundary.
Andrew Morton [Sat, 14 Dec 2002 11:18:17 +0000 (03:18 -0800)]
[PATCH] remove PF_SYNC
current->flags:PF_SYNC was a hack I added because I didn't want to
change all ->writepage implementations.
It's foul. And it means that if someone happens to run direct page
reclaim within the context of (say) sys_sync, the writepage invokations
from the VM will be treated as "data integrity" operations, not "memory
cleansing" operations, which would cause latency.
So the patch removes PF_SYNC and adds an extra arg to a_ops->writepage.
It is the `writeback_control' structure which contains the full context
information about why writepage was called.
The initial version of this patch just passed in a bare `int sync', but
the XFS team need more info so they can perform writearound from within
page reclaim.
The patch also adds writeback_control.for_reclaim, so writepage
implementations can inspect that to work out the call context rather
than peeking at current->flags:PF_MEMALLOC.
Andrew Morton [Sat, 14 Dec 2002 11:18:11 +0000 (03:18 -0800)]
[PATCH] Reserve an additional transaction block in
Under rare conditions (filesystem corruption, really) it is possible
for ext3_dirty_inode() to require _two_ blocks for the transaction: one
for the inode and one to update the superblock - to set
EXT3_FEATURE_RO_COMPAT_LARGE_FILE. This causes the filesystem to go
BUG.
So reserve an additional block for that eventuality.
Andrew Morton [Sat, 14 Dec 2002 11:17:58 +0000 (03:17 -0800)]
[PATCH] Add /proc/sys/vm/lower_zone_protection
This allows us to control the aggressiveness of the lower-zone defense
algorithm. The `incremental min'. For workloads which are using a
serious amount of mlocked memory, a few megabytes is not enough.
So the `lower_zone_protection' tunable allows the administrator to
increase the amount of protection which lower zones receive against
allocations which _could_ use higher zones.
The default value of lower_zone_protection is zero, giving unchanged
behaviour. We should not normally make large amounts of memory
unavailable for pagecache just in case someone mlocks many hundreds of
megabytes.
Andrew Morton [Sat, 14 Dec 2002 11:17:52 +0000 (03:17 -0800)]
[PATCH] fs-writeback rework.
I've revisited all the superblock->inode->page writeback paths. There
were several silly things in there, and things were not as clear as they
could be.
scenario 1: create and dirty a MAP_SHARED segment over a sparse file,
then exit.
All the memory turns into dirty pagecache, but the kupdate function
only writes it out at a trickle - 4 megabytes every thirty seconds.
We should sync it all within 30 seconds.
What's happening is that when writeback tries to write those pages,
the filesystem needs to instantiate new blocks for them (they're over
holes). The filesystem runs mark_inode_dirty() within the writeback
function.
This redirtying of the inode while we're writing it out triggers
some livelock avoidance code in __sync_single_inode(). That function
says "ah, someone redirtied the file while I was writing it. Let's
move the file to the new end of the superblock dirty list and write
it out later." Problem is, writeback dirtied the inode itself.
(It is rather silly that mark_inode_dirty() sets I_DIRTY_PAGES when
clearly no pages have been dirtied. Fixing that up would be a
largish work, so work around it here).
So this patch just removes the livelock avoidance from
__sync_single_inode(). It is no longer needed anyway - writeback
livelock is now avoided (in all writeback paths) by writing a finite
number of pages.
scenario 2: an application is continuously dirtying a 200 megabyte
file, and your disk has a bandwidth of less than 40 megabytes/sec.
What happens is that once 30 seconds passes, pdflush starts writing
out the file. And because that writeout will take more than five
seconds (a `kupdate' interval), pdflush just keeps writing it out
forever - continuous I/O.
What we _want_ to happen is that the 200 megabytes gets written,
and then IO stops for thirty seconds (minus the writeout period). So
the file is fully synced every thirty seconds.
The patch solves this by using mapping->io_pages more intelligently.
When the time comes to write the file out, move all the dirty pages
onto io_pages. That is a "batch of pages for this kupdate round".
When io_pages is empty, we know we're done.
The address_space_operations.writepages() API is changed! It now only
needs to write the pages which the caller placed on mapping->io_pages.
This conceptually cleans things up a bit, by more clearly defining the
role of ->io_pages, and the motion between the various mapping lists.
The treatment of sb->s_dirty and sb->s_io is now conceptually identical
to mapping->dirty_pages and mapping->io_pages: move the items-to-be
written onto ->s_io/io_pages, alk walk that list. As inodes (or pages)
are written, move them over to the clean/locked/dirty lists.
Oh, scenario 3: start an app whcih continuously overwrites a 5 meg
file. Wait five seconds, start another, wait 5 seconds, start another.
What we _should_ see is three 5-meg writes, five seconds apart, every
thirty seconds. That did all sorts of odd things. It now does the
right thing.
Andrew Morton [Sat, 14 Dec 2002 11:17:31 +0000 (03:17 -0800)]
[PATCH] implement ext3_sync_fs
ext3_sync_fs will start a commit and will wait on that commit. This
means that on its return, all journalled file data has been dirtied and
exposed to sync_inodes_sb(). Which is sufficient to fix the umount
data loss problem.
Andrew Morton [Sat, 14 Dec 2002 11:17:26 +0000 (03:17 -0800)]
[PATCH] Add a sync_fs super_block operation
This is infrastructure for fixing the journalled-data ext3 unmount data
loss problem. It was sent for comment to linux-fsdevel a week ago; there
was none.
Add a `sync_fs' superblock operation whose mandate is to perform
filesystem-specific operations to ensure a successful sync.
It is called in two places:
1: fsync_super() - for umount.
2: sys_sync() - for global sync.
In the sys_sync() case we call all the ->write_super() methods first.
write_super() is an async flushing operation. It should not block.
After that, we call all the ->sync_fs functions. This is independent
of the state of s_dirt! That was all confused up before, and in this
patch ->write_super() and ->sync_fs() are quite separate.
With ext3 as an example, the initial ->write_super() will start a
transaction, but will not wait on it. (But only if s_dirt was set!)
The first ->sync_fs() call will get the IO underway.
The second ->sync_fs() call will wait on the IO.
And we really do need to be this elaborate, because all the testing of
s_dirt in there makes ->write_super() an unreliable way of detecting
when the VFS is trying to sync the filesystem.
Andrew Morton [Sat, 14 Dec 2002 11:17:21 +0000 (03:17 -0800)]
[PATCH] handle overflows in radix_tree_gang_lookup()
Fix a radix-tree bug spotted by Vladimir Saveliev <vs@namesys.com>.
Each step in the radix tree spans six address bits. So a height=6 tree
spans 36-bits worth of nodes.
On 32-bit machines radix_tree_gang_lookup() doesn't handle this right -
at the 12TB mark it wraps back to zero, and returns pages at quite
wrong indices.
The patch fixes all that up, and tidies a couple of things.
A user-space test harness was developed so that the code can be sanely
tested. It is at
Andrew Morton [Sat, 14 Dec 2002 11:17:15 +0000 (03:17 -0800)]
[PATCH] make sure all PMDs are allocated under PAE mode
Patch from Martin Bligh and Dave Hansen
If a PAE machine has 1G of memory and you set PAGE_OFFSET to 2G, the
kernel will only instantiate a PMD to cover the 2G-3G region. But
another PMD is needed for the 3G-4G region for the APIC and possibly an
extended vmalloc region.
So the patch changes the code to instantiate PMDs out to the end of
physical memory.
It's a no-op for PAGE_OFFSET=3G, and _could_ be part of the
CONFIG_PAGE_OFFSET patch. But it seems a reasonable generalisation
anyway.