03 Apr, 2009
40 commits
-
Pass the original flags to rwlock arch-code, so that it can re-enable
interrupts if implemented for that architecture.Initially, make __raw_read_lock_flags and __raw_write_lock_flags stubs
which just do the same thing as non-flags variants.Signed-off-by: Petr Tesarik
Signed-off-by: Robin Holt
Acked-by: Peter Zijlstra
Cc:
Acked-by: Ingo Molnar
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
SGI has observed that on large systems, interrupts are not serviced for a
long period of time when waiting for a rwlock. The following patch series
re-enables irqs while waiting for the lock, resembling the code which is
already there for spinlocks.I only made the ia64 version, because the patch adds some overhead to the
fast path. I assume there is currently no demand to have this for other
architectures, because the systems are not so large. Of course, the
possibility to implement raw_{read|write}_lock_flags for any architecture
is still there.This patch:
The new macro LOCK_CONTENDED_FLAGS expands to the correct implementation
depending on the config options, so that IRQ's are re-enabled when
possible, but they remain disabled if CONFIG_LOCKDEP is set.Signed-off-by: Petr Tesarik
Signed-off-by: Robin Holt
Cc:
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make ufs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Evgeniy Dushistov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make sysv file system return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make squashfs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Phillip Lougher
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make reiserfs3 return f_fsid info for statfs(2). By Andreas' suggestion,
this patch populates a persistent f_fsid between boots/mounts with help of
on-disk uuid record.Randy Dunlap reported a compiling error from v2 patch like:
fs/built-in.o: In function `reiserfs_statfs':
super.c:(.text+0x7332b): undefined reference to `crc32_le'
super.c:(.text+0x7333f): undefined reference to `crc32_le'
Also he provided helpful solution to fix this error. The modification of v3
patch is based on Randy's suggestion, add 'select CRC32' in fs/reiserfs/Kconfig.Signed-off-by: Coly Li
Cc: Randy Dunlap
Cc: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make qnx4 file system return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Acked-by: Anders Larsen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make omfs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Acked-by: Bob Copeland
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make minix file system return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make isofs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Jan Kara
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make hpfs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Mikulas Patocka
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make hfsplus return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Roman Zippel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make hfs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Roman Zippel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make fat return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Acked-by: OGAWA Hirofumi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make efs return f_fsid info for statfs(2), and do a little variable
renaming in efs_statfs().Signed-off-by: Coly Li
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make cramfs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make befs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Sergey S. Kostyliov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make affs return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Roman Zippel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Currently many file systems in Linux kernel do not return f_fsid in statfs
info, the value is set as 0 in vfs layer. Anyway, in some conditions,
f_fsid from statfs(2) is useful, especially being used as (f_fsid, ino)
pair to uniquely identify a file.Basic idea of the patches is generating a unique fs ID by
huge_encode_dev(sb->s_bdev->bd_dev) during file system mounting life time
(no endian consistent issue). sb is a point of struct super_block of
current mounted file system being accessed by statfs(2).This patch:
Make adfs return f_fsid info for statfs(2), and do a little variable
renaming in adfs_statfs().Signed-off-by: Coly Li
Cc: Roman Zippel
Cc: "Sergey S. Kostyliov"
Cc: OGAWA Hirofumi
Cc: Mikulas Patocka
Cc: Dave Kleikamp
Cc: Bob Copeland
Cc: Anders Larsen
Cc: Phillip Lougher
Cc: Christoph Hellwig
Cc: Evgeniy Dushistov
Cc: Jan Kara
Cc: Andreas Dilger
Cc: Jamie Lokier
Cc: Theodore Ts'o
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Gerd Hoffmann
Cc: Arnd Bergmann
Cc: Al Viro
Cc:
Cc:
Cc: Ralf Baechle
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Ralf Baechle
Signed-off-by: Gerd Hoffmann
Cc: Arnd Bergmann
Cc: Al Viro
Cc:
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch adds preadv and pwritev system calls. These syscalls are a
pretty straightforward combination of pread and readv (same for write).
They are quite useful for doing vectored I/O in threaded applications.
Using lseek+readv instead opens race windows you'll have to plug with
locking.Other systems have such system calls too, for example NetBSD, check
here: http://www.daemon-systems.org/man/preadv.2.htmlThe application-visible interface provided by glibc should look like
this to be compatible to the existing implementations in the *BSD family:ssize_t preadv(int d, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t pwritev(int d, const struct iovec *iov, int iovcnt, off_t offset);This prototype has one problem though: On 32bit archs is the (64bit)
offset argument unaligned, which the syscall ABI of several archs doesn't
allow to do. At least s390 needs a wrapper in glibc to handle this. As
we'll need a wrappers in glibc anyway I've decided to push problem to
glibc entriely and use a syscall prototype which works without
arch-specific wrappers inside the kernel: The offset argument is
explicitly splitted into two 32bit values.The patch sports the actual system call implementation and the windup in
the x86 system call tables. Other archs follow as separate patches.Signed-off-by: Gerd Hoffmann
Cc: Arnd Bergmann
Cc: Al Viro
Cc:
Cc:
Cc: Ralf Baechle
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: "H. Peter Anvin"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Factor out some code from compat_sys_writev() which can be shared with the
upcoming compat_sys_pwritev().Signed-off-by: Gerd Hoffmann
Cc: Arnd Bergmann
Cc: Al Viro
Cc:
Cc:
Cc: Ralf Baechle
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch series:
Implement the preadv() and pwritev() syscalls. *BSD has this syscall for
quite some time.Test code:
#if 0
set -x
gcc -Wall -O2 -o preadv $0
exit 0
#endif
/*
* preadv demo / test
*
* (c) 2008 Gerd Hoffmann
*
* build with "sh $thisfile"
*/#include
#include
#include
#include
#include
#include/* ----------------------------------------------------------------- */
/* syscall windup */#include
#if 0
/* WARNING: Be sure you know what you are doing if you enable this.
* linux syscall code isn't upstream yet, syscall numbers are subject
* to change */
# ifndef __NR_preadv
# ifdef __i386__
# define __NR_preadv 333
# define __NR_pwritev 334
# endif
# ifdef __x86_64__
# define __NR_preadv 295
# define __NR_pwritev 296
# endif
# endif
#endif
#ifndef __NR_preadv
# error preadv/pwritev syscall numbers are unknown
#endifstatic ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
uint32_t pos_high = (offset >> 32) & 0xffffffff;
uint32_t pos_low = offset & 0xffffffff;return syscall(__NR_preadv, fd, iov, iovcnt, pos_high, pos_low);
}static ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
uint32_t pos_high = (offset >> 32) & 0xffffffff;
uint32_t pos_low = offset & 0xffffffff;return syscall(__NR_pwritev, fd, iov, iovcnt, pos_high, pos_low);
}/* ----------------------------------------------------------------- */
/* demo/test app */static char filename[] = "/tmp/preadv-XXXXXX";
static char outbuf[11] = "0123456789";
static char inbuf[11] = "----------";static struct iovec ovec[2] = {{
.iov_base = outbuf + 5,
.iov_len = 5,
},{
.iov_base = outbuf + 0,
.iov_len = 5,
}};static struct iovec ivec[3] = {{
.iov_base = inbuf + 6,
.iov_len = 2,
},{
.iov_base = inbuf + 4,
.iov_len = 2,
},{
.iov_base = inbuf + 2,
.iov_len = 2,
}};void cleanup(void)
{
unlink(filename);
}int main(int argc, char **argv)
{
int fd, rc;fd = mkstemp(filename);
if (-1 == fd) {
perror("mkstemp");
exit(1);
}
atexit(cleanup);/* write to file: "56789-01234" */
rc = pwritev(fd, ovec, 2, 0);
if (rc < 0) {
perror("pwritev");
exit(1);
}/* read from file: "78-90-12" */
rc = preadv(fd, ivec, 3, 2);
if (rc < 0) {
perror("preadv");
exit(1);
}printf("result : %s\n", inbuf);
printf("expected: %s\n", "--129078--");
exit(0);
}This patch:
Factor out some code from compat_sys_readv() which can be shared with the
upcoming compat_sys_preadv().Signed-off-by: Gerd Hoffmann
Cc: Arnd Bergmann
Cc: Al Viro
Cc:
Cc:
Cc: Ralf Baechle
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Decompression errors can arise due to corruption of compressed blocks on
flash or in memory. This patch propagates errors detected during
decompression back to the block layer.Signed-off-by: David VomLehn
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Fix a minor compile warning when building on ia64.
drivers/misc/sgi-xp/xpc_sn2.c: In function `xpc_clear_remote_msgqueue_flags_sn2':
drivers/misc/sgi-xp/xpc_sn2.c:1746: warning: comparison of distinct pointer types lacks a castSigned-off-by: Robin Holt
Cc: Sam Ravnborg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Some current configs turn on GRU for ia64. The GRU code does not
correctly load on boot on ia64 (GRU does continue to work for x86-64), so
changing the IA64 Kconfig to not select GRU on ia64 configs for now until
we have time to fix.Signed-off-by: Robin Holt
Acked-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add multiple pagesize support to the GRU driver.
Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Fix bugs related to module unload of the GRU driver.
Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add macro for scanning all active GRU chiplets. Maximum chiplet id is
saved during GRU initialization.Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add support to the GRU driver for message queue interrupts.
Signed-off-by: Jack Steiner
Signed-off-by: Dean Nelson
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Restructure the GRU vtop functions in preparation for future changes.
This patch simply moves code around & does not change the algorithm.Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch fixes bugs related to ASID (context id) management in the GRU
driver. These changes are all internal to the SGI GRU driver and have no
effect on the base kernel.Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add support for a user to explicitly unload a GRU context.
Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add statistics to the GRU context management functions.
Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Change the GRU instructions that manage contexts from inline functions to
out-of-line functions. This simplifies adding statistics & error checking
to these functions.Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Improvements to GRU debug messages & statistics.
Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Misc trivial GRU drivers fixes:
- fix long lines
- eliminate extra whitespace
- eliminate compiler warning
- better validation of invalidate user parameters
- bug fix for GRU TLB flush (not the cpu TLB flush)These changes are all internal to the SGI GRU driver and have no effect
on the base kernel.Signed-off-by: Jack Steiner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add macros for using the UV hub to send interrupts. Change the IPI code
to use these macros. These macros will also be used in additional patches
that will follow.Signed-off-by: Jack Steiner
Cc: "Luck, Tony"
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: "H. Peter Anvin"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add definitions for IA64 GRU MMRs.
Signed-off-by: Jack Steiner
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds