The accounting works now, but I still think this last bit should be
added as well. This makes absolutely sure we only account fs requests,
at both ends. Better safe than sorry.
Petr Vandrovec [Sun, 13 Jul 2003 04:29:09 +0000 (21:29 -0700)]
[PATCH] new sysctl checking accesses userspace directly
The recent change from Andi breaks here: tmp.name is user pointer, not
array in __sysctl_args, and so it is better to access it through
copy_from_user instead of directly.
Dave Jones [Sun, 13 Jul 2003 14:36:45 +0000 (15:36 +0100)]
[AGPGART] Make frontend sparse clean.
Didn't turn up anything particularly nasty, but it does clean up
usage of a few types that are passed around.
- Do the casts in the ioctl handler instead.
- Remove unused variables.
- __user annotations.
Dave Jones [Sat, 12 Jul 2003 22:45:43 +0000 (23:45 +0100)]
[AGPGART] SiS 746 support
This (and a few other SiS chipsets) are AGP 3 compliant. AFAIK, none of
these have been tested in AGP3 mode, but they should work just fine in
AGP2.x mode at least.
Dave Jones [Sat, 12 Jul 2003 13:30:37 +0000 (14:30 +0100)]
[AGPGART] HP AGP update.
From David Mosberger
This GART isn't actually a PCI device, which the AGP core/DRI expects it to be.
This patch gets the relevant info out of ACPI tables, and fakes the rest.
Samuel Thibault [Sat, 12 Jul 2003 07:17:40 +0000 (00:17 -0700)]
[PATCH] [2.5] maestro volume tuning
This tunes the volume control of maestro sound boards: The log
conversion seems not good for PCM and CD. The volume buttons
incrementing / decrementing the main volume by 10 on 100 is too much,
much better set it to 5.
Deprecate the numerical sysctl name space. People can use /proc/sys
instead.
The numeric name space was never well maintained and especially
in distribution kernels is not very consistent (everybody has their
own extensions, conflicting with others). It's also a great
source of rejects when merging patches. The name-based /proc/sys
is a much better interface for this, which people should use instead.
Discussion of this on l-k found no advocate for it, so it seems to not
be very popular anyways.
This patch deprecates numerical name space accesses to make it possible
to remove them in the future. The only exception is kernel.version,
which is used by glibc (this one has to be maintained forever)
- __div64_32(): remove __attribute_pure__ qualifier from the prototype
since this function obviously clobbers memory through &(n);
- do_div(): add a check to ensure (n) is type-compatible with uint64_t;
- as_update_iohist(): Use sector_div() instead of do_div().
(Whether the result of the addition should always be stored in 64bits
regardless of CONFIG_LBD is still being discussed, therefore it's
unadderessed here);
- Fix all places where do_div() was being called with a bad divisor argument.
Every failed SG_IO request is replayed second time without data
transfer. Fix the problem by immediately purging the failed SG_IO
request from the request queue.
Alan Cox [Fri, 11 Jul 2003 13:49:10 +0000 (06:49 -0700)]
[PATCH] AC97 updates from 2.4
This deals with several things
- Codecs that think they are modems but are not
- Abstracting modem detection out of drivers
- Abstracting digital switching out of drivers
- Codecs that have no volume control
- Codec plugins for specific setups
- Codec plugins for things like touchscreen/batmon on AC97
- More codec handlers
The plugin API is intentionally modelled on the other driver_register
type interfaces.
A long time ago in a land far far away the icmpv6 filter
code bogusly used the "unsigned long" based bitops and
thus we had all kinds of endianness problems wrt. 32-bit
apps running on 64-bit machines. These days the icmpv6
code explicitly uses u32 fixed types and thus no translations
are necessary.
Andrew Morton [Thu, 10 Jul 2003 17:04:45 +0000 (10:04 -0700)]
[PATCH] devfs deadlock fix
From: Andrey Borzenkov <arvidjaar@mail.ru>
I finally hit a painfully trivial way to reproduce another long standing devfs
problem - deadlock between devfs_lookup and devfs_d_revalidate_wait. When
devfs_lookup releases directory i_sem devfs_d_revalidate_wait grabs it (it
happens not for every path) and goes to wait to be waked up. Unfortunately,
devfs_lookup attempts to acquire directory i_sem before ever waking it up ...
To reproduce (2.5.74 UP or SMP - does not matter, single CPU system)
ls /dev/foo & rm -f /dev/foo &
or possibly in a loop but then it easily fills up process table. In my case it
hangs 100% reliably - on 2.5 OR 2.4.
The current fix is to move re-acquire of i_sem after all
devfs_d_revalidate_wait waiters have been waked up. Much better fix would be
to ensure that ->d_revalidate either is always called under i_sem or always
without. But that means the very heart of VFS and I do not dare to touch it.
The fix has been tested on 2.4 (and is part of unofficial Mandrake Club
kernel); I expected the same bug is in 2.5; I just was stupid not seeing the
way to reproduce it before.
Andrew Morton [Thu, 10 Jul 2003 17:04:38 +0000 (10:04 -0700)]
[PATCH] devfs oops fix
From: Andrey Borzenkov <arvidjaar@mail.ru>
Doing concurrent lookups for the same name in devfs with devfsd and modules
enabled may result in stack coruption.
When devfs_lookup needs to call devfsd it arranges for other lookups for the
same name to wait. It is using local variable as wait queue head. After
devfsd returns devfs_lookup wakes up all waiters and returns. Unfortunately
there is no garantee all waiters will actually get chance to run and clean up
before devfs_lookup returns. so some of them attempt to access already freed
storage on stack.
It is trivial to trigger with SMP kernel (I have single-CPU system if it
matters) doing
while true
do
ls /dev/foo &
done
Without spinlock debug system usually hung dead with reset button as the only
possibility.
I was not able to reproduce it on 2.4 on single-CPU system - in 2.4
devfs_d_revalidate_wait does not attempt to remove itself from wait queue
so it appears to be safe.
The patch makes lookup struct be allocated from heap and adds reference
counter to free it when no more needed.
Andrew Morton [Thu, 10 Jul 2003 17:04:17 +0000 (10:04 -0700)]
[PATCH] oom killer fixes
From: William Lee Irwin III <wli@holomorphy.com>
There are reports of kernel threads being killed by the oomkiller. We
think this is because the oom killer tries to kill a task after it has
exitted and set its ->mm to zero. The oom killer will then try to kill all
other tasks which have a null ->mm.
Andrew Morton [Thu, 10 Jul 2003 17:04:11 +0000 (10:04 -0700)]
[PATCH] ext3: sync_fs() fix
From: Alex Tomas <bzzz@tmi.comex.ru>
fsync_super() calls ->sync_fs() just after ->write_super(). But
write_super() will start a commit. In this case, ext3_sync_fs() will not
itself start a commit, and it hence forgets to wait on the commit which
ext3_write_super() started.
Fix that up by making journal_start_commit() return the transaction ID of
any currently-running transaction.
Andrew Morton [Thu, 10 Jul 2003 17:04:04 +0000 (10:04 -0700)]
[PATCH] JBD: transaction buffer accounting fix
From: Alex Tomas <bzzz@tmi.comex.ru>
start_this_handle() takes into account t_outstanding_credits when calculating
log free space, but journal_next_log_block() accounts for blocks being logged
also. Hence, blocks are accounting twice. This effectively reduces the
amount of log space available to transactions and forces more commits.
Fix it by decrementing t_outstanding_credits each time we allocate a new
journal block.
Andrew Morton [Thu, 10 Jul 2003 17:03:57 +0000 (10:03 -0700)]
[PATCH] JBD: checkpointing optimisations
From: Alex Tomas <bzzz@tmi.comex.ru>
Some transaction checkpointing improvements for the JBD commit phase. Decent
speedups:
creation of 500K files in single dir (with htree, of course):
before: 4m16.094s, 4m12.035s, 4m11.911s
after: 1m41.364s, 1m43.461s, 1m45.189s
removal of 500K files in single dir:
before: 43m50.161s
after: 38m45.510s
- Make __log_wait_for_space() recalculate the needed blocks because journal
free space changes during commit
- Make log_do_checkpoint() starts scanning from the oldest transaction
- Make log_do_checkpoint() stop scanning if a transaction gets dropped.
The caller will reevaluate the transaction state and decide whether more
space needs to be generated in the log.
The effect of this is to smooth out the I/O patterns, avoid the huge
stop-and-go which currently happens when forced checkpointing writes out
and waits upon 3/4 of the journal's size worth of data.