]> git.hungrycats.org Git - linux/log
linux
23 years agoMake generic TLB shootdown friendlier to non-x86 architectures v2.5.17
Linus Torvalds [Mon, 20 May 2002 14:34:26 +0000 (07:34 -0700)]
Make generic TLB shootdown friendlier to non-x86 architectures

23 years ago[PATCH] Missing init.h in drivers/pci/power.c
David Gibson [Mon, 20 May 2002 13:01:56 +0000 (06:01 -0700)]
[PATCH] Missing init.h in drivers/pci/power.c

This adds a #include to drivers/pci/power.c to define __init.  At least
on PPC4xx this fixes compile problems.

23 years agoFix double i_writecount handling (Tony Luck)
Linus Torvalds [Mon, 20 May 2002 13:01:40 +0000 (06:01 -0700)]
Fix double i_writecount handling (Tony Luck)

23 years agoClean up %cr3 loading on x86, fix lazy TLB problem
Linus Torvalds [Mon, 20 May 2002 12:58:03 +0000 (05:58 -0700)]
Clean up %cr3 loading on x86, fix lazy TLB problem

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.make
Linus Torvalds [Mon, 20 May 2002 05:48:18 +0000 (22:48 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.make
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux

23 years agokbuild: Speed up vmlinux build
Kai Germaschewski [Mon, 20 May 2002 09:22:57 +0000 (04:22 -0500)]
kbuild: Speed up vmlinux build

The recursive build used to do the following: On entering a directory,
we would first call make in the subdirectories listed in $(subdir-y),
and then call make in the current directory again, with the target
'all_targets'.

The second invocation was used to make sure that the subdir makes completed
before trying to build the O_TARGET/L_TARGET in the current dir, since
this would link in objects in these subdirectories.

However, using correct dependencies achieves the same, i.e. just
make the objects in $(obj-y) which are not in the local subdirectory
depend on 'sub_dirs', which is the rule to descend into subdirs.

This patch actually halves the time "make vmlinux" takes when there's
nothing to do (which makes sense, as we save half of the make invocations)

23 years agokbuild: Remove generated .<object>.cmd files on 'make clean'
Kai Germaschewski [Mon, 20 May 2002 09:16:00 +0000 (04:16 -0500)]
kbuild: Remove generated .<object>.cmd files on 'make clean'

23 years agokbuild: Standardize building of init/*
Kai Germaschewski [Mon, 20 May 2002 09:14:59 +0000 (04:14 -0500)]
kbuild: Standardize building of init/*

There's no good reason to build the objects in init/ explicitly from
the top-level Makefile. Instead, handle init/ like every other
subdir, which also provides the automatic checks for a changed
command line etc.

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.misc
Linus Torvalds [Mon, 20 May 2002 05:38:20 +0000 (22:38 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.misc
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux

23 years agoFix some compiler warnings
Kai Germaschewski [Mon, 20 May 2002 08:59:06 +0000 (03:59 -0500)]
Fix some compiler warnings

Fix some trivial variable/functions/label defined (static) but not used
warnings.

23 years agoFix ext2 compilation
Kai Germaschewski [Mon, 20 May 2002 08:56:29 +0000 (03:56 -0500)]
Fix ext2 compilation

Removal of locks.h broke the build due to missing definition of capable()
and current.

23 years agoNew makefiles generate .*.cmd files, not .*.flags files
Linus Torvalds [Mon, 20 May 2002 05:23:12 +0000 (22:23 -0700)]
New makefiles generate .*.cmd files, not .*.flags files

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.export
Linus Torvalds [Mon, 20 May 2002 05:09:19 +0000 (22:09 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.export
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux

23 years agoMerge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
Kai Germaschewski [Mon, 20 May 2002 08:30:24 +0000 (03:30 -0500)]
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.export

23 years ago[PATCH] ips for 2.5
Jack Hammer [Mon, 20 May 2002 05:08:33 +0000 (22:08 -0700)]
[PATCH] ips for 2.5

ips driver update ( version 5.10.13-BETA )

23 years agoUpdate kernel version to 2.5.17
Linus Torvalds [Mon, 20 May 2002 05:08:19 +0000 (22:08 -0700)]
Update kernel version to 2.5.17

23 years agoFix OSS API emulation when sound is compiled as a module
Linus Torvalds [Mon, 20 May 2002 05:07:20 +0000 (22:07 -0700)]
Fix OSS API emulation when sound is compiled as a module

23 years ago[PATCH] get rid of <linux/locks.h>
Christoph Hellwig [Mon, 20 May 2002 02:40:16 +0000 (19:40 -0700)]
[PATCH] get rid of <linux/locks.h>

The lock.h header contained some hand-crafted lcoking routines from
the pre-SMP days.  In 2.5 only lock_super/unlock_super are left,
guarded by a number of completly unrelated (!) includes.

This patch moves lock_super/unlock_super to fs.h, which defined
struct super_block that is needed for those to operate it, removes
locks.h and updates all caller to not include it and add the missing,
previously nested includes where needed.

23 years agoMerge quota update from Jan Kara
Linus Torvalds [Mon, 20 May 2002 02:37:22 +0000 (19:37 -0700)]
Merge quota update from Jan Kara

23 years ago[PATCH] [13/13] quota-13-ioctl
Jan Kara [Mon, 20 May 2002 02:34:49 +0000 (19:34 -0700)]
[PATCH] [13/13] quota-13-ioctl

This patch implements ioctl() for getting space used by file.
I agree it's ioctl() abuse, it doesn't work on links and has
other ugly properties. Better would be to change 'struct stat'
but changing it just due to this is overkill and it will take
some time before there will be enough changes which will provoke
yet another struct stat :). So this is temporary solution...
If you don't like it, simply reject it. The function it provides
is not fundamental...

So that should be all patches. Any comments (or decision about
including/not including) welcome.
Honza

23 years ago[PATCH] [12/13] quota-12-compat
Jan Kara [Mon, 20 May 2002 02:34:44 +0000 (19:34 -0700)]
[PATCH] [12/13] quota-12-compat

This patch implements configurable backward compatible quota interface.
Maybe this isn't needed in 2.5 but as some people want to use patches
in 2.4 where it's necessary I have implemented it.

23 years ago[PATCH] [11/13] quota-11-sync
Jan Kara [Mon, 20 May 2002 02:34:39 +0000 (19:34 -0700)]
[PATCH] [11/13] quota-11-sync

Implemented proper syncing of dquots - ie. also global information
about quota files are synced. We find info to sync by walking through
all superblocks...

23 years ago[PATCH] [10/13] quota-10-inttype
Jan Kara [Mon, 20 May 2002 02:34:35 +0000 (19:34 -0700)]
[PATCH] [10/13] quota-10-inttype

Remove use of 'short' in parameters of functions. 'int' is used instead.

23 years ago[PATCH] [9/13] quota-9-format2
Jan Kara [Mon, 20 May 2002 02:34:29 +0000 (19:34 -0700)]
[PATCH] [9/13] quota-9-format2

Implementation of new quota format. The code is almost the same
as in -ac versions of kernel. All the code for new format is in
quota_v2.c

23 years ago[PATCH] [8/13] quota-8-format1
Jan Kara [Mon, 20 May 2002 02:34:25 +0000 (19:34 -0700)]
[PATCH] [8/13] quota-8-format1

Implementation of old quota format. All the code for old format is now in
quota_v1.c. Code mostly remained the same as in older kernels (just minor
changes were needed to bind it with quota interface).

23 years ago[PATCH] [7/13] quota-7-quotactl
Jan Kara [Mon, 20 May 2002 02:34:20 +0000 (19:34 -0700)]
[PATCH] [7/13] quota-7-quotactl

This is probably the largest chunk in quota patches. It removes old quotactl interface
and implements new one. New interface should not need arch specific conversions so they
are removed. All quota interface stuff is moved to quota.c so we can
easily separate things which should be compiled even if quota is disabled (mainly
because XFS needs some interface even if standard VFS quota is disabled).
Callbacks to filesystem on quota_on() and quota_off() are implemented (needed by Ext3),
quota operations callbacks are now set in super.c on superblock initialization and
not on quota_on(). This way it starts to make sense to have callbacks on alloc_space(),
alloc_inode() etc. as filesystem can override them on read_super(). This will be used
later for implementing journalled quota.

23 years ago[PATCH] [6/13] quota-6-bytes
Jan Kara [Mon, 20 May 2002 02:34:14 +0000 (19:34 -0700)]
[PATCH] [6/13] quota-6-bytes

This patch implements counting of used space in inodes in bytes.
New field i_bytes is added and used space modulo 512 is kept in
it (rest is still kept in i_blocks). Functions manipulating both
i_blocks and i_bytes are implemented (inode_add_bytes(), inode_sub_bytes()
and inode_set_bytes()). Filesystems allocating only in whole blocks
can safely ignore i_bytes field and continue using i_blocks...

23 years ago[PATCH] [5/13] quota-5-space
Jan Kara [Mon, 20 May 2002 02:34:10 +0000 (19:34 -0700)]
[PATCH] [5/13] quota-5-space

This patch implements accounting of used space in bytes.

23 years ago[PATCH] [4/13] quota-4-getstats
Jan Kara [Mon, 20 May 2002 02:34:05 +0000 (19:34 -0700)]
[PATCH] [4/13] quota-4-getstats

  This patch moves reporting of quota statistics from Q_GETSTATS call to
/proc/fs/quota. Also reporting of registered quota formats is added.

23 years ago[PATCH] [3/13] quota-3-register
Jan Kara [Mon, 20 May 2002 02:34:00 +0000 (19:34 -0700)]
[PATCH] [3/13] quota-3-register

  This patch implements list 'quota_formats' with registered quota formats
and functions register_quota_format() and unregister_quota_format() for
manipulating the list.

23 years ago[PATCH] [2/13] quota-2-formats
Jan Kara [Mon, 20 May 2002 02:33:56 +0000 (19:33 -0700)]
[PATCH] [2/13] quota-2-formats

This patch removes most format dependent code from dquot.c and quota.h
and puts calls of callback functions instead.

23 years ago[PATCH] [1/13] quota-1-newlocks
Jan Kara [Mon, 20 May 2002 02:33:51 +0000 (19:33 -0700)]
[PATCH] [1/13] quota-1-newlocks

  This patch adds dq_dup_ref to struct dquot. Functions altering just usage of
quota take just this duplicated reference, inodes, quotactl() helpers take real
dq_count reference. dqput() blocks if there are some duplicated references and
put reference is last 'real one'. This way is assured that quota IO is not
done from functions altering quota usage (quota structure is written on last dqput()).

23 years agoMerge
Linus Torvalds [Mon, 20 May 2002 02:26:35 +0000 (19:26 -0700)]
Merge

23 years ago[PATCH] iget_locked [6/6]
Jan Harkes [Mon, 20 May 2002 02:25:21 +0000 (19:25 -0700)]
[PATCH] iget_locked  [6/6]

As of the last patch the inode_hashtable doesn't really need to be
indexed by i_ino anymore, the only reason we still have to keep the
hashvalue and i_ino identical is because of insert_inode_hash.

If at some point a FS specific getattr method is implemented it will be
possible to completely remove any use of i_ino by the VFS.

23 years ago[PATCH] iget_locked [5/6]
Jan Harkes [Mon, 20 May 2002 02:25:16 +0000 (19:25 -0700)]
[PATCH] iget_locked  [5/6]

This patch starts taking i_ino dependencies out of the VFS. The FS
provided test and set callbacks become responsible for testing and
setting inode->i_ino.

Because most filesystems are based on 32-bit unique inode numbers
several functions are duplicated to keep iget_locked as a fast path. We
can avoid unnecessary pointer dereferences and function calls for this
specific case.

23 years ago[PATCH] iget_locked [4/6]
Jan Harkes [Mon, 20 May 2002 02:25:12 +0000 (19:25 -0700)]
[PATCH] iget_locked  [4/6]

Now that we have no more users of iget4 we can kill the function and the
associated read_inode2 callback (i.e. the 'reiserfs specific hack').

Document iget5_locked as the replacement for iget4 in filesystems/porting.

23 years ago[PATCH] iget_locked [3/6]
Jan Harkes [Mon, 20 May 2002 02:25:07 +0000 (19:25 -0700)]
[PATCH] iget_locked  [3/6]

Convert existing filesystems (Coda/NFS/ReiserFS) that currently use
iget4 to iget5_locked.

23 years ago[PATCH] iget_locked [2/6]
Jan Harkes [Mon, 20 May 2002 02:25:02 +0000 (19:25 -0700)]
[PATCH] iget_locked  [2/6]

Now we introduce iget_locked and iget5_locked. These are similar to
iget, but return a locked inode and read_inode has not been called. So
the FS has to call read_inode to initialize the inode and then unlock
it with unlock_new_inode().

This patch is based on the icreate patch from the XFS group, i.e.
it is pretty much identical except for function naming.

23 years ago[PATCH] iget_locked [1/6]
Jan Harkes [Mon, 20 May 2002 02:24:57 +0000 (19:24 -0700)]
[PATCH] iget_locked  [1/6]

Fix a race in iget4. The fs specific data that is used to find an inode
should be initialized while still holding the inode lock.

It adds a 'set' callback function that should be a non-blocking FS
provided function which initializes the private parts of the inode so
that the 'test' callback function can correctly match new inodes.

Touches all filesystems that use iget4 (Coda/NFS/ReiserFS).

23 years agoMerge http://kernel-acme.bkbits.net:8080/char-copy_tofrom_user-2.5
Linus Torvalds [Mon, 20 May 2002 01:54:17 +0000 (18:54 -0700)]
Merge http://kernel-acme.bkbits.net:8080/char-copy_tofrom_user-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agodrivers/char/*
Arnaldo Carvalho de Melo [Sun, 19 May 2002 20:49:34 +0000 (17:49 -0300)]
drivers/char/*

- fix copy_{to,from}_user error handling, thanks to Rusty to pointing this out on lkml

23 years agodrivers/block/*.c
Arnaldo Carvalho de Melo [Sun, 19 May 2002 19:01:22 +0000 (16:01 -0300)]
drivers/block/*.c

  - fix copy_{to,from}_user error handling, thanks to Rusty for
    pointing this out on lkml

23 years ago[PATCH] remove PG_launder
Andrew Morton [Sun, 19 May 2002 09:23:27 +0000 (02:23 -0700)]
[PATCH] remove PG_launder

Removal of PG_launder.

It's not obvious (to me) why this ever existed.  If it's to prevent
deadlocks then I'd like to know who was performing __GFP_FS allocations
while holding a page lock?

But in 2.5, the only memory allocations which are performed when the
caller holds PG_writeback against an unsubmitted page are those which
occur inside submit_bh().  There will be no __GFS_FS allocations in
that call chain.

Removing PG_launder means that memory allocators can block on any
PageWriteback() page at all, which reduces the risk of very long list
walks inside pagemap_lru_lock in shrink_cache().

23 years ago[PATCH] fix ext3 race with writeback
Andrew Morton [Sun, 19 May 2002 09:23:14 +0000 (02:23 -0700)]
[PATCH] fix ext3 race with writeback

The ext3-no-steal patch has exposed a long-standing race in ext3.  It
has been there all the time in 2.4, but never triggered until some
timing change in the ext3-no-steal patch exposed it.  The race was not
present in 2.2 because 2.2's bdflush runs inside lock_kernel().

The problem is that when ext3 is shuffling a buffer between journalling
lists there is a small window where the buffer is marked BH_dirty.
Aonther CPU can grab it, mark it clean and write it out.  Then ext3
puts the buffer onto a list of buffers which are expected to be dirty,
and gets confused later on when the buffer turns out to be clean.

The patch from Stephen records the expected dirtiness of the buffer in
a local variable, so BH_dirty is not transiently set while ext3
shuffles.

23 years ago[PATCH] fix ext3 buffer-stealing
Andrew Morton [Sun, 19 May 2002 09:23:01 +0000 (02:23 -0700)]
[PATCH] fix ext3 buffer-stealing

Patch from sct fixes a long-standing (I did it!) and rather complex
problem with ext3.

The problem is to do with buffers which are continually being dirtied
by an external agent.  I had code in there (for easily-triggerable
livelock avoidance) which steals the buffer from checkpoint mode and
reattaches it to the running transaction.  This violates ext3 ordering
requirements - it can permit journal space to be reclaimed before the
relevant data has really been written out.

Also, we do have to reliably get a lock on the buffer when moving it
between lists and inspecting its internal state.  Otherwise a competing
read from the underlying block device can trigger an assertion failure,
and a competing write to the underlying block device can confuse ext3
journalling state completely.

23 years ago[PATCH] improved I/O scheduling for indirect blocks
Andrew Morton [Sun, 19 May 2002 09:22:50 +0000 (02:22 -0700)]
[PATCH] improved I/O scheduling for indirect blocks

Fixes a performance problem with many-small-file writeout.

At present, files are written out via their mapping and their indirect
blocks are written out via the blockdev mapping.  As we know that
indirects are disk-adjacent to the data it is better to start I/O
against the indirects at the same time as the data.

The delalloc pathes have code in ext2_writepage() which recognises when
the target page->index was at an indirect boundary and does an explicit
hunt-and-write against the neighbouring indirect block.  Which is
ideal.  (Unless the file was dirtied seekily and the page which is next
to the indirect was not dirtied).

This patch does it the other way: when we start writeback against a
mapping, also start writeback against any dirty buffers which are
attached to mapping->private_list.  Let the elevator take care of the
rest.

The patch makes a number of tuning changes to the writeback path in
fs-writeback.c.  This is very fiddly code: getting the throughput
tuned, getting the data-integrity "sync" operations right, avoiding
most of the livelock opportunities, getting the `kupdate' function
working efficiently, keeping it all least somewhat comprehensible.

An important intent here is to ensure that metadata blocks for inodes
are marked dirty before writeback starts working the blockdev mapping,
so all the inode blocks are efficiently written back.

The patch removes try_to_writeback_unused_inodes(), which became
unreferenced in vm-writeback.patch.

The patch has a tweak in ext2_put_inode() to prevent ext2 from
incorrectly droppping its preallocation window in response to a random
iput().

Generally, many-small-file writeout is a lot faster than 2.5.7 (which
is linux-before-I-futzed-with-it).  The workload which was optimised was

tar xfz /nfs/mountpoint/linux-2.4.18.tar.gz ; sync

on mem=128M and mem=2048M.

With these patches, 2.5.15 is completing in about 2/3 of the time of
2.5.7.  But it is only a shade faster than 2.4.19-pre7.  Why is 2.5.7
so much slower than 2.4.19?  Not sure yet.

Heavy dbench loads (dbench 32 on mem=128M) are slightly faster than
2.5.7 and significantly slower than 2.4.19.  It appears that the cause
is poor read throughput at the later stages of the run.  Because there
are background writeback threads operating at the same time.

The 2.4.19-pre8 write scheduling manages to stop writeback during the
latter stages of the dbench run in a way which I haven't been able to
sanely emulate yet.  It may not be desirable to do this anyway - it's
optimising for the case where the files are about to be deleted.  But
it would be good to find a way of "pausing" the writeback for a few
seconds to allow readers to get an interval of decent bandwidth.

tiobench throughput is basically the same across all recent kernels.
CPU load on writes is down maybe 30% in 2.5.15.

23 years ago[PATCH] ext2: preread inode backing blocks
Andrew Morton [Sun, 19 May 2002 09:22:37 +0000 (02:22 -0700)]
[PATCH] ext2: preread inode backing blocks

When ext2 creates a new inode, perform an asynchronous preread against
its backing block.

Without this patch, many-file writeout gets stalled by having to read
many individual inode table blocks in the middle of writeback.

It's worth about a 20% gain in writeback bandwidth for the many-file
writeback case.

ext3 already reads the inode's backing block in
ext3_new_inode->ext3_mark_inode_dirty, so no change is needed there.

A backport to 2.4 would make sense.

23 years ago[PATCH] writeback tuning
Andrew Morton [Sun, 19 May 2002 09:22:24 +0000 (02:22 -0700)]
[PATCH] writeback tuning

Tune up the VM-based writeback a bit.

- Always use the multipage clustered-writeback function from within
  shrink_cache(), even if the page's mapping has a NULL ->vm_writeback().  So
  clustered writeback is turned on for all address_spaces, not just ext2.

  Subtle effect of this change: it is now the case that *all* writeback
  proceeds along the mapping->dirty_pages list.  The orderedness of the page
  LRUs no longer has an impact on disk scheduling.  So we only have one list
  to keep well-sorted rather than two, and churning pages around on the LRU
  will no longer damage write bandwidth - it's all up to the filesystem.

- Decrease the clustered writeback from 1024 pages(!) to 32 pages.

  (1024 was a leftover from when this code was always dispatching writeback
  to a pdflush thread).

- Fix wakeup_bdflush() so that it actually does write something (duh).

  do_wp_page() needs to call balance_dirty_pages_ratelimited(), so we
  throttle mmap page-dirtiers in the same way as write(2) page-dirtiers.
  This may make wakeup_bdflush() obsolete, but it doesn't hurt.

- Converts generic_vm_writeback() to directly call ->writeback_mapping(),
  rather that going through writeback_single_inode().  This prevents memory
  allocators from blocking on the inode's I_LOCK.  But it does mean that two
  processes can be writing pages from the same mapping at the same time.  If
  filesystems care about this (for layout reasons) then they should serialise
  in their ->writeback_mapping a_op.

  This means that memory-allocators will writeback only pages, not pages
  and inodes.  There are no locks in that writeback path (except for request
  queue exhaustion).  Reduces memory allocation latency.

- Implement new background_writeback function, which when kicked off
  will perform writeback until dirty memory falls below the background
  threshold.

- Put written-back pages onto the remote end of the page LRU.  It
  does this in the slow-and-stupid way at present.  pagemap_lru_lock
  stress-relief is planned...

- Remove the funny writeback_unused_inodes() stuff from prune_icache().
  Writeback from wakeup_bdflush() and the `kupdate' function now just
  naturally cleanses the oldest inodes so we don't need to do anything
  there.

- Dirty memory balancing is still using magic numbers: "after you
  dirtied your 1,000th page, go write 1,500".  Obviously, this needs
  more work.

23 years ago[PATCH] pdflush exclusion
Andrew Morton [Sun, 19 May 2002 09:22:12 +0000 (02:22 -0700)]
[PATCH] pdflush exclusion

Use the pdflush exclusion infrastructure to ensure that only one
pdlfush thread is ever performing writeback against a particular
request_queue.

This works rather well.  It requires a lot of activity against a lot of
disks to cause more pdflush threads to start up.  Possibly the
thread-creation logic is a little weak: it starts more threads when a
pdflush thread goes back to sleep.  It may be better to start new
threads within pdlfush_operation().

All non-request_queue-backed address_spaces share the global
default_backing_dev_info structure.  So at present only a single
pdflush instance will be available for background writeback of *all*
NFS filesystems (for example).

If there is benefit in concurrent background writeback for multiple NFS
mounts then NFS would need to create per-mount backing_dev_info
structures and install those into new inode's address_spaces in some
manner.

23 years ago[PATCH] pdflush exclusion infrastructure
Andrew Morton [Sun, 19 May 2002 09:22:01 +0000 (02:22 -0700)]
[PATCH] pdflush exclusion infrastructure

Collision avoidance for pdflush threads.

Turns the request_queue-based `unsigned long ra_pages' into a structure
which contains ra_pages as well as a longword.

That longword is used to record the fact that a pdflush thread is
currently writing something back against this request_queue.

Avoids the situation where several pdflush threads are sleeping on the
same request_queue.

This patch provides only the infrastructure for the pdflush exclusion.
This infrastructure gets used in pdflush-single.patch

23 years ago[PATCH] dirty inode management
Andrew Morton [Sun, 19 May 2002 09:21:48 +0000 (02:21 -0700)]
[PATCH] dirty inode management

Fix the "race with umount" in __sync_list().  __sync_list() no longer
puts inodes onto a local list while writing them out.

The super_block.sb_dirty list is kept time-ordered.  Mappings which
have the "oldest" ->dirtied_when are kept at sb->s_dirty.prev.

So the time-based writeback (kupdate) can just bale out when it
encounters a not-old-enough mapping, rather than walking the entire
list.

dirtied_when is set on the *first* dirtying of a mapping.  So once the
mapping is marked dirty it strictly retains its place on s_dirty until
it reaches the oldest end and is written out.  So frequently-dirtied
mappings don't stay dirty at the head of the list for all time.

That local inode list was there for livelock avoidance.  Livelock is
instead avoided by looking at each mapping's ->dirtied_when.  If we
encounter one which was dirtied after this invokation of __sync_list(),
then just bale out - the sync functions are only required to write out
data which was dirty at the time when they were called.

Keeping the s_dirty list in time-order is the right thing to do anyway
- so all the various writeback callers always work against the oldest
data.

23 years ago[PATCH] larger b_size, and misc fixlets
Andrew Morton [Sun, 19 May 2002 09:21:35 +0000 (02:21 -0700)]
[PATCH] larger b_size, and misc fixlets

Miscellany.

- make the printk in buffer_io_error() sector_t-aware.

- Some buffer.c cleanups from AntonA: remove a couple of !uptodate
  checks, and set a new buffer's b_blocknr to -1 in a more sensible
  place.

- Make buffer_head.b_size a 32-bit quantity.  Needed for 64k pagesize
  on ia64.  Does not increase sizeof(struct buffer_head).

23 years ago[PATCH] reiserfs locking fix
Andrew Morton [Sun, 19 May 2002 09:21:22 +0000 (02:21 -0700)]
[PATCH] reiserfs locking fix

reiserfs is using b_inode_buffers and fsync_buffers_list() for
attaching dependent buffers to its journal.  For writeout prior to
commit.

This worked OK when a global lock was used everywhere, but the locking
is currently incorrect - try_to_free_buffers() is taking a different
lock when detaching buffers from their "foreign" inode.  So list_head
corruption could occur on SMP.

The patch implements a reiserfs_releasepage() which holds the
journal-wide buffer lock while it runs try_to_free_buffers(), so all
those list_heads are protected.  The lock is held across the
try_to_free_buffers() call as well, so nobody will attach one of this
page's buffers to a list while try_to_free_buffers() is running.

23 years ago[PATCH] fix dirty page management
Andrew Morton [Sun, 19 May 2002 09:21:10 +0000 (02:21 -0700)]
[PATCH] fix dirty page management

This fixes a bug in ext3 - when ext3 decides that it wants to fail its
writepage(), it is running SetPageDirty().  But ->writepage has just put
the page on ->clean_pages().  The page ends up dirty, on ->clean_pages
and the normal writeback paths don't know about it any more.

So run set_page_dirty() instead, to place the page back on the dirty
list.

And in move_from_swap_cache(), shuffle the page across to ->dirty_pages
so that it's eligible for writeout.  ___add_to_page_cache() forgets to
look at the page state when deciding which list to attach it to.

All SetPageDirty() callers otherwise look OK.

23 years ago[PATCH] i_dirty_buffers locking fix
Andrew Morton [Sun, 19 May 2002 09:20:58 +0000 (02:20 -0700)]
[PATCH] i_dirty_buffers locking fix

This fixes a race between try_to_free_buffers' call to
__remove_inode_queue() and other users of b_inode_buffers
(fsync_inode_buffers and mark_buffer_dirty_inode()).  They are
presently taking different locks.

The patch relocates and redefines and clarifies(?) the role of
inode.i_dirty_buffers.

The 2.4 definition of i_dirty_buffers is "a list of random buffers
which is protected by a kernel-wide lock".  This definition needs to be
narrowed in the 2.5 context.  It is now

"a list of buffers from a different mapping, protected by a lock within
that mapping".  This list of buffers is specifically for fsync().

As this is a "data plane" operation, all the structures have been moved
out of the inode and into the address_space.  So address_space now has:

list_head private_list;

     A list, available to the address_space for any purpose.  If
     that address_space chooses to use the helper functions
     mark_buffer_dirty_inode and sync_mapping_buffers() then this list
     will contain buffer_heads, attached via
     buffer_head.b_assoc_buffers.

     If the address_space does not call those helper functions
     then the list is free for other usage.  The only requirement is
     that the list be list_empty() at destroy_inode() time.

     At least, this is the objective.  At present,
     generic_file_write() will call generic_osync_inode(), which
     expects that list to contain buffer_heads.  So private_list isn't
     useful for anything else yet.

spinlock_t private_lock;

     A spinlock, available to the address_space.

     If the address_space is using try_to_free_buffers(),
     mark_inode_dirty_buffers() and fsync_inode_buffers() then this
     lock is used to protect the private_list of *other* mappings which
     have listed buffers from *this* mapping onto themselves.

     That is: for buffer_heads, mapping_A->private_lock does not
     protect mapping_A->private_list!  It protects the b_assoc_buffers
     list from buffers which are backed by mapping_A and it protects
     mapping_B->private_list, mapping_C->private_list, ...

     So what we have here is a cross-mapping association.  S_ISREG
     mappings maintain a list of buffers from the blockdev's
     address_space which they need to know about for a successful
     fsync().  The locking follows the buffers: the lock in in the
     blockdev's mapping, not in the S_ISREG file's mapping.

     For address_spaces which use try_to_free_buffers,
     private_lock is also (and quite unrelatedly) used for protection
     of the buffer ring at page->private.  Exclusion between
     try_to_free_buffers(), __get_hash_table() and
     __set_page_dirty_buffers().  This is in fact its major use.

address_space *assoc_mapping

    Sigh.  This is the address of the mapping which backs the
    buffers which are attached to private_list.  It's here so that
    generic_osync_inode() can locate the lock which protects this
    mapping's private_list.  Will probably go away.

A consequence of all the above is that:

    a) All the buffers at a mapping_A's ->private_list must come
       from the same mapping, mapping_B.  There is no requirement that
       mapping_B be a blockdev mapping, but that's how it's used.

       There is a BUG() check in mark_buffer_dirty_inode() for this.

    b) blockdev mappings never have any buffers on ->private_list.
       It just never happens, and doesn't make a lot of sense.

reiserfs is using b_inode_buffers for attaching dependent buffers to its
journal and that caused a few problems.  Fixed in reiserfs_releasepage.patch

23 years ago[PATCH] check for dirtying of non-uptodate buffers
Andrew Morton [Sun, 19 May 2002 09:20:46 +0000 (02:20 -0700)]
[PATCH] check for dirtying of non-uptodate buffers

- Add a debug check to catch people who are marking non-uptodate
  buffers as dirty.

  This is either a source of data corruption, or sloppy programming.

- Fix sloppy programming in ext3 ;)

23 years ago[PATCH] reduce lock contention in do_pagecache_readahead
Andrew Morton [Sun, 19 May 2002 09:20:34 +0000 (02:20 -0700)]
[PATCH] reduce lock contention in do_pagecache_readahead

Anton Blanchard has a workload (the SDET benchmark) which is showing some
moderate lock contention in do_pagecache_readahead().

Seems that SDET has many threads performing seeky reads against a
cached file.  The average number of pagecache probes in a single
do_pagecache_readahead() is six, which seems reasonable.

The patch (from Anton) flips the locking around to optimise for the
fast case (page was present).  So the kernel takes the lock less often,
and does more work once it has been acquired.

23 years ago- sound/{core,pci}/*.c
Arnaldo Carvalho de Melo [Sun, 19 May 2002 16:49:15 +0000 (13:49 -0300)]
- sound/{core,pci}/*.c

- fix copy_{to,from}_user error handling (thanks to Rusty for pointing this out)

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.make
Linus Torvalds [Sun, 19 May 2002 04:33:51 +0000 (21:33 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.make
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agokbuild: Use $(CURDIR)
Kai Germaschewski [Sun, 19 May 2002 05:42:08 +0000 (00:42 -0500)]
kbuild: Use $(CURDIR)

Not a big change, but make provides the current directory,
so why not use it ;-)

23 years agokbuild: Suppress printing of '$(MAKE) -C command' line
Kai Germaschewski [Sun, 19 May 2002 05:41:08 +0000 (00:41 -0500)]
kbuild: Suppress printing of '$(MAKE) -C command' line

Don't print the actual command to call make in a subdir, make will
print 'Entering directory <foo>' anyway, so we don't lose that
information.

23 years agoSmall fix for net/irda/Makefile
Kai Germaschewski [Sun, 19 May 2002 05:38:38 +0000 (00:38 -0500)]
Small fix for net/irda/Makefile

This Makefile would add irlan/irlan.o to $(obj-m) when selected as
modular, which is wrong. The module will get compiled just fine after
descending into that subdirectory anyway (whereas in the current
directory we have no idea how to build it).

23 years agokbuild: Fix object-specific CFLAGS_foo.o
Kai Germaschewski [Sun, 19 May 2002 05:35:26 +0000 (00:35 -0500)]
kbuild: Fix object-specific CFLAGS_foo.o

Make CFLAGS_foo.o work also when generating preprocessed (.i) and
assembler (.s) files.

Same for AFLAGS_foo.o.

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.make
Kai Germaschewski [Sun, 19 May 2002 05:28:57 +0000 (00:28 -0500)]
Merge http://linux-isdn.bkbits.net/linux-2.5.make
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make

23 years agoMerge http://kernel-acme.bkbits.net:8080/usb-copy_tofrom_user-2.5
Linus Torvalds [Sun, 19 May 2002 04:31:14 +0000 (21:31 -0700)]
Merge http://kernel-acme.bkbits.net:8080/usb-copy_tofrom_user-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge http://kernel-acme.bkbits.net:8080/isdn-copy_tofrom_user-2.5
Linus Torvalds [Sun, 19 May 2002 04:30:42 +0000 (21:30 -0700)]
Merge http://kernel-acme.bkbits.net:8080/isdn-copy_tofrom_user-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agodrivers/usr/*.c
Arnaldo Carvalho de Melo [Sun, 19 May 2002 01:25:13 +0000 (22:25 -0300)]
drivers/usr/*.c

- fix copy_{to,from}_user error handling (thanks to Rusty for pointing this out)

23 years agodrivers/isdn/*.c
Arnaldo Carvalho de Melo [Sun, 19 May 2002 00:56:44 +0000 (21:56 -0300)]
drivers/isdn/*.c

- fix copy_{to,from}_user error handling (thanks to Rusty for pointing this out)

23 years agoUpdate /BitKeeper/etc/ignore
Kai Germaschewski [Sat, 18 May 2002 20:17:08 +0000 (15:17 -0500)]
Update /BitKeeper/etc/ignore

.<object>.flags are gone, but we have .<object>.cmd instead now and
surely don't want to add the to the repository.

23 years agoMakefile: fix merge
Kai Germaschewski [Sat, 18 May 2002 20:14:47 +0000 (15:14 -0500)]
Makefile: fix merge

23 years agoMerge http://kernel-acme.bkbits.net:8080/oss-copy_tofrom_user-2.5
Linus Torvalds [Sat, 18 May 2002 16:20:50 +0000 (09:20 -0700)]
Merge http://kernel-acme.bkbits.net:8080/oss-copy_tofrom_user-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge kernel-acme@kernel-acme.bkbits.net:oss-copy_tofrom_user-2.5
Arnaldo Carvalho de Melo [Sun, 19 May 2002 00:04:57 +0000 (21:04 -0300)]
Merge kernel-acme@kernel-acme.bkbits.net:oss-copy_tofrom_user-2.5
into conectiva.com.br:/home/acme/bk/oss-copy_tofrom_user-2.5

23 years agodrivers/sound/*.c
Arnaldo Carvalho de Melo [Sat, 18 May 2002 23:58:25 +0000 (20:58 -0300)]
drivers/sound/*.c

- fix copy_{to,from}_user error handling (thanks to Rusty for pointing this out)

23 years agofs/intermezzo/ext_attr.c
Arnaldo Carvalho de Melo [Sat, 18 May 2002 23:02:04 +0000 (20:02 -0300)]
fs/intermezzo/ext_attr.c
fs/intermezzo/kml.c
fs/intermezzo/psdev.c

- fix copy_{to,from}_user error handling (thans to Rusty for pointing this out)

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.isdn
Linus Torvalds [Sat, 18 May 2002 15:37:40 +0000 (08:37 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.isdn
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoManual merge
Linus Torvalds [Sat, 18 May 2002 15:37:02 +0000 (08:37 -0700)]
Manual merge

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.make
Linus Torvalds [Sat, 18 May 2002 15:30:07 +0000 (08:30 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.make
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge http://linux-isdn.bkbits.net/linux-2.5.make-next
Linus Torvalds [Sat, 18 May 2002 15:28:26 +0000 (08:28 -0700)]
Merge http://linux-isdn.bkbits.net/linux-2.5.make-next
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge http://kernel-acme.bkbits.net:8080/intermezzo-copy_tofrom_user-2.5
Linus Torvalds [Sat, 18 May 2002 15:26:30 +0000 (08:26 -0700)]
Merge http://kernel-acme.bkbits.net:8080/intermezzo-copy_tofrom_user-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
Kai Germaschewski [Sat, 18 May 2002 09:00:21 +0000 (04:00 -0500)]
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make-as

23 years agoMerge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
Kai Germaschewski [Sat, 18 May 2002 06:50:05 +0000 (01:50 -0500)]
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.isdn

23 years agoMerge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
Kai Germaschewski [Sat, 18 May 2002 06:29:00 +0000 (01:29 -0500)]
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make.next

23 years agoMerge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
Kai Germaschewski [Sat, 18 May 2002 06:27:44 +0000 (01:27 -0500)]
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make

23 years ago[PATCH] kNFSd cleanup of nfsd_open
Christoph Hellwig [Sat, 18 May 2002 05:03:58 +0000 (22:03 -0700)]
[PATCH] kNFSd cleanup of nfsd_open

This patch makes nfsd_open use init_private_file to initilize
the file pointer the caller had allocated on stack.  In addition
a number of small cleanups:

 - format comments to be readable on 80char ANSI terminal
 - don't fop_get (and fop_put in nfsd_close), out file already
   is a reference to the inode so they can't go away.
 - don't decrement f_count on failure - it won't be checked anyway
 - don't check for filp->f_op n nfsd_close, it can't be NULL

23 years ago[PATCH] Small cleanup of nfsd export checks
Christoph Hellwig [Sat, 18 May 2002 05:03:45 +0000 (22:03 -0700)]
[PATCH] Small cleanup of nfsd export checks

Separate checks for !FS_REQUIRES_DEV and missing fsid option
and missing export operations, second check for missing export
operations and a small cleanup as side effect.

23 years ago[PATCH] Initial md/raid5 support for 2.5 (with bio)
Neil Brown [Sat, 18 May 2002 05:03:33 +0000 (22:03 -0700)]
[PATCH] Initial md/raid5 support for 2.5 (with bio)

With this patch raid5 works.  There is still some more
work to though.

- uses bio instead of buffer_head
- stripe cache is now a fixed size.
   If read requests are smaller, we read the whole block anyway
   If write reqeusts are smaller, we pre-read.
- stripe_head is now variable sized with an array of structures at
  the end.  We allocate extra space depending on how many devices
  are in the array.
  stripe_head has it's very own slab cache.
- store and use bdev for each device in array

by-passing the cache for reads is currently disabled.  I need to
think through the implications (and implementation) of allowing
large bion that are larger than the stripe cache to go directly
to the device (if it isn't failed of-course).

23 years ago[PATCH] Tidy up raid5 code
Neil Brown [Sat, 18 May 2002 05:03:19 +0000 (22:03 -0700)]
[PATCH] Tidy up raid5 code

- remove md_ prefix from some calls that used to be
  defined in md_compatability.h

- remove "raid5_" prefix from some static functions,
  in line with recent changes to raid1.c

?? should cpu_has_mmx be moved to in processor.h ?

23 years ago[PATCH] Change MD Superblock IO to go straight to submit_bio
Neil Brown [Sat, 18 May 2002 05:03:08 +0000 (22:03 -0700)]
[PATCH] Change MD Superblock IO to go straight to submit_bio

The current code hits the page cache for the block device
which requires memory allocation which can sometimes cause
a deadlock (if it blocks the raid5d thread).

This code takes the page that holds the superblock, and
passes it to submit_bh in a suitable bio wrapper.

23 years ago[PATCH] Increase snd buffer size for UDP
Neil Brown [Sat, 18 May 2002 05:02:56 +0000 (22:02 -0700)]
[PATCH] Increase snd buffer size for UDP

I under-allocated the space that RPC needs for transmit on a UDP
socket.   We need lots of space to be allowed (though we may not use
much) so that a lack of un-commited transmit space will not cause new
requests to be blocked.

23 years ago[PATCH] reiserfs bitops warnings
Chris Mason [Sat, 18 May 2002 05:00:15 +0000 (22:00 -0700)]
[PATCH] reiserfs bitops warnings

This fixes reiserfs compile warnings for a few bitops calls.

23 years ago[PATCH] reiserfs iput deadlock fix
Chris Mason [Sat, 18 May 2002 05:00:03 +0000 (22:00 -0700)]
[PATCH] reiserfs iput deadlock fix

This patch5 changes reiserfs_new_inode to end the transaction on errors
(like -ENOSPC), so that it can call iput without deadlocking against the
journal.

23 years ago[PATCH] cleanup read/write
Christoph Hellwig [Sat, 18 May 2002 04:58:06 +0000 (21:58 -0700)]
[PATCH] cleanup read/write

Currently sys_read/sys_pread and sys_write/sys_pwrite basically contain
lots of duplication of the same checks/code.

This moves all that into vfs_read/vfs_write helpers that have the same
prototypes as the read/write file operations.  In addition I have
choosen to export these interfaces to module so people doing inkernel
file reading/writing can use these instead of duplicating the checks
(which is very likely to be done wrong).

23 years ago[PATCH] Thread group exit problem reappeared
Dave McCracken [Sat, 18 May 2002 04:36:41 +0000 (21:36 -0700)]
[PATCH] Thread group exit problem reappeared

A long time ago there was thread group code that at exit time tried to
reparent a task to another task in the thread group.  I discovered a major
race condition in this code, and submitted a patch that removed it.  This
patch was accepted in, I think, 2.4.12.  The code reappeared in 2.4.18 and
sometime in the 2.5 tree before 2.5.15, breaking applications that use
thread groups.

As part of chasing this down, I figured out a way to remove the race
condition while still preserving this behavior.  I've attached a patch
against 2.5.15 that fixes it.

23 years agoMerge bk://bkbits.ras.ucalgary.ca/rgooch-2.5 v2.5.16
Linus Torvalds [Fri, 17 May 2002 17:03:34 +0000 (10:03 -0700)]
Merge bk://bkbits.ras.ucalgary.ca/rgooch-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years ago[PATCH] fix scsi oops on failed sg table allocation
Jens Axboe [Fri, 17 May 2002 17:02:37 +0000 (10:02 -0700)]
[PATCH] fix scsi oops on failed sg table allocation

This patch fixes the deliberate BUG_ON() on failed sgtable allocations.
I left that in because I was too lazy to fix it at the time...

Basically make scsi_init_io() return 0 on failure (like before) but this
time allow us to recover. scsi_init_io() will end_request on a fatal
condition. So now just mark the device/host as starved if needed, and
leave the request at the front of the queue for next service.

23 years ago[PATCH] Fixed the handling of file name containing 0x05 on vfat
Hirofumi Ogawa [Fri, 17 May 2002 17:01:24 +0000 (10:01 -0700)]
[PATCH] Fixed the handling of file name containing 0x05 on vfat

This patch fixes the behavior of vfatfs when the file name contains 0x05.

23 years ago[PATCH] Micro Memory battery backed RAM card driver
Neil Brown [Fri, 17 May 2002 16:58:13 +0000 (09:58 -0700)]
[PATCH] Micro Memory battery backed RAM card driver

New driver for Micro Memory NVRAM module

This driver handles up to 16 PCI based NVRAM cards
from MicroMemory.
Each card appears like a block device, and can be partitioned
using any standard partitioning tool.  Upto 15 partitions are
supported.

This driver needs its own major device number and so allocates
one using register_blkdev.

23 years agoMerge http://gkernel.bkbits.net/net-drivers-2.5
Linus Torvalds [Fri, 17 May 2002 16:53:30 +0000 (09:53 -0700)]
Merge http://gkernel.bkbits.net/net-drivers-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge http://gkernel.bkbits.net/irda-2.5
Linus Torvalds [Fri, 17 May 2002 16:52:53 +0000 (09:52 -0700)]
Merge http://gkernel.bkbits.net/irda-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux

23 years agoMerge http://gkernel.bkbits.net/misc-2.5
Linus Torvalds [Fri, 17 May 2002 16:52:22 +0000 (09:52 -0700)]
Merge http://gkernel.bkbits.net/misc-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux