Andrew Morton [Sun, 20 Apr 2003 07:26:42 +0000 (00:26 -0700)]
[PATCH] detect_lost_tick locking fixes
From: john stultz <johnstul@us.ibm.com>
This patch fixes a race in the timer_interrupt code caused by
detect_lost_tick(). Since we're doing lost-tick compensation outside
timer->mark_offset, time can pass between time-source reads which can cause
gettimeofday inconsistencies.
Additionally detect_lost_tick() was broken for the PIT case, since the whole
point of detect_lost_tick() is to interpolate between two time sources to
find inconsistencies. Additionally this could cause xtime_lock seq_lock
reader starvation which has been causing machine hangs for SMP boxes that use
the PIT as a time source.
This patch fixes the described race by removing detect_lost_tick() and
instead implementing the lost tick detection code inside mark_offset().
Some of the divs and mods being added here might concern folks, but by not
calling timer->get_offset() in detect_lost_tick() we eliminate much of the
same math. I did some simple cycle counting and the new code comes out on
average equivalent or faster.
Andrew Morton [Sun, 20 Apr 2003 07:26:34 +0000 (00:26 -0700)]
[PATCH] get_offset_pit and do_timer_overflow vs IRQ locking
From: john stultz <johnstul@us.ibm.com>, Alexander Atanasov <alex@ssi.bg>
We want to make sure we update jiffies_p and count_p atomically. So I'm
inserting the spin_unlock_irqrestore() after we update count_p, rather then
just before.
Andrew Morton [Sun, 20 Apr 2003 07:26:28 +0000 (00:26 -0700)]
[PATCH] Fix jiffies_to_time[spec | val] and converse to use
From: george anzinger <george@mvista.com>
In the current system (2.5.67) time_spec to jiffies, time_val to
jiffies and the converse (jiffies to time_val and jiffies to
time_spec) all use 1/HZ as the measure of a jiffie. Because of the
inability of the PIT to actually generate an accurate 1/HZ interrupt,
the wall clock is updated with a more accurate value (999848
nanoseconds per jiffie for HZ = 1000). This causes a 1/HZ
interpretation of jiffies based timing to run faster than the wall
clock, thus causing sleeps and timers to expire short of the requested
time. Try, for example:
time sleep 60
This patch changes the conversion routines to use the same value as
the wall clock update code to do the conversions.
The actual math is almost all done at compile time. The run time
conversions require little if any more execution time.
This patch must be applied after the patch I posted earlier today
which fixed the CLOCK_MONOTONIC resolution issue.
Andrew Morton [Sun, 20 Apr 2003 07:26:21 +0000 (00:26 -0700)]
[PATCH] Fix POSIX timers to give CLOCK_MONOTONIC full
The POSIX CLOCK_MONOTONIC currently has only 1/HZ resolution. Further, it is
tied to jiffies (i.e. is a restatment of jiffies) rather than "xtime" or the
gettimeofday() clock.
This patch changes CLOCK_MONOTONIC to be a restatment of gettimeofday() plus
an offset to remove any clock setting activity from CLOCK_MONOTONIC. An
offset is kept that represents the difference between CLOCK_MONOTONIC and
gettimeofday(). This offset is updated when ever the gettimeofday() clock is
set to back the clock setting change out of CLOCK_MONOTONIC (which by the
standard, can not be set).
With this change CLOCK_REALTIME (a direct restatement of gettimeofday()),
CLOCK_MONOTONIC and gettimeofday() will all tick at the same time and with
the same rate. And all will be affected by NTP adjustments (save those which
actually set the time).
Andrew Morton [Sun, 20 Apr 2003 07:26:14 +0000 (00:26 -0700)]
[PATCH] Fix and clean up DCACHE_REFERENCED usage
From: Maneesh Soni <maneesh@in.ibm.com>
This patch changes the way DCACHE_REFERENCED flag is used. It
got messed up in dcache_rcu iterations. I hope this will be ok now.
The flag was meant to be advisory flag which is used while
prune_dcache() so as not to free dentries which have recently
entered d_lru list. At first pass in prune_dcache the dentries
marked DCACHE_REFERENCED are left with the flag reset. and they
are freed in the next pass.
So, now we mark the dentry as DCACHE_REFERENCED when it is first
entering the d_lru list in dput() and resetthe flag in prune_dcache().
If the flag remains reset in the next call to prune_dcache(), the
dentry is then freed.
Also I don't think any file system have to use this flag as it is taken
care by the dcache layer. The patch removes such code from a few of file
systems. Moreover these filesystems were anyway doing worng thing as they
were changing the flag out of dcache_lock.
Changes:
o dput() marks dentry DCACHE_REFERENCED when it is added to the dentry_unused
list
o no need to set the flag in dget, dget_locked, d_lookup as these guys anyway
increments the ref count.
o check the ref count in prune_dcache and use DCACHE_REFERENCED flag just for
two stage aging.
o remove code for setting DACACHE_REFERENCED from reiserfs, fat, xfs and
exportfs.
Andrew Morton [Sun, 20 Apr 2003 07:26:07 +0000 (00:26 -0700)]
[PATCH] dentry_stat accounting fix
From: Maneesh Soni <maneesh@in.ibm.com>
This patch the corrects the dentry_stat.nr_unused calculation.
In select_parent() and shrink_dcache_anon() we were not doing any adjustments
to the nr_unused count after manipulating the dentry_unused list. Now the
nr_unused count is decremented if the dentry is on dentry_unused list and is
removed from there.
Further in the same routines, we have to adjust the nr_unused count again if
the dentry is moved to the end of d_lru list for pruning.
Ben Collins [Sat, 19 Apr 2003 12:34:28 +0000 (05:34 -0700)]
[PATCH] IEEE-1394/Firewire updates
- Cleaned up hostinfo usage in all drivers and created a central API to
handle them all.
- Fixup some spinlock mis-usage.
- Remove devfs_handle mis-usage.
- Cleaned up some heavy handed spinlocking to use mutexes instead.
- Add function to send PHY config packets and use to to settle
IRM/cycle-master/root descrepancies.
(i) Replace in struct loop_info the dev_t field by __kernel_old_dev_t,
where this type is defined in <asm/posix_types.h>, so that problems
with a differently sized dev_t in userspace are avoided.
(ii) Introduce a new loop_info64, with __u64 device, inode and offset
fields.
Second try at the bridge driver module handling cleanup...
1) Eliminate keeping a seperate bridge_list and use a bit on
the priv_flags structure. This is equivalent to how the VLAN
code works. Makes code cleaner and correctly handles cases like
creating a bridge with the same name as an existing ether device etc.
2) Don't do own module ref counting that is inhernently racy.
Instead set owner field and cleanup debris on unload.
3) Do last state cleanup in destructor
4) Change of bridge state (dev_open/stop) should use write_lock
[DECNET]: DECnet routing fixes etc.
o As requested, macros in dn_fib.h changed to decnet specific names
o Two bugs fixed (only in 2.5 decnet stack) relating to bind and connection
states.
o Numerous style changes: using C99 initialisers and inline rather
than __inline__
o Use struct flowi as routing key (for forthcoming flow cache)
o Add metrics to routing table
o Many routing table bug fixes
o New wait code to improve efficiency
o We use real device MTUs now rather than saying "hmm... looks like ethernet
must be 1500" as we used to (still one or two places to fix, but its
mostly correct in this patch)
o Tidy up in af_decnet.c:dn_sendmsg() in preparation for zerocopy
o Updates to rtnetlink code to return more information
o Removed ioctl() for decnet fib. It never did anything and rtnetlink is
a far better interface anyway.
o Converted /proc/decnet_neigh to seq_file (other /proc files to follow)
o DECnet route cache now uses RCU like the ipv4 route cache
o Misc bug fixes wherever I found them
o SO_BINDTODEVICE works for outgoing connections
Store the path of it's devfs directory in struct scsi_device. Use
it in the devfs_register calls instead of the devfs_handle_t
which will go away soon.
Russell King [Thu, 17 Apr 2003 23:26:15 +0000 (00:26 +0100)]
[ARM] Fix Kconfig breakage in arch/arm/mach-iop3xx/Kconfig
When a "depends" statement against all configuration options of a choice,
which causes all options of that choice to be disabled, it sends Kconfig
into an infinite loop. Move the "depends" clause to the choice statement
instead.
Eli Carter [Thu, 17 Apr 2003 22:59:27 +0000 (23:59 +0100)]
[ARM PATCH] 1506/1: Add iq80321 MTD mapping
Patch from Eli Carter
# Thu Apr 17 14:05:58 CDT 2003 ejc@rnd-linux-c84
# iq80321-mtd
#
# Add the MTD mapping for the flash chip on the iq80321 board.
# The drivers/mtd/maps/iq80321.c file comes from 2.4.19-rmk4-ds2, and is
# essentially a copy of the iq80310.c file in the same directory.
# This version used C99 initializers
#
# Diff'ed against 2.5.65-rmk1+1472-4+1502-3
# Applies cleanly to linux-2.5.67-rmk1+1502-3
#
# arch/arm/def-configs/iq80321 | 61 ++++++++++-----
# drivers/mtd/maps/Kconfig | 8 ++
# drivers/mtd/maps/Makefile | 1
# drivers/mtd/maps/iq80321.c | 169 +++++++++++++++++++++++++++++++++++++++++++
# 4 files changed, 218 insertions(+), 21 deletions(-)
#
Alan Cox [Thu, 17 Apr 2003 09:29:58 +0000 (02:29 -0700)]
[PATCH] generalise fpu_irq also add pc98 for x86 code
The idea is to move more to if(pc98) so that we can attempt to get all
the ports buildable as one "generic" port in time. I don't think its p
possible for PC9800 but no need to dig holes
[PATCH] make devpts filesystem mandatory even for CONFIG_DEVFS
This patch rips out handling of UNIX98 ptys from devfs. We already
have a special small filesystem to handle it (devpts) that's always
compiled in anyway. This allows to get rid of all DEVFS_FL* flags and
some gunk in devfs.
Ben Collins [Thu, 17 Apr 2003 06:07:43 +0000 (23:07 -0700)]
[PATCH] IEEE-1394/Firewire updates
- Add driver registration for dv1394/video1394/raw1394.
- Fix 3 sleep-while-atomic bugs in ohci1394 and ieee1394.
- Cleanup some bus-reset handling in ohci1394.
- Add empty config-rom handling.
- Check and handle SBP-2 logins active/available for non-exclusive
logins.
- Fix bug in SBP-2 DMA cleanup.
Andrew Morton [Thu, 17 Apr 2003 05:52:11 +0000 (22:52 -0700)]
[PATCH] Fix orlov allocator boundary case
In the interests of SMP scalability the ext2 free blocks and free inodes
counters are "approximate". But there is a piece of code in the Orlov
allocator which fails due to boundary conditions on really small
filesystems.
Fix that up via a final allocation pass which simply uses first-fit for
allocation of a directory inode.
Russell King [Thu, 17 Apr 2003 00:37:19 +0000 (01:37 +0100)]
[SERIAL] Move make modem control signals accessible to line discplines
We also parse modem control signals in the tty layer, and fail with
EINVAL if the driver does not provide the methods. All tty drivers
which require modem control support should be updated to provide
the new tiocmset and tiocmget methods.
David Mosberger [Wed, 16 Apr 2003 04:20:26 +0000 (21:20 -0700)]
[PATCH] fix fs->lock deadlock with emulated name lookup
The patch below is needed to avoid a deadlock on fs->lock. Without
the patch, if __emul_lookup_dentry() returns 0, we fail to reacquire
current->fs->lock and then go ahead to read_unlock() it anyhow. Bad
for your health.
I believe the bug was introduced when the fast pathwalk was reverted
in order to introduce the RCU lockless path walking.