Andrew Morton [Sat, 22 May 2004 15:00:54 +0000 (08:00 -0700)]
[PATCH] rmap 7 object-based rmap
From: Hugh Dickins <hugh@veritas.com>
Dave McCracken's object-based reverse mapping scheme for file pages: why
build up and tear down chains of pte pointers for file pages, when
page->mapping has i_mmap and i_mmap_shared lists of all the vmas which
might contain that page, and it appears at one deterministic position
within the vma (unless vma is nonlinear - see next patch)?
Has some drawbacks: more work to locate the ptes from page_referenced and
try_to_unmap, especially if the i_mmap lists contain a lot of vmas covering
different ranges; has to down_trylock the i_shared_sem, and hope that
doesn't fail too often. But attractive in that it uses less lowmem, and
shifts the rmap burden away from the hot paths, to swapout.
Hybrid scheme for the moment: carry on with pte_chains for anonymous pages,
that's unchanged; but file pages keep mapcount in the pte union of struct
page, where anonymous pages keep chain pointer or direct pte address: so
page_mapped(page) works on both.
Hugh massaged it a little: distinct page_add_file_rmap entry point; list
searches check rss so as not to waste time on mms fully swapped out; check
mapcount to terminate once all ptes have been found; and a WARN_ON if
page_referenced should have but couldn't find all the ptes.
Andrew Morton [Sat, 22 May 2004 15:00:42 +0000 (08:00 -0700)]
[PATCH] __set_page_dirty_nobuffers race fix
Running __mark_inode_dirty() against a swapcache page is illegal and will
oops.
I see a race in set_page_dirty() wherein it can be called with a PageSwapCache
page, but if the page is removed from swapcache after
__set_page_dirty_nobuffers() drops tree_lock(), we have the situation where
PageSwapCache() is false, but local variable `mapping' points at swapcache.
Handle that by checking for non-null mapping->host. We don't care about the
page state at this point - we're only interested in the inode.
There is a converse case: what if a page is added to swapcache as we are
running set_page_dirty() against it?
In this case the page gets its PG_dirty flag set but it is not tagged as dirty
in the swapper_space radix tree. The swap writeout code will handle this OK
and test_clear_page_dirty()'s call to
radix_tree_tag_clear(PAGECACHE_TAG_DIRTY) will silently have no effect. The
only downside is that future radix-tree-based writearound won't notice that
such pages are dirty and swap IO scheduling will be a teensy bit worse.
The patch also fixes the (silly) testing of local variable `mapping' to see if
the page was truncated. We should test page_mapping() for that.
Andrew Morton [Sat, 22 May 2004 15:00:31 +0000 (08:00 -0700)]
[PATCH] Make sync_page use swapper_space again
Revert recent changes to sync_page(). Now that page_mapping() returns
&swapper_space for swapcache pages we don't need to test for PageSwapCache in
sync_page().
Andrew Morton [Sat, 22 May 2004 15:00:08 +0000 (08:00 -0700)]
[PATCH] revert recent swapcache handling changes
Go back to the 2.6.5 concepts, with rmap additions. In particular:
- Implement Andrea's flavour of page_mapping(). This function opaquely does
the right thing for pagecache pages, anon pages and for swapcache pages.
The critical thing here is that page_mapping() returns &swapper_space for
swapcache pages without actually requiring the storage at page->mapping.
This frees page->mapping for the anonmm/anonvma metadata.
- Andrea and Hugh placed the pagecache index of swapcache pages into
page->private rather than page->index. So add new page_index() function
which hides this.
- Make swapper_space.set_page_dirty() again point at
__set_page_dirty_buffers(). If we don't do that, a bare set_page_dirty()
will fall through to __set_page_dirty_buffers(), which is silly.
This way, __set_page_dirty_buffers() can continue to use page->mapping.
It should never go near anon or swapcache pages.
- Give swapper_space a ->set_page_dirty address_space_operation method, so
that set_page_dirty() will not fall through to __set_page_dirty_buffers()
for swapcache pages. That function is not set up to handle them.
The main effect of these changes is that swapcache pages are treated more
similarly to pagecache pages. And we are again tagging swapcache pages as
dirty in their radix tree, which is a requirement if we later wish to
implement swapcache writearound based on tagged radix-tree walks.
Andrew Morton [Sat, 22 May 2004 14:59:45 +0000 (07:59 -0700)]
[PATCH] Make swapper_space tree_lock irq-safe
->tree_lock is supposed to be IRQ-safe. Hugh worked out that with his
changes, we never actually take it from interrupt context, so spin_lock() is
sufficient.
Apart from kinda freaking me out, the analysis which led to this decision
becomes untrue with later patches. So make it irq-safe.
Forwarding table paranoia:
* Solve some potential problems if a device changes address and one or
more device has the same address.
* Warn if new device added to a bridge matches a entry that has shown
up on the network.
* Also don't put static entries in the timer list, they don't time
out so shouldn't be there.
Replacement 64 bit compatibility code for the new ioctl's. The new
ioctl's all pass through clean, but for the old style ioctl's it uses
the mis-feature of the earlier bridge-utils that they check the API version.
So if an old 32bit version of brctl is run on a 64bit platform it will
report
bridge utilities not compatible with kernel version
Tested on Itanium 1; but should solve issue for sparc, ppc, and x86_64
[BRIDGE]: New ioctl interface for 32/64 compatability.
Add four new ioctl's for the operations that can't be done through sysfs.
The existing bridge ioctl's are multiplexed, and most go through SIOCDEVPRIVATE
so they won't work in a mixed 32/64bit environment.
The new release of bridge-utils will use these if possible, and fall
back to the old interface.
Change how the read of forwarding table works. Instead of copying
entries to user one at a time, use an intermediate kernel buffer and
do up to a page at a chunk.
This gets rid of some awkward code dealing with entries getting deleted
during the copy. And allows same function to be used by later sysfs
hook.
Merge the ioctl stub calls that just end up calling the sub-function
to do the actual ioctl. Move br_get_XXX_ifindices into the ioctl file
as well where they can be static.
Relax the locking on add/delete interfaces to a bridge. Since these operations
are already called with RTNL semaphore, only need to hold the bridge lock while
doing operations related to STP and processing path. This is necessary for later
sysfs support where those operations might sleep.
Minor cleanup (lead in to later sysfs support).
Change new_nb to new_bridge_dev and return the net_device rather than
bridge because that is what the caller wants anyway.
[BRIDGE]: Handle delete of multiple devices with same address.
This fixes the issue discovered when removing bluetooth devices from a bridge.
Need to add special case code when forwarding table is being cleaned up to
handle the case where several devices share the same hardware address.
This driver was partially merged in 2.5.32 and never compiled in 2.5/2.6.
It was fixed in linux-mips CVS but has been broken again about 5 months ago.
Just remove it for now (it is in wrong directory anyway).
Adrian Bunk [Sat, 22 May 2004 03:52:32 +0000 (20:52 -0700)]
[PATCH] more comx removal
The patch below removes the MAINTAINERS entry for the removed comx
driver.
Additionally, the following comx header files could be removed:
drivers/net/wan/mixcom.h
drivers/net/wan/hscx.h
drivers/net/wan/munich32x.h
drivers/net/wan/falc-lh.h
I've double-checked that none of them are used by any other driver.
Andrew Morton [Sat, 22 May 2004 03:39:01 +0000 (20:39 -0700)]
[PATCH] swsusp: fix devfs breakage introduced in 2.6.6
From: Pavel Machek <pavel@ucw.cz>
This fixes bad interaction between devfs and swsusp.
Check whether the swap device is the specified resume device, irrespective of
whether they are specified by identical names.
(Thus, device inode aliasing is allowed. You can say /dev/hda4 instead of
/dev/ide/host0/bus0/target0/lun0/part4 [if using devfs] and they'll be
considered the same device. This is *necessary* for devfs, since the resume
code can only recognize the form /dev/hda4, but the suspend code would like
the long name [as shown in 'cat /proc/mounts'].)
Andrew Morton [Sat, 22 May 2004 03:38:40 +0000 (20:38 -0700)]
[PATCH] blk: clear completion stack pointer on return
From: Jens Axboe <axboe@suse.de>
It doesn't always look safe to let ->waiting remain set when returning from
functions that set it to point to stack area, since various locations check
for != NULL to see if it's valid. So clear it on return from
ide_do_drive_cmd() and blk_execute_rq().
Andrew Morton [Sat, 22 May 2004 03:38:29 +0000 (20:38 -0700)]
[PATCH] Sanitise handling of unneeded syscall stubs
From: David Mosberger <davidm@napali.hpl.hp.com>
Below is a patch that tries to sanitize the dropping of unneeded system-call
stubs in generic code. In some instances, it would be possible to move the
optional system-call stubs into a library routine which would avoid the need
for #ifdefs, but in many cases, doing so would require making several
functions global (and possibly exporting additional data-structures in
header-files). Furthermore, it would inhibit (automatic) inlining in the
cases in the cases where the stubs are needed. For these reasons, the patch
keeps the #ifdef-approach.
This has been tested on ia64 and there were no objections from the
arch-maintainers (and one positive response). The patch should be safe but
arch-maintainers may want to take a second look to see if some __ARCH_WANT_foo
macros should be removed for their architecture (I'm quite sure that's the
case, but I wanted to play it safe and only preserved the status-quo in that
regard).
Andrew Morton [Sat, 22 May 2004 03:37:52 +0000 (20:37 -0700)]
[PATCH] fbdev: mode switching fix.
From: James Simmons <jsimmons@infradead.org>
This fixes the bugs that where in mode switch via stty.
The problem was we couldn't set the mode just by using the x and y
resolution. We use modedb to fill in the rest. There also was a bug that
allowed you to change the console resolution for drivers with fixed
resolutions. This would mess up your display. Now that is fixed.
Andrew Morton [Sat, 22 May 2004 03:37:41 +0000 (20:37 -0700)]
[PATCH] fix sendfile on 64bit architectures
From: Andi Kleen <ak@suse.de>
sys_sendfile has a hardcoded 2GB limit. 64bit architectures should
probably always use sys_sendfile64() in their native system tables, because
for them sizeof(off_t) == sizeof(loff_t). This patch does this. It seemed
easier to just change the 64bit entry tables instead of fixing up all the
emulation layers to do 2GB checks on their own.
I changed all 64bit architectures except for parisc64, which seemed to
already have a sendfile64.
Tony Lindgren [Fri, 21 May 2004 23:59:48 +0000 (00:59 +0100)]
[ARM PATCH] 1887/1: Update OMAP low level debug functions again
Patch from Tony Lindgren
This patch makes the low level debug functions work when support is
compiled in for multiple OMAPs. The patch also removes now unnecessary
include, incorrect comment, and SERIAL_REG_SHIFT ifdefs.
Tony Lindgren [Fri, 21 May 2004 23:55:08 +0000 (00:55 +0100)]
[ARM PATCH] 1885/1: OMAP update 2/2: include files
Patch from Tony Lindgren
This patch syncs the mainline kernel with the linux-omap tree.
The highlights of the patch are:
- Changed the BOOT_MEM() to use the new IO address (Tony Lindgren)
- Cleaned up interrupt handler (Juha Yrjölä)
- DMA channel linking for 1610 (Samuel Ortiz)
- GPIO fixes (Juha Yrjölä)
- IRQ fix for OMAP-730 (Kevin Hilman)
- OMAP-1510 FPGA interrupt fix (Dirk Behme)
- OMAP-1610 voltage change settings (Todd Poynor)
- Uncompress kernel serial output fixes (Tony Lindgren)
Tony Lindgren [Fri, 21 May 2004 23:46:09 +0000 (00:46 +0100)]
[ARM PATCH] 1884/1: OMAP update 1/2: arch files
Patch from Tony Lindgren
This patch syncs the mainline kernel with the linux-omap tree.
The highlights of the patch are:
- Changed the BOOT_MEM() to use the new IO address (Tony Lindgren)
- Cleaned up interrupt handler (Juha Yrjölä)
- DMA channel linking for 1610 (Samuel Ortiz)
- GPIO fixes (Juha Yrjölä)
- IRQ fix for OMAP-730 (Kevin Hilman)
- OMAP-1510 FPGA interrupt fix (Dirk Behme)
- OMAP-1610 voltage change settings (Todd Poynor)
- Uncompress kernel serial output fixes (Tony Lindgren)
Nicolas Pitre [Fri, 21 May 2004 10:47:55 +0000 (11:47 +0100)]
[ARM PATCH] 1889/1: don't select CONFIG_IWMMXT just yet with Mainstone
Patch from Nicolas Pitre
Since the iWMMXt patch (#1866/1) requires more time to be reviewed,
this patch will allow merging Mainstone patches without breaking
anything if iWMMXt support isn't merged yet.
Should be applied after patch #1867/1.
Andrew Morton [Fri, 21 May 2004 07:46:17 +0000 (00:46 -0700)]
[PATCH] block device layer: separate backing_dev_info infrastructure
Sigh. ramdisk almost works, except it loses data on umount.
This is because the files which are atop the ramdisk do not contribute to
dirty memory accounting, but they do need writeback. So when sync() calls
sync_inodes_sb() to do the work, sync_inodes_sb() hopelessly underestimates
the number of pages which need writeback for a complete sync.
If you run `sync' enough times, everything eventually hits "disk" and all is
happy.
The root cause here is that the ramdisk and the files which it hosts shared
the same backing_dev_info. This is inappropriate because the hosted files
*do* want to writeback and really should contribute to dirty memory
accounting. But the ramdisk inode itself wants neither.
So. The patch sets up the infrastructure which permits a blockdev to provide
a separate backing_dev_info for the files which it hosts. It's a bit of a
ramdisk-special.
Linus Torvalds [Fri, 21 May 2004 07:29:23 +0000 (00:29 -0700)]
Add 'mode' argument to vfs_symlink.
Right now we ignore it, but we need to pass this down
to the low-level filesystems if we want to ever make
knfsd create symlinks with different permissions correctly.
Andrew Morton [Fri, 21 May 2004 06:23:55 +0000 (23:23 -0700)]
[PATCH] drop left-over #ifndef __ia64__
From: David Mosberger <davidm@napali.hpl.hp.com>
It used to be that loops_per_jiffy was a macro on ia64, hence it couldn't be
exported. That's no longer the case though, so there is no point in
inhibiting its export (not that it makes any _sense_ to export that value on
ia64).
Andrew Morton [Fri, 21 May 2004 06:23:44 +0000 (23:23 -0700)]
[PATCH] Fix i386/x86_64 cpuid/msr BUG() on impossible CPUs
From: Rusty Russell <rusty@rustcorp.com.au>
Matthieu Castet <castet.matthieu@free.fr> pointed out that testing
cpu_online(cpu) on a UP system goes BUG().
That's because you're never supposed to ask cpu_online() about a CPU which
is >= NR_CPUS. msr and cpuid devices use the minor to indicate the CPU
number. Oops.
Fix is to explicitly test cpu < NR_CPUS. Using cpu_online() is OK;
although the CPU might go down before you actually read the file, that will
simply cause junk to be returned.
Andrew Morton [Fri, 21 May 2004 06:22:29 +0000 (23:22 -0700)]
[PATCH] trivial: Make JFFS2 ready for Linux 2.7
From: Rusty Russell <rusty@rustcorp.com.au>
(OK from maintainer David Woodhouse <dwmw2@infradead.org>)
From: Sam Ravnborg <sam@ravnborg.org>
From: <l.s.r@web.de>
> since the code for Linux 2.4 compatibility in fs/jffs2 is gone, we can
> clean up the Makefile a bit. Following patch makes the Makefile
> compatible with Linux 2.7 instead . :) Please consider applying.
If we are going to clean up this I prefer we get rid of the
local variables.
See attached patch.
Pure cosmetic. Largest biovec slab is printed as biovec-BIO_MAX_PAGES in
/proc/slabinfo. It would be more informative to print actual number instead
of macro's name.
Andrew Morton [Fri, 21 May 2004 06:20:48 +0000 (23:20 -0700)]
[PATCH] Fix NFSD oops in readdir
From: Neil Brown <neilb@cse.unsw.edu.au>
If a single readdir entry needs to be split over two pages in the reply, we
first encode it into a new page, and then copy the bits into place. When
we do this relocation, we have to modify the "offset" pointer to be either
in the first or the second page, as appropriate.
If the pointer should be at the start of the second page, it is currently
put past the end of the first page.
Note that as the offset and whole response is known to be 4byte-aligned,
the offset pointer will never be split over two pages.
Andrew Morton [Fri, 21 May 2004 06:20:26 +0000 (23:20 -0700)]
[PATCH] getblk() BUG removal
We keep on getting BUG()s from isofs_read_super() because it passes an insane
blocksize to bread(). See http://bugme.osdl.org/show_bug.cgi?id=2735 for
example.
I don't know what's up with isofs, but going BUG in there seems a bit rude.
Change it to drop a bunch of diagnostics and a backtrace then return a null
bh*.
Most callers of getblk() don't expect it to fail, so they'll oops anyway. But
isofs does actually check for a NULL return. This way, the machine stays up
and we get better debug diagnostics.
Andrew Morton [Fri, 21 May 2004 06:20:14 +0000 (23:20 -0700)]
[PATCH] Debugging option to put data symbols in kallsyms
From: Rusty Russell <rusty@rustcorp.com.au>
kallsyms contains only function names, but some debuggers (eg. xmon on
PPC/PPC64) use it to lookup symbols: it'd be much nicer if it included data
symbols too.
Andrew Morton [Fri, 21 May 2004 06:19:40 +0000 (23:19 -0700)]
[PATCH] ramdisk: fix PageUptodate() handling
When a filesystem does getblk() to get a buffer_head against the ramdisk the
VFS will allocate a new not-uptodate pagecache page and will attach buffers to
it.
The filesystem will then bring certain buffer_heads uptodate. But not the
whole page.
Later, various ramdisk a_ops see the not-uptodate page and wipe the whole
thing out, including the parts to which the filesystem wrote!
Fix that up by only zapping those parts of the page which are covered by
non-uptodate buffers.