Dave Kleikamp [Fri, 5 Sep 2003 05:38:49 +0000 (22:38 -0700)]
[PATCH] New version of jfsutils needed
A recent change to the 2.6.0 kernel has changed the behavior of opening a
block device with the O_EXCL flag. This can cause fsck.jfs to fail to
replay the journal when a file system is mounted read-only.
The JFS utilities have been fixed, and it is recommended that any users of
JFS update the utilities to version 1.1.3.
Alexander Viro [Fri, 5 Sep 2003 03:55:21 +0000 (20:55 -0700)]
[PATCH] large dev_t - second series (15/15)
old_decode_dev()/old_encode_dev() added where needed in other
filesystems. Parts in different filesystems are independent, but IMO
it's not worse splitting into a dozen of half-kilobyte patches.
Alexander Viro [Fri, 5 Sep 2003 03:54:53 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (12/15)
Similar fix for UFS; touching device node (and they have 32bit
dev_t) ends up killing upper 16 bits, which makes for very unhappy
*BSD, since that turns /dev/ad0s1 into alias of /dev/ad0. Again, for
now we store on-disk value in private part of inode and use it instead
of ->i_rdev in ->write_inode().
Alexander Viro [Fri, 5 Sep 2003 03:54:44 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (11/15)
Fix for JFS handling of device nodes; it has 32bit on-disk device
numbers, shoves them into 16bit (->i_rdev) when inode is read and writes
them back truncated when inode is written to disk. For now (and 2.4 will
have to do the same permanently) we store the original value in private
part of inode and use it instead of ->i_rdev in ->write_inode(); mknod()
sets it at the same time as ->i_rdev. It will become unnecessary when
dev_t becomes wider than 16 bits, but for now we need it.
Alexander Viro [Fri, 5 Sep 2003 03:54:36 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (10/15)
Fix for endianness bug in UDF: it writes major and minor as 32bit
host-endian and reads them as 32bit little-endian; obviously a bad idea
on big-endian boxen ;-) Needed both for 2.4 and 2.6.
Alexander Viro [Fri, 5 Sep 2003 03:54:27 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (9/15)
beginning of fs side work:
* new helpers - old_valid_dev(), old_encode_dev() and old_decode_dev()
* old_valid_dev() checks if dev_t value is OK for old filesystems
(i.e. both major and minor are below 256).
* old_valid_dev() calls are added in ->mknod() instances that care
about dev_t values (disk-backed and network ones).
* old_encode_dev() and old_decode_dev() convert dev_t -> u16
and u16 -> dev_t resp; currently these are no-ops, places that use current
formar (minor in bits 0--7, major in bits 8--15) will switch to these before
we widen dev_t.
Alexander Viro [Fri, 5 Sep 2003 03:53:56 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (6/15)
tty redirect handling sanitized. Such ttys (/dev/tty and
/dev/console) get a different file_operations; its ->write() handles
redirects; checks for file->f_op == &tty_fops updated, checks for
major:minor being that of a redirector replaced with check for
->f_op->write value. Piece of code in tty_io.c that had been #if 0
since 0.99<something> had been finally put out of its misery. kdev_val()
is gone.
Alexander Viro [Fri, 5 Sep 2003 03:53:47 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (5/15)
cdevname() killed, there was only one remaining user
(tty_paranoia_check()) and in that case cdevname() was worse
than plain major:minor (basically, it's "you've got corrupted
inode that was supposed to belong to tty device; here's what
I'd found in ->i_rdev")
Alexander Viro [Fri, 5 Sep 2003 03:53:38 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (4/15)
cciss cleanup - instead of playing with device numbers, we add
helper functions that get host and drive structures by gendisk and use
them in open/ioctl/release, same as had been done for cpqarray.
Russell King [Fri, 5 Sep 2003 17:36:50 +0000 (18:36 +0100)]
[ARM] Don't read the CPU control reg back - it may be write only.
Some ARM CPUs don't allow CP15 CR1 control register to be read.
Therefore, to ensure that the value hits the control register on
Xscale, read back the CP15 CR0 ID register instead.
Russell King [Fri, 5 Sep 2003 17:28:53 +0000 (18:28 +0100)]
[ARM] Restore preempt count before reporting unbalanced preempt count
On ARM, we oops when we detect that an interrupt handler has unbalanced
the preempt count. We should restore the preempt count when we started
to handle the interrupt and then cause the oops.
[PATCH] incomplete asm constraints in arch/i386/pci/pcbios.c
This fixes a "miscompile" HP reported against gcc 3.3 with
-march-pentium4. It turned out to be a non-complete asm contraint. the
existing constraint on "opt" was on the address of "opt", which allowed
gcc to reorder the setting of the fields inside opt to beyond the asm
that uses it, which is less than useful at best.
This changes the way futexes are indexed, so that they don't pin pages.
It also fixes some bugs with private mappings and COW pages.
Currently, all futexes look up the page at the userspace address and pin
it, using the pair (page,offset) as an index into a table of waiting
futexes. Any page with a futex waiting on it remains pinned in RAM,
which is a problem when many futexes are used, especially with FUTEX_FD.
Another problem is that the page is not always the correct one, if it
can be changed later by a COW (copy on write) operation. This can
happen when waiting on a futex without writing to it after fork(),
exec() or mmap(), if the page is then written to before attempting to
wake a futex at the same adress.
There are two symptoms of the COW problem:
- The wrong process can receive wakeups
- A process can fail to receive required wakeups.
This patch fixes both by changing the indexing so that VM_SHARED
mappings use the triple (inode,offset,index), and private mappings use
the pair (mm,virtual_address).
The former correctly handles all shared mappings, including tmpfs and
therefore all kinds of shared memory (IPC shm, /dev/shm and
MAP_ANON|MAP_SHARED). This works because every mapping which is
VM_SHARED has an associated non-zero vma->vm_file, and hence inode.
(This is ensured in do_mmap_pgoff, where it calls shmem_zero_setup).
The latter handles all private mappings, both files and anonymous. It
isn't affected by COW, because it doesn't care about the actual pages,
just the virtual address.
The patch has a few bonuses:
1. It removes the vcache implementation, as only futexes were
using it, and they don't any more.
2. Removing the vcache should make COW page faults a bit faster.
3. Futex operations no longer take the page table lock, walk
the page table, fault in pages that aren't mapped in the
page table, or do a vcache hash lookup - they are mostly a
simple offset calculation with one hash for the futex
table. So they should be noticably faster.
Special thanks to Hugh Dickins, Andrew Morton and Rusty Russell for
insightful feedback. All suggestions are included.
* get rid of leftover sti
* no longer need MOD_INC/DEC stuff
* get rid of dead code related to MOD_INC/DEC
* use module_init/module_exit to cleanly run init code
[SCTP] Move a local variable declaration ahead of the function code.
Apparently the new gcc 3.2.2 allows local variable declarations within
the code of a function if it is not used earlier. But older gcc's do
not allow this.
Dave Jones [Thu, 4 Sep 2003 04:02:49 +0000 (05:02 +0100)]
[CPUFREQ] Remove the voltage scaling from longhaul driver.
The 'match voltage to frequency' routine is complete crap and needs
rewriting. (It also only works for a single stepping of C3)
I'll redo it when I find the specs again.
In the meantime, it doesn't work properly, so kill it.
Cleanup ikconfig
- use single_open for built_with file.
- get rid of unneeded globals
- use copy_to_user instead of char at a time
- only need the read routine, proc defaults to correct behaviour
for the rest.
Dave Jones [Thu, 4 Sep 2003 03:51:33 +0000 (04:51 +0100)]
[CPUFREQ] Inform user of status of Ezra-T/Nehemiah longhaul support.
These are currently unsupported, and I get quite a lot of mails
asking about it. Hopefully this will be a little more informative
than 'unknown CPU'.
Dave Jones [Thu, 4 Sep 2003 03:23:31 +0000 (04:23 +0100)]
[CPUFREQ] Fix longhaul's mult,fsb -> MHz conversions.
this was wrong in several places by a factor of 100.
Introduce a calc_speed helper to make this harder to get wrong.
Additionally, clean up some printk's to print out useful values
like MinMult=3.5x instead of MinMult(x10)=35.
James Bottomley [Thu, 4 Sep 2003 03:13:28 +0000 (20:13 -0700)]
[PATCH] fix remap of shared read only mappings
When mmap MAP_SHARED is done on a file, it gets marked with VM_MAYSHARE
and, if it's read/write, VM_SHARED. However, if it is remapped with
mremap(), the MAP_SHARED is only passed into the new mapping based on
VM_SHARED. This means that remapped read only MAP_SHARED mappings lose
VM_MAYSHARE. This is causing us a problem on parisc because we have to
align all shared mappings carefully to mitigate cache aliasing problems.
The fix is to key passing the MAP_SHARED flag back into the remapped are
off VM_MAYSHARE not VM_SHARED.
[PATCH] ide: remove supports_dma field from ide_driver_t
driver->supports_dma was used together with CONFIG_IDEDMA_ONLYDISK to limit
DMA access to disk devices only. However Alan introduced new scheme in 2.5.63
and this field is not needed any longer because all ide drivers support DMA.
Russell King [Thu, 4 Sep 2003 02:43:03 +0000 (19:43 -0700)]
[PATCH] Don't #ifdef prototypes
It seems that changing CONFIG_BLK_DEV_INITRD causes the whole kernel to
rebuild due to an inappropriate ifdef in linux/fs.h - we should not
conditionalise prototypes.
In addition, real_root_dev is only used by two files (kernel/sysctl.c
and init/do_mounts_initrd.c) so it makes even less sense that it was in
linux/fs.h
Andrew Morton [Wed, 3 Sep 2003 18:14:04 +0000 (11:14 -0700)]
[PATCH] hermes.h fails with outw_p() in :?
From: Michael Pruznick <michael_pruznick@mvista.com>
build errors:
hermes.h: In function `hermes_set_irqmask':
hermes.h:337: parse error before "do"
hermes.h:337: parse error before ';' token
hermes.h: In function `hermes_write_words':
In mips, outw_p() is a #define do...while(0) which, in the case of ?:,
results in a statement being used where an expression is required.
Andrew Morton [Wed, 3 Sep 2003 18:13:39 +0000 (11:13 -0700)]
[PATCH] i8042 free_irq() aliasing fix
The same address `i8042_request_irq_cookie' is used in three places for the
i8042 request_irq() argument. This means that if someone calls
i8042_check_mux() or i8042_check_aux() while the IRQ is in use, the
free_irq() call in there will free the wrong IRQ handler.
So give all three instances of request_irq() in i8042.c a distinct address by
which to identify the IRQ instance.
(This is probably a non-bug, because the `check' functions are not called
when the device is open, but it is better this way).
Andrew Morton [Wed, 3 Sep 2003 18:13:22 +0000 (11:13 -0700)]
[PATCH] Enable SELinux via boot parameter
From: James Morris <jmorris@redhat.com>
This patch adds an 'selinux' boot parameter which must be used to actually
enable SELinux.
It follows some internal discussion about deployment issues, where a vendor
would want to ship a single kernel image with SELinux built-in, without
requiring the user to use it.
Without specifying selinux=1 as a boot parameter, SELinux will not register
with LSM and selinuxfs will not be registered as a filesystem. This causes
SELinux to be bypassed entirely from then on, and no performance overhead
is imposed. Other security modules may then also be loaded if needed.
Andrew Morton [Wed, 3 Sep 2003 18:13:12 +0000 (11:13 -0700)]
[PATCH] Remove percpufication of in_flight counter in
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
The routine disk_round_stats showed up considerably under oprofile for high
disk io load (four processes doing dd to the same disk (different
partitions) on a 4 way).
This is because the counter in_flight which is per-cpu right now gets read
every time disk_round_stats gets called. Per cpu counters like disk
statistics improve write speed, but reads are slow (since all cpus' local
counter values have to be read and summed up). Considering the fact that
in_flight counter is modified post disk_round_stats (which reads the
in_flight counter) it is better not to per-cpu this counter.
Following patch does just that. Below is the profile comparison before and
after the change. This was on a 4 way PIII Xeon, 1G ram, 2.6.0-test4-mm2.
Andrew Morton [Wed, 3 Sep 2003 18:13:04 +0000 (11:13 -0700)]
[PATCH] MODULE_ALIAS() in char devices
From: Rusty Russell <rusty@rustcorp.com.au>
Previously, default aliases were hardwired into modutils. Now they should
be inside the modules, using MODULE_ALIAS() (they will be overridden by any
user alias).
Andrew Morton [Wed, 3 Sep 2003 18:12:53 +0000 (11:12 -0700)]
[PATCH] MODULE_ALIAS() in block devices
From: Rusty Russell <rusty@rustcorp.com.au>
Previously, default aliases were hardwired into modutils. Now they should
be inside the modules, using MODULE_ALIAS() (they will be overridden by any
user alias).
Andrew Morton [Wed, 3 Sep 2003 18:12:43 +0000 (11:12 -0700)]
[PATCH] might_sleep() improvements
From: Mitchell Blank Jr <mitch@sfgoth.com>
This patch makes the following improvements to might_sleep():
o Add a "might_sleep_if()" macro for when we might sleep only if some
condition is met. It's a bit tidier, and has an unlikely() in it.
o Add might_sleep checks to skb_share_check() and skb_unshare() which
sometimes need to allocate memory.
o Make all architectures call might_sleep() in both down() and
down_interruptible(). Before only ppc, ppc64, and i386 did this check.
(sh did the check on down() but not down_interruptible())
Andrew Morton [Wed, 3 Sep 2003 18:12:08 +0000 (11:12 -0700)]
[PATCH] elevator insertion fixes
From: Nick Piggin <piggin@cyberone.com.au>
This fixes a bug in deadline and AS that causes insert_here to be ignored on
blk_fs_requests. This has been causing problems with SCSI requeueing code.
It makes elevator insertion more correct as advertised wrt insert_here and
REQ_SOFTBARRIER.
It also fixes a buglet in the as_requeue code where the request wasn't being
put into the front of the list (in rare cases).