Alan Cox [Fri, 3 Sep 2004 03:28:28 +0000 (20:28 -0700)]
[PATCH] Root reservations for strict overcommit
This was on my TODO list for a while and it turns out someone already fixed
the armwaving overcommit mode for the same problem. It is easy to get into
a situation where you have no overcommit and nothing can be done because
there is no memory to clean up the stable but non-useful state of the
machine.
The fix is trivial and duplicated from the armwaving overcommit code path.
The last 3% of the memory can be claimed by root processes only. It isn't
a cure but it does seem to solve the real world problems - at least
providing you have enough memory for 3% to be useful 8).
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Adrian Bunk [Fri, 3 Sep 2004 03:28:16 +0000 (20:28 -0700)]
[PATCH] pcxx.c build fix
CC drivers/char/pcxx.o
drivers/char/pcxx.c: In function `pcxe_cleanup':
drivers/char/pcxx.c:209: warning: unused variable `e2'
drivers/char/pcxx.c: At top level:
drivers/char/pcxx.c:229: `pcxe_init' undeclared here (not in a function)
drivers/char/pcxx.c:230: warning: type defaults to `int' in declaration of `module_cleanup'
drivers/char/pcxx.c:230: warning: parameter names (without types) in function declaration
drivers/char/pcxx.c:230: warning: data definition has no type or storage class
drivers/char/pcxx.c:1016: redefinition of `__initcall_pcxe_init'
drivers/char/pcxx.c:229: `__initcall_pcxe_init' previously defined here
drivers/char/pcxx.c:1016: `pcxe_init' undeclared here (not in a function)
drivers/char/pcxx.c:1017: `pcxe_exit' undeclared here (not in a function)
drivers/char/pcxx.c: In function `pcxe_tiocmget':
drivers/char/pcxx.c:2009: `mstat' undeclared (first use in this function)
drivers/char/pcxx.c:2009: (Each undeclared identifier is reported only once
drivers/char/pcxx.c:2009: for each function it appears in.)
drivers/char/pcxx.c: In function `pcxe_tiocmset':
drivers/char/pcxx.c:2072: warning: control reaches end of non-void function
drivers/char/pcxx.c: At top level:
drivers/char/pcxx.c:1044: warning: `pcxe_init' defined but not used
Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch has some minor cleanups for the v4l i2c modules: Don't ignore
the i2c_add_driver return value and mark the init+exit functions with
__init + __exit.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] read_ldt() neglects to check clear_user() return value
akpm: It's a bit debatable. The user passed in a buffer of a particular size,
and we successfully sopied the LDT info into it, but we got a fault when
clearing out the rest of the user's buffer. Is that worth a -EFAULT?
Bálint Márton [Fri, 3 Sep 2004 03:26:28 +0000 (20:26 -0700)]
[PATCH] urandom initialisation fix
The urandom driver returns the same thing after every boot.
The urandom pool is only cleared, and not initialized, and because there is
nothing in the primary pool, the reseeding is not successful. The solution
is also the same, initialize not just the primary and secondary, but also
the urandom pool.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Fri, 3 Sep 2004 03:26:16 +0000 (20:26 -0700)]
[PATCH] fix proc_symlink() warning with CONFIG_PROC_FS=n
The last parameter of proc_symlink is usually a "const char *", but the
stub in <linux/proc_fs.h> for CONFIG_PROC_FS=n omits the const and makes
its last parameter a "char *". This causes a warning about discarding
qualifiers for any code that passes something const for that last
parameter.
This patch fixes that up and also, for neatness's sake, makes the stub for
create_proc_read_entry() match the usual prototype more exactly (use
read_proc_t rather than the underlying function pointer type).
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Add IXDP2x01 board support to CS89x0 driver
The following patch modifies the CS89x0 driver to work on Intel's IXDP2401
and IXDP2801 (Intel ARm/XScale based) platforms:
- The main change requried is that the IXDP2x01 boards have the
chip connected through a CPLD so all registers appear at
dword-aligned addresses. A macro in the header adjusts the register
offsets appropriately.
- The boards do not have ISA, so we need to explicitly check for
IXDP2X01 in Kconfig.
- There is what I believe is a bug in the driver as it currently
only asks for the signature if ioaddr & 1 is set but then
reads and checks against the expected signature even when
!(ioaddr & 1). This causes the driver to not load on the IXDP2x01
since our ioaddr does not have bit 1 set.
- #ifdef out some bits of code that assume the chip is really
sitting on an ISA bus.
The main IXDP2x01 support will be coming in through rmk's tree at
a later date when all the drivers are merged upstream.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix argument checking in sched_setaffinity
This patch fixes the argument length checking in sched_setaffinity.
Previously it would error out when the length passed was smaller than
sizeof(cpumask_t). And any bits beyond cpumask_s would be silently
ignored.
First this assumes that the user application knows the size of cpumask_t,
which should be kernel internal. When you increase cpumask_t old
applications break and there is no good way for the application to find out
the cpumask_t size the kernel uses.
This patch changes it to do similar checking to the NUMA API calls:
- Any length is ok as long as all online CPUs are covered (this could
still cause application breakage with more CPUs, but there is no good way
around it)
- When the user passes more than cpumask_t bytes the excess bytes are
checked to be zero.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Add support for NUMA discovery on AMD dual core to x86-64
Following the CPUID extensions and APIC-ID setup presented by Richard
Brunner at Kernel Summit.
Without this the kernel's node discovery would assign the wrong nodes on
dual core systems and cause performance degradation.
Only handles power of two cored CPUs, others will be ignored.
/proc/cpuinfo has a new field cpu cores: <number of CPU cores> and also
show the other core as HT sibling (this is needed to make old CPU based
license managers to count one CPU package as only one physical CPU)
FIXME this currently misses the disable code for SMT idle. That's because
2.6.9rc1-bk6 removed the arch hooks need for that. Needs to be readded
later.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Haren Myneni [Fri, 3 Sep 2004 03:25:05 +0000 (20:25 -0700)]
[PATCH] ppc64: implement page_is_ram
This patch contains - Removes __initdata from lmb definition (struct lmb
lmb;) and modified the existing page_is_ram function.
Also changed the current argument from physical address to pfn to make it
compatible across architectures. Please review them and send me your
comments/suggestions. If you are OK with any one patch, please include it
in the mainline kernel.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Fri, 3 Sep 2004 03:24:41 +0000 (20:24 -0700)]
[PATCH] ppc64: allocate NUMA node data node locally
Instead of statically allocating the NUMA node structures, do it at runtime
with node local memory where possible. With NR_CPUS=128 we had over 800kB
of memory allocated before this patch, now we allocate only as many nodes
as the machine requires.
We have to do some fancy footwork in do_init_bootmem since we use both the
LMB allocator and the bootmem allocator at the same time. The problem has
always been there although I only recently found a test case that hit it.
Wrap that logic in careful_allocation which uses the LMB allocator then
falls back to the bootmem allocator if required.
Now alloc_bootmem on a node with no memory doesnt panic, we dont need the
hack in paging_init so remove it.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Fri, 3 Sep 2004 03:24:30 +0000 (20:24 -0700)]
[PATCH] ppc64: quieten NUMA boot messages
On some machines we would print hundreds of lines of NUMA debug output.
The following patch cleans it up so we only print a summary of cpus and
memory vs nodes:
Anton Blanchard [Fri, 3 Sep 2004 03:24:06 +0000 (20:24 -0700)]
[PATCH] ppc64: update pSeries_defconfig
Update pSeries_defconfig. This config should better cover POWER5 systems
with SPLPAR spinlocks, IPR SCSI, NR_CPUS = 128, NUMA, HVCS, and irq stacks
enabled, VSCSI and VETH as modules.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Now we set up cpu_possible_map early we can dynamically allocate the
emergency stacks. Previously we would allocate NR_CPUS * PAGE_SIZE,
potentially wasting quite a lot of memory.
Clean a comment up in irqstack_early_init and use unsigned int for cpu ids
while in the area.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Fri, 3 Sep 2004 03:23:42 +0000 (20:23 -0700)]
[PATCH] ppc64 another log buffer length fix
This patch uses the firmware-defined error log buffer length for calls to
the firmware routine 'check-exception'. It also simplifies code in rtasd.c
that is attempting to obtain the error log length.
Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olof Johansson [Fri, 3 Sep 2004 03:23:30 +0000 (20:23 -0700)]
[PATCH] ppc64: Make use of batched IOMMU calls on pSeries LPARs
Implement the HCALLs to do more than one TCE setup or invalidation at a
time on pSeries LPAR. Previous implementation did one hypervisor call per
setup or teardown, resulting in significant overhead.
A simple test of "time dd if=/dev/sda of=/dev/null bs=128k" shows the
amount of system time go down by about 5% by using the multi-tce calls.
Signed-off-by: Olof Johansson <olof@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olof Johansson [Fri, 3 Sep 2004 03:23:19 +0000 (20:23 -0700)]
[PATCH] ppc64: Setup fw_features before init_early calls on pSeries
To be able to use the cur_cpu_spec->firmware_features values in early
setup, the function initializing them has to be moved up to before the
early init calls.
Signed-off-by: Olof Johansson <olof@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ppc64 has constraints on the mixing of small and large pages, such that
they cannot be mixed in the same 256Mb segment. This patch provides an
architecture specific arch_get_unmapped_area_topdown() which implements
these contraints.
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andy Whitcroft [Fri, 3 Sep 2004 03:22:55 +0000 (20:22 -0700)]
[PATCH] ppc64: topdown support
Recent patches introduced a top down user process address space allocation
policy; further patches enable this for ppc64. Although these work
correctly for normal maps, the topdown algorithm does not take into account
stringent mixing constraints for small and large pages on this
architecture. These patches introduce a ppc64 specific
arch_get_unused_area_topdown() variant. The first introduces
infrastructure to allow replacement of the generic
arch_get_unused_area_topdown() and the second utilises this infrastructure.
In this patch I have followed the pattern set by the arch_get_unused_area()
using HAVE_ARCH_UNMAPPED_AREA_TOPDOWN to be consistent. However, it would
also be possible to simply have a ppc64_get_unused_area_topdown() in the
arch/ppc64/mm/mmap.c or to use weak bindings.
This patch:
Allow an architecture to override the default definition of
arch_get_unmapped_area_topdown().
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Fri, 3 Sep 2004 03:22:31 +0000 (20:22 -0700)]
[PATCH] ppc64: test for EEH error in PCI Config-Read path
This patch adds explicit checking for EEH slot isolation events into the
PCI config space read path. The change itself would have been minor,
except that pci config reads don't have a pointer to a struct pci_dev.
Thus, I had to restructure the eeh code to accomodate this, which seems to
be a good thing anyway, making it a tad cleaner.
Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Gibson [Fri, 3 Sep 2004 03:22:09 +0000 (20:22 -0700)]
[PATCH] ppc64: pin the kernel stack's SLB entry
This has been given basic testing on Power4 pSeries and iSeries machines.
At present, the SLB miss handler has to check the SLB slot it is about to
use to ensure that it does not contain the SLBE for the current kernel
stack - throwing out the SLBE for the kernel stack can trigger the
"megabug": we have no SLBE for the stack, but we don't fault immediately
because we have an ERAT entry for it. The ERAT entry is then lost due to a
tlbie on another CPU during the unrecoverable section of the exception
return path.
This patch implements a different approach - with this patch SLB slot 2
always (well, nearly always) contains an SLBE for the stack. This slot is
never cast out by the normal SLB miss path. On context switch, an SLBE for
the new stack is pinned into this slot, unless the new stack is the the
bolted segment.
For iSeries we need a special workaround because there is no way of
ensuring the stack SLBE is preserved an a shared processor switch. So, we
still need to handle taking an SLB miss on the stack, in which case we must
make sure it is loaded into slot 2, rather than using the normal
round-robin.
This approach shaves a few ns off the slb miss time (on pSeries), but more
importantly makes it easier to experiment with different SLB castout
aporoaches without worrying about reinstating the megabug.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
... but a better solution should probably be found, that's saved_auxv
in struct mm_struct is ... hrm... disgusting at least ;)
So the problem is that we currently do
unsigned long saved_auxv[40];
That is we assume that all archs will have an AUXV entry of no more than
2 unsigned longs and we'll have no more than 20 entries in the table.
Unfortunately, this is wrong.
PPC/PPC64 adds 5 platform entries. then we add 14 in the common code,
and then we have
if (k_platform) {
NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(unsigned long)u_platform);
}
if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {
NEW_AUX_ENT(AT_EXECFD, (elf_addr_t) bprm->interp_data);
}
which may add a 20th entry... which means we are already out of room for
the terminating AT_NULL entry... bad bad bad.
Now I'm adding AT_SYSINFO_EHDR to ppc/ppc64 and it breaks all the time.
The quick fix is to bump the number of entries in struct mm_struct to 42,
though that's worth a big BOLD comment in binfmt_elf in case anybody adds
a new entry in there. (Patch below). I wonder if we shouldn't add a
ARCH_MAX_AUXV_ENTRIES macro to the asm-arch/elf.h though to get the max
amount of entry the arch may add to the normal count, and have the mm
struct array use that plus the number of "normal" entries...
This patch increase the max amount of auxv entries in struct mm_struct to
42 so that ppc & ppc64 don't get a chance to blow the array up.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Fri, 3 Sep 2004 03:21:45 +0000 (20:21 -0700)]
[PATCH] ipr.c build fix
drivers/scsi/ipr.c: In function `ipr_worker_thread':
drivers/scsi/ipr.c:1825: wrong type argument to unary exclamation mark
drivers/scsi/ipr.c: In function `ipr_read_dump':
drivers/scsi/ipr.c:2426: wrong type argument to unary exclamation mark
Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Brian King <brking@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
John Stultz [Fri, 3 Sep 2004 03:21:33 +0000 (20:21 -0700)]
[PATCH] fix target_cpus() for summit subarch
I've been hunting down a bug affecting IBM x440/x445 systems where the
floppy driver would get spurious interrupts and would not initialize
properly.
After digging James Cleverdon and Bill Irwin pointed out that target_cpus()
is routing the interrupts to the clustered apic broadcast mask using
destFixed deliver mode. This was causing multiple interrupts to show up,
breaking the floppy init code.
This fix simply changes the delivery mode to dest_LowestPrio and initially
routes interrupts to the first cpu to resolve this issue.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix do_each_task_pid() loop with 'continue' inside
Dmitry Torokhov triggered a problem in the new pidhash macros: These
do_each_task_pid()/while_each_task_pid() do loop forever if you use a
'continue' inside them.
The end of the loop has to be inside the "while()" statement, so as to
not make "continue" jump over it.
The lock in the nat-helper is unneccessary because the expectation
is never changed and is protected by ip_conntrack_lock.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Thu, 2 Sep 2004 16:58:05 +0000 (09:58 -0700)]
[NETFILTER]: Fix confusing naming in NAT-helpers
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Now that the VFS no longer uses it, we don't need to cache the symlink
string length.
- Make ->readlink() take page offset+length arguments
- Fix up page under/overflow checking on the readlink XDR code so that
it matches read/write.
This patch fixes strange and obscure pid implementation in current kernels:
- it removes calling of put_task_struct() from detach_pid()
under tasklist_lock. This allows to use blocking calls
in security_task_free() hooks (in __put_task_struct()).
- it saves some space = 5*5 ints = 100 bytes in task_struct
- it's smaller and tidy, more straigthforward and doesn't use
any knowledge about pids using and assignment.
- it removes pid_links and pid_struct doesn't hold reference counters
on task_struct. instead, new pid_structs and linked altogether and
only one of them is inserted in hash_list.
Chris Wedgwood [Thu, 2 Sep 2004 07:39:41 +0000 (00:39 -0700)]
[PATCH] i386 reduce spurious interrupt noise
i386 hardware can (and does) see spurious interrupts from time to
tome. Ideally I would like the printk removed completely but this is
probably good enough for now.
Signed-off-by: Chris Wedgwood <cw@f00f.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dave Jones [Thu, 2 Sep 2004 07:37:17 +0000 (00:37 -0700)]
[PATCH] Clean up failure path in DAC960
1. If the ScatterGatherPool allocation fails, its pointless
trying to allocate a RequestSensePool.
2. Free up the ScatterGatherPool if the RequestSensePool allocation fails.
Spotted with the source checker from Coverity.com.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Patrick McHardy [Thu, 2 Sep 2004 07:26:24 +0000 (00:26 -0700)]
[IPV4/IPV6]: Fix suboptimal fragment sizing for last fragment
Yoshifuji's recent fragment patch prevents unnecessary fragmentation
when the data can be kept in a single packet, but only for the first
packet. When fragmenting, all fragments are still truncated to
multiples of 8 and we might end up creating an unnecessary fragment.
This patch always builds mtu sized fragments and truncates the previous
fragment to a multiple of 8 bytes when allocating a new one. With the
patch the dump looks like this:
Herbert Xu [Wed, 1 Sep 2004 15:07:46 +0000 (08:07 -0700)]
[IPV4/IPV6]: Fixup checksums properly when fragmenting.
If we end up with a fraggap, when we copy the data
over to the next frag being built we must compute
a checksum for the bit we copy over for the new
fragment and subtract that checksum from the place
we are copying it from.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>