Greg Ungerer [Tue, 11 Mar 2003 01:45:59 +0000 (17:45 -0800)]
[PATCH] fix spelling in m68knommu Kconfig help
This patch fixes a couple of spelling errors in the m68knommy Kconfig
help entries. Also makes CONFIG_HIGHPROFILE dependant on CONFIG_COLDFIRE,
since that feature is only implemented on ColdFIre based platforms.
Stephen Rothwell [Tue, 11 Mar 2003 01:34:01 +0000 (17:34 -0800)]
[PATCH] compat_sys_fcntl{,64} Generic part
This patch creates compat_sys_fcntl{,64}. The diffstat for the whole
patch set is below, but this is just the generic part, the architecture
specific parts will follow.
This patch also removes struct flock64 from all the 64 bit architectures
(except parisc).
Andrew Morton [Mon, 10 Mar 2003 15:42:47 +0000 (07:42 -0800)]
[PATCH] ext2: fix directory handling bug
Patch from Dave Miller. Fixes a very long-standing bug.
If a process has an fd open against a now-removed directory, lookups on that
fd will end up calling ext2_find_entry() against a zero-length directory.
When this happens ext2_find_entry() will, on the first pass through the loop,
set `kaddr' to page_address(page) - 20. Things get confused and the "zero
length directory entry" warning triggers.
This only happens on 64-bit machines, because ext2_last_byte() is returning
an unsigned (32-bit) value, and the arithmetic works out OK for 32-bit
machines.
So we change ext2_find_entry() to bale out immediately if the directory is
zero-length. All other directory-walking functions do this, but
ext2_find_entry() forgot to, due to the search-from-the-last-place
optimisation.
Andrew Morton [Mon, 10 Mar 2003 15:42:39 +0000 (07:42 -0800)]
[PATCH] ext3: error handling robustness
Fix a couple of ext3 error handling routines to not assume that the
superblock has valid journal and buffer_head pointers. These functions are
called during mount and unmount and that may not be true.
This should fix the oops which Zwane saw when mounting a corrupt filesystem.
Andrew Morton [Mon, 10 Mar 2003 15:42:31 +0000 (07:42 -0800)]
[PATCH] Force cache alignment of task_structs
I enabled the advanced use-after-free detector for large slab objects and the
kernel oopsed. This is because that debug code adds things at the head of
the slab objects, and the kernel will die if task_structs are not
well-aligned.
The way to tell the slab allocator that it is not allowed to misalign objects
from this slab is SLAB_MUST_HWCACHE_ALIGN.
Andrew Morton [Mon, 10 Mar 2003 15:42:09 +0000 (07:42 -0800)]
[PATCH] NCPFS memleak fix
Patch from Petr Vandrovec <vandrove@vc.cvut.cz>
Reported by Oleg Drokin.
In NCP_IOC_SETOBJECTNAME handler, we allocated space (newname pointer),
copy stuff from userspace to there and then assign userspace
pointer to our internal structure, whoops!
Andrew Morton [Mon, 10 Mar 2003 15:41:53 +0000 (07:41 -0800)]
[PATCH] fix console ordering default
The conversion of the console registration to an initcall-style thing has
broken lots of people's setups. It is now dependent upon linkage order and
if you have both CONFIG_VT_CONSOLE and CONFIG_SERIAL_CONSOLE, no boot
messages come out on the screen because the kernel is selecting the serial
console first.
It can be fixed by specifying console=tty0, but nobody is doing that.
We can fix it up by placing drivers/char/ in front of drivers/serial/ in
linkage order.
Andi Kleen [Mon, 10 Mar 2003 09:41:56 +0000 (01:41 -0800)]
[PATCH] x86-64 updates for 2.5.64-bk3
Make x86-64 boot again after the INITIAL_JIFFIES changes
and some bug fixes. Also some work for NPTL.
- Merge with i386/2.5.64-bk3
- Fix memory leak in copy_thread
- arch_prctl uses GDT for base if possible. Cleanup.
- clone supports bases >32bit for SETTLS etc. %fs hardcoded now.
- new ptrace support for 64bit TLS
- Disable (set|get)_thread_* for 64bit processes.
- Audit arch/x86_64 for jiffies wrap issues.
- Fix initial jiffies problem (that caused hanging kernels)
- FIx a few 32bit emulation bugs (sigaltstack, sigqueue)
- Some cleanup from Pavel
- Should compile again as UP
- Shrink size a bit by not putting exception tables into object files.
- Fix compilation with gcc 3.3 :- force inlining when needed
- Work around 2.5.64-bk3 console init bug.
- Fix some alignments in assembly code
Rationale: devfs_only does nothing but disabling {un,}register_blkdev
and {un,}register_chrdev. {un,}register_blkdev already do nothing but
adding it's name argument to a lookup table for the __bdevname and
/proc/device output so this use is already bogus. The disabling of
the character device per-major arrays can work in practice but is
useless as any driver relying on it can't be used on non-devfs systems.
Andrew Morton [Mon, 10 Mar 2003 09:36:27 +0000 (01:36 -0800)]
[PATCH] revert "noirqbalance still doesn't do anything"
This recent patch caused Nick Piggin's 2xPIII VIA686B chipset machine into an
interrupts-off lockup during IDE probing.
We don't really know why - it might be because an interrupt is delivered to a
secondary which doesn't expect it.
I have a second patch from Zwane which solves the same problem in a different
way, but until that's had some wider testing I suggest we just back off the
original.
Matthew Wilcox [Mon, 10 Mar 2003 09:32:14 +0000 (01:32 -0800)]
[PATCH] neaten fs/locks.c a little
- Fix my email address to one which reaches me ;-)
- Remove timer.h include as we don't use timers.
- Add module.h.
- Sort includes alphabetically.
- Move EXPORT_SYMBOL from ksyms.c to locks.c.
- Simplify locks_conflict().
Linus Torvalds [Mon, 10 Mar 2003 06:41:27 +0000 (22:41 -0800)]
Use a fixed per-cpu SYSENTER_MSR_ESP value by having the sysenter
entry routine load the real ESP0 off that per-cpu stack. Make this
even faster by putting the sysenter stack in the per-CPU TSS, so
that we can use the tss->esp0 value directly (which we have to
update on task switches anyway).
CAREFUL! This needs very subtle code for debug and NMI exceptions,
to make sure we don't run with the sysenter stack in any real kernel
code!
Linus Torvalds [Mon, 10 Mar 2003 02:20:35 +0000 (18:20 -0800)]
Move "used FPU status" into new non-atomic thread_info->status field.
This allows us to avoid having to use atomic updates for the lazy FP
status setting, since we don't have to worry about other CPU's racing
on the fields.
Also, fix x86 FP state after fork() by making sure the FP is unlazied
_before_ we copy the state information. Otherwise, if a process did a
fork() while holding the FP state lazily in the registers, the child
would incorrectly unlazy bogus state.
Adam Belay [Sun, 9 Mar 2003 23:44:44 +0000 (23:44 +0000)]
Aditional Card Service Changes
Fixes many issues that were discovered after testing. Also cleans up the
card service code and fixes the card_drvdata bug in which only one driver
at a time could have driver data.
Linus Torvalds [Sun, 9 Mar 2003 10:49:41 +0000 (02:49 -0800)]
Cache the MSR_IA32_SYSENTER_CS value in the per-CPU TSS (using
the otherwise unused cpl1 entry for SS), so that we can avoid
re-loading it on task switches if it doesn't change.
Andi Kleen [Sun, 9 Mar 2003 02:32:51 +0000 (18:32 -0800)]
[PATCH] Fast path context switch - microoptimize FPU reload
Following some changes on x86-64.
When cpu_has_fxsr is defined to 1 like in many kernels unlazy_fpu can
collapse to three instructions. For that inlining is a very good idea.
Otherwise it's 10 instructions or so, which can be still inlined.
We don't need the lock prefix to test our local thread flags state.
Unfortunately test_thread_flag currently always uses test_bit which
has a LOCK on SMP, but that's unnecessary. LOCK is costly on P4,
so it's a good idea to avoid it.
Work around this for now by testing directly. Better would be
probably to define __set_bit for all architectures to not guarantee
atomicity and then always use that for local thread_info accesses
in linux/thread_info.h
John Levon [Sun, 9 Mar 2003 02:31:41 +0000 (18:31 -0800)]
[PATCH] fix oprofile on x86 > 1 counter
Without this we have a choice between dropping lots of counter events
for counters > 0, or getting dazed and confused. This brings it inline
with the 2.4 module code. Tested on my 2-way.
Also fix a typo from Steven Cole, and remove some unnecessary code
Martin J. Bligh [Sat, 8 Mar 2003 14:39:04 +0000 (06:39 -0800)]
[PATCH] NUMA scheduler fixup
From: Ingo Molnar <mingo@elte.hu>
This cleans up the NUMA scheduler to have separate triggers for idle
and busy rebalance ratio, preventing some complex interactions where
idle cpus can cause busy ones to busy rebalance more often. The core
functionality of this patch is rebalace_tick().
Tested in -mjb tree for over 1 month ... no problems at all found -
retested on top of 64-bk3 with new scheduler updates.
Andrew Morton [Sat, 8 Mar 2003 14:05:45 +0000 (06:05 -0800)]
[PATCH] remove compile warning from serial console initcall
Patch from: "Martin J. Bligh" <mbligh@aracnet.com>
This tiny patch removes the new compiler warning from my build - the new
console_initcall mechanism seems to require int from console_init ... I made
serial8250_console_init look like con_init
Andrew Morton [Sat, 8 Mar 2003 14:05:36 +0000 (06:05 -0800)]
[PATCH] rpc_delete_timer race fix
Patch from Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de>
Fix a race wherein timer_pending() returns false, but the timer handler is
actually running on another CPU. We need to call del_timer_sync()
regardless, so we wait for completion of the handler.
Andrew Morton [Sat, 8 Mar 2003 11:28:57 +0000 (03:28 -0800)]
[PATCH] raw.c: dev_t cleanup and oops fix
Patch from Andries.Brouwer@cwi.nl
The next patch in the dev_t series eliminates the last applied use
of MAX_BLKDEV - only the definition in major.h remains.
Sneaky as I am, I combine this patch with the fix for an Oops:
On open, raw_open does
filp->f_dentry->d_inode->i_mapping =
bdev->bd_inode->i_mapping;
storing a pointer to bdev stuff.
But on release this pointer stayed, the block device is not
referenced anymore and disappears, and the next open references
undefined stuff.
I checked, and this can actually cause an Oops - scenario:
More precisely the problem is that dentry_open does
file_ra_state_init(&f->f_ra, inode->i_mapping);
And file_ra_state_init uses mapping->backing_dev_info->ra_pages.
Ugly, to use so much information about the inode even before
the inode has been opened.
In the patch below I reset i_mapping upon release of the raw device.
akpm: I fixed a typo and exported default_backing_dev_info to GPL modules for
this.
Andrew Morton [Sat, 8 Mar 2003 11:28:30 +0000 (03:28 -0800)]
[PATCH] fix SMP lockup in eepro100 with ethtool on unused
Patch from Jason Lunz <lunz@falooley.org>
When support for the GSET and SSET ethtool ioctls was added to eepro100.c in
2.4.20, the tx lock was overloaded to serialize their use. Unfortunately,
this lock is only initialized in dev->open(), causing ethtool to deadlock the
machine when used on an unconfigured eepro100 interface.
The fix is to initialize the spinlock at probe time.
Andrew Morton [Sat, 8 Mar 2003 11:27:42 +0000 (03:27 -0800)]
[PATCH] Extended attribute sharing and debug macro typo fixes
Patch from Andreas Gruenbacher <agruen@suse.de>
Tony Dziedzic has found two bugs in the extended attributes code. Patches with
explanations are attached.
1: Extended attribute sharing on ext2/ext3 not working
The mb_cache_entry_insert function constantly returns an -EBUSY error
instead of 0, which causes the xattr cache that is needed by the xattr
sharing mechanism on ext2/ext3 to not share anything. This patch fixes
the problem. (It is possible that after applying this fix we will hit
bugs in code that wasn't used before.)
2: Oops in one of the xattr debug statements: The old_bh variable is NULL
if an inode that previously had no EA's assigned would share an EA block
with another inode. (This was hidden by the xattr sharing bug).
Andrew Morton [Sat, 8 Mar 2003 11:27:24 +0000 (03:27 -0800)]
[PATCH] fix memory leak in load_elf_binary()
- Fix an error-path leak of memory and a dentry in load_elf_binary()
(spotted by Oleg Drokin).
- Tidy up the handling of bad executable images: return -ENOEXEC rather
than 0. (We've committed suicide anyway, so probably nobody gets to see
this).
- Fix up the logic in load_aout_interp(). It gets itself all set up to
return -ENOEXEC but there is in fact no path by which it can do this. Just
return ~0UL on errors, like load_elf_interp().
Andrew Morton [Sat, 8 Mar 2003 11:26:43 +0000 (03:26 -0800)]
[PATCH] hugetlb unmap_vmas() SMP && PREEMPT fix
Patch from Kevin Pedretti <pedretti@ieee.org>
The unmap_vmas() logic is designed to chew away at all the pages without
holding off preemption for too long. But with CONFIG_SMP=y and
CONFIG_PREEMPT=y the number of pages which we batch up between rescheduling
opportunities is not a multiple of HPAGE_SIZE. So unmap_vmas() ends up
calling unmap_hugepage_range() with a poorly aligned&sized region, and it
goes BUG.
Fix that up by ensuring that we always work across hugepage regions in
HPAGE_SIZE chunks.
Andrew Morton [Sat, 8 Mar 2003 11:25:58 +0000 (03:25 -0800)]
[PATCH] fix div-by-zero in bonding.c
Patch from: Shmulik Hen <hshmulik@intel.com>
The following patch fixes a division by zero bug in the bonding module that
happens when transmitting through a bond with no slaves, in the XOR bonding
mode.
Andrew Morton [Sat, 8 Mar 2003 11:24:48 +0000 (03:24 -0800)]
[PATCH] Fix copy_page_range()'s handling of invalid pages
Patch from Xavier Bru <Xavier.Bru@bull.net>
If copy_page_range encounters a pte which maps an invalid pageframe it will
proceed to try to add an rmap entry against that page. This causes oopses
when an application which has mapped an IO device via /dev/mem forks.
Fix that up by correctly skipping the page_add_rmap() for these pte's.
Andrew Morton [Sat, 8 Mar 2003 11:23:55 +0000 (03:23 -0800)]
[PATCH] slab use-after-free detector
Patch from Petr Vandrovec <vandrove@vc.cvut.cz>
Modifies check_poison function to not only verify that last byte is
POISON_END, but also that all preceeding bytes are either POISON_BEFORE or
POISON_AFTER bytes.
Andrew Morton [Sat, 8 Mar 2003 11:23:39 +0000 (03:23 -0800)]
[PATCH] Fix vm_area_struct slab corruption
Patch from Hugh Dickins <hugh@veritas.com>
Hugh's patch fixes vm_area_struct slab corruption due to mremap's move_vma
mistaking how do_munmap splits vmas in one case.
Neither of us are very happy with it - it is fragile, and obscure. Hugh will
revisit this later, but for now it should fix up the potential memory
corruption.
Andrew Morton [Sat, 8 Mar 2003 11:23:08 +0000 (03:23 -0800)]
[PATCH] Allow VFS readahead to fall to zero
Some workloads really, really want to have no readahead. Databases which are
perfoming small synchronous I/Os against a file which has extremely poor
layout. Any readahead at all is a lose here.
But the current readahead code refuses to adapt that low.
Fix it up so that we can indeed adaptively disable readahead altogether, and
do not start it again until we have seen max_readahead()'s worth of
consecutive reads.
Andrew Morton [Sat, 8 Mar 2003 11:22:49 +0000 (03:22 -0800)]
[PATCH] fix possible latency in balance_dirty_pages()
Tasks which throttle in balance_dirty_pages() will loop until the amount of
dirty memory falls below the configured dirty_ratio.
This exposes the possibility that one task could be stuck in there for
arbitrary periods of time due to page dirtying activity by other tasks.
The patch changes the logic so that tasks will break out of the loop if they
have written enough pages, regardless of the current dirty memory limits.
Here "enough" pages is 1.5x the number of pages which they just dirtied.
If the amount of dirty memory in the machine happens to still exceed
dirty_ratio (say, due to MAP_SHARED activity) then the task will again
throttle after dirtying a single page. But there is now an upper limit on
the time for which a single task will be captured in balance_dirty_pages().
Andrew Morton [Sat, 8 Mar 2003 11:22:37 +0000 (03:22 -0800)]
[PATCH] register_blkdev cleanups
Patch from Andries.Brouwer@cwi.nl
The following patch does the following:
- static const char *blkdevs[MAX_BLKDEV]; disappears
- get_blkdev_list, (un)register_blkdev, __bdevname
are moved from block_dev.c to genhd.c
- the third "fops" parameter of register_blkdev was unused;
now removed everywhere
- zillions of places had printk("cannot get major") upon
error return from register_blkdev; removed all of these
and inserted a single printk in register_blkdev.
Of course the reason for the patch is that one fixed size
array is eliminated.
Dave Jones [Sat, 8 Mar 2003 07:39:57 +0000 (06:39 -0100)]
[CPUFREQ] update documentation
The sysfs directory where the cpufreq-related files are stored changed due
to the new device interface code, so the documentation needs to be updated
accordingly. Also, add some information about the reference counting and the
exporting of sysfs files by the drivers.
Dave Jones [Sat, 8 Mar 2003 07:39:21 +0000 (06:39 -0100)]
[CPUFREQ] allow cpufreq drivers to export sysfs files
This patch lets cpufreq drivers export per-CPU files in the cpufreq and
cpu-specific sysfs directory. As an example, a file
"scaling_available_frequencies" is added to the p4-clockmod.c driver.
Dave Jones [Sat, 8 Mar 2003 07:38:32 +0000 (06:38 -0100)]
[CPUFREQ] add support for ICH4-M chipset in speedstep driver
Intel ICH4-M soutbridges use exactly the same register interface for SpeedStep
as ICH2-M and ICH3-M southbridges -- which makes adding support for this
bridge (almost) trivial
Dave Jones [Sat, 8 Mar 2003 07:37:39 +0000 (06:37 -0100)]
[CPUFREQ] updated cpufreq ref-counting and locking scheme
This patch takes use of the now-working cpufreq_interface.kset and
cpufreq_policy.kobj to use reference counting within the cpufreq core
wherever this is more appropriate than the previous approach -- using one
semaphore. Additionally, the callbacks to the driver modules are protected
now.
Dave Jones [Sat, 8 Mar 2003 07:36:56 +0000 (06:36 -0100)]
[CPUFREQ] remove unneeded code
- no cpufreq driver uses the frequency table helper "setpolicy" any more
("target" is much more appropriate for them anyways) - so remove
that helper
- all cpufreq drivers use the advanced registration process, so some
compatibility code can safely be removed.
Dave Jones [Sat, 8 Mar 2003 07:36:30 +0000 (06:36 -0100)]
[CPUFREQ] fix userspace governor.
Let's put the sysfs file exported by the cpufreq userspace governor also
into the cpufreq/ - subdirectory of /sys/devices/sys/cpu0/.
Dave Jones [Sat, 8 Mar 2003 07:35:48 +0000 (06:35 -0100)]
[CPUFREQ] fix cpufreq core breakage(s)
- update two more cpufreq-related sysfs files to the new interface
code
- always store the new, user-requested policy in another struct
cpufreq_policy so that we can safely fall back to the old one in
case something fails (this equals the behaviour before Pat's patch)
- the kobject which was registered in cpufreq_add_dev was inside a variable
private to this function -- so the whole cpufreq sysfs interface returned
-EINVAL.