| Age | Commit message (Collapse) | Author | Files | Lines |
|
Extend the gcc printk format-string checking.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
New kernel-doc comments for might_sleep & wait_event_*
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This first patch of the series introduces a sysctl (default off) that
enables/disables the randomisation feature globally. Since randomisation may
make it harder to debug really tricky situations (reproducability goes down),
the sysadmin needs a way to disable it globally.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Move 'panic_timeout' to linux/kernel.h.
ipmi_watchdog.c wanted to know why panic_timeout isn't in some header file.
However, ipmi_watchdog.c doesn't even use it, so that reference was
deleted. Other references now use kernel.h instead of straight extern int.
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The attached patch makes it possible to support gp-rel addressing for small
variables. Since the FR-V cpu's have fixed-length instructions and plenty of
general-purpose registers, one register is nominated as a base for the small
data area. This makes it possible to use single-insn accesses to access
global and static variables instead of having to use multiple instructions.
This, however, causes problems with small variables used to pinpoint the
beginning and end of sections. The compiler assumes it can use gp-rel
addressing for these, but the linker then complains because the displacement
is out of range.
By declaring certain variables as arrays or by forcing them into named
sections, the compiler is persuaded to access them as if they can be outside
the displacement range. Declaring the variables as "const void" type also
works.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This clarifies more of the x86 caller/callee stack ownership
issues by making the exception and interrupt handler assembler
interfaces use register calling conventions.
System calls still use the stack.
Tested with "crashme" on UP/SMP.
|
|
This patch readds the panic blinking that was in 2.4 to 2.6. This is
useful to see when you're in X that the machine has paniced
It addresses previously criticism.
It should work now when the keyboard interrupt is off.
It doesn't fully emulate the handler, but has a timeout
for this case.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Hugh and I both thought this would be generally useful.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch adds machine check tainting. When a handled machine check
occurs the oops gets a new 'M' flag. This is useful to ignore machines
with hardware problems in oops reports.
On i386 a thermal failure also sets this flag.
Done for x86-64 and i386 so far.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add vprintk call. This lets us directly pass varargs stuff to the console
without using vsnprintf to an intermediate buffer.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
store_stackinfo() does an unlocked module list walk during normal runtime
which opens up a race with the module load/unload code. This can be
triggered by simply unloading and loading a module in a loop with
CONFIG_DEBUG_PAGEALLOC resulting in store_stackinfo() tripping over bad
list pointers.
kernel_text_address doesn't take any locks, because during an OOPS we don't
want to deadlock. Rename that to __kernel_text_address, and make
kernel_text_address take the lock.
Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
OK, the pending abs() disaster has hit:
drivers/usb/class/audio.c:404: warning: static declaration of 'abs' follows non-static declaration
This is due to the declaration in kernel.h. AFAIK there's not even a matching
definition for that.
The patch implements abs() as a macro in kernel.h and kills off various
private implementations.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Here's a patch to allocate memory for big system hash tables with the
bootmem allocator rather than with main page allocator.
It is needed for three reasons:
(1) So that the size can be bigger than MAX_ORDER. IBM have done some
testing on their big PPC64 systems (64GB of RAM) with linux-2.4 and found
that they get better performance if the sizes of the inode cache hash,
dentry cache hash, buffer head hash and page cache hash are increased
beyond MAX_ORDER (order 11).
Now the main allocator can't allocate anything larger than MAX_ORDER, but
the bootmem allocator can.
In 2.6 it appears that only the inode and dentry hashes remain of those
four, but there are other hash tables that could use this service.
(2) Changing MAX_ORDER appears to have a number of effects beyond just
limiting the maximum size that can be allocated in one go.
(3) Should someone want a hash table in which each bucket isn't a power of
two in size, memory will be wasted as the chunk of memory allocated will
be a power of two in size (to hold a power of two number of buckets).
On the other hand, using the bootmem allocator means the allocation
will only take up sufficient pages to hold it, rather than the next power
of two up.
Admittedly, this point doesn't apply to the dentry and inode hashes,
but it might to another hash table that might want to use this service.
I've coelesced the meat of the inode and dentry allocation routines into
one such routine in mm/page_alloc.c that the the respective initialisation
functions now call before mem_init() is called.
This routine gets it's approximation of memory size by counting up the
ZONE_NORMAL and ZONE_DMA pages (and ZONE_HIGHMEM if requested) in all the
nodes passed to the main allocator by paging_init() (or wherever the arch
does it). It does not use max_low_pfn as that doesn't seem to be available
on all archs, and it doesn't use num_physpages since that includes highmem
pages not available to the kernel for allocating data structures upon -
which may not be appropriate when calculating hash table size.
On the off chance that the size of each hash bucket may not be exactly a
power of two, the routine will only allocate as many pages as is necessary
to ensure that the number of buckets is exactly a power of two, rather than
allocating the smallest power-of-two sized chunk of memory that will hold
the same array of buckets.
The maximum size of any single hash table is given by
MAX_SYS_HASH_TABLE_ORDER, as is now defined in linux/mmzone.h.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Split the system_state state `SYSTEM_SHUTDOWN' into SYSTEM_HALT,
SYSTEM_POWER_OFF and SYSTEM_RESTART and export system_state to modules.
This allows driver shutdown routines to know why they are being shutdown. The
IDE subsystem wants this so that it knows to not spin the disks down across a
reboot.
|
|
From: Olof Johansson <olof@austin.ibm.com>
It's currently a boolean, but that means that system_running goes to zero
again when shutting down. So we then use code (in the page allocator) which
is only designed to be used during bootup - it is marked __init.
So we need to be able to distinguish early boot state from late shutdown
state. Rename system_running to system_state and give it the three
appropriate states.
|
|
|
|
From: Juergen Quade <quade@hsnr.de>
Lots of places in the kernel are using [v]snprintf wrongly: they assume it
returns the number of characters copied. It doesn't. It returns the
number of characters which _would_ have been copied had the buffer not been
filled up.
So create new functions vscnprintf() and scnprintf() which have the
expected (sane) semaptics, and migrate callers over to using them.
|
|
Reimplement net_ratelimit() in terms of the new printk_ratelimit().
As net_ratelimit() already has it own sysctls we generalise
printk_ratelimit() a bit so that networking does not lose its existing
sysctls and so that it can use different time constants from the more generic
printk_ratelimit().
|
|
From: Anton Blanchard <anton@samba.org>
Generate a global printk rate-limiting function, printk_ratelimit().
Also, use it in the page allocator warning code. Also add a dump_stack to
that code.
Later, we need to switch net_ratelimit() over to use printk_ratelimit().
|
|
It turns out that the int_sqrt() function in oom_kill.c gets it wrong.
But fb_sqrt() in fbmon.c gets its math right. Move that function into
lib/int_sqrt.c, and consolidate.
(oom_kill.c fix from Thomas Schlichter <schlicht@uni-mannheim.de>)
|
|
There seems to be no header file which declares system_running.
|
|
From: "Nakajima, Jun" <jun.nakajima@intel.com>
Split the increasingly messy compiler.h file into per-compiler files and also
add support for non-gcc compilers.
With the current implementation:
include/linux/compiler.h defines the compiler-dependent abstractions
which can be overwritten by per-compiler definitions.
include/linux/compiler-gcc.h contains the common definitions for all gcc
versions.
include/linux/compiler-gcc[2,3,+].h contains gcc major version specific
definitions.
include/linux/compiler-intel.h contains intel compiler specific
definitions."
|
|
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())
|
|
|
|
This patch moves the definitions of BUG, BUG_ON and WARN_ON from
<linux/kernel.h> to <asm/bug.h> (which <linux/kernel.h> includes), and
supplies a new implementation for PPC which uses a conditional trap
instruction for BUG_ON and WARN_ON, thus avoiding a conditional
branch. This patch trims over 50kB from the size of the kernel that I
use on powermacs.
With this patch, on PPC we have a __bug_table section in the vmlinux
binary, and also in modules if they use BUG, BUG_ON or WARN_ON. The
__bug_table section has one entry for each BUG/BUG_ON/WARN_ON, giving
the address of the trap instruction and the corresponding line number,
filename and function name. This information is used in the exception
handler for the exception that the trap instruction produces. The
arch-specific module code handles the __bug_table section so that
BUG/BUG_ON/WARN_ON work correctly in modules.
Several architecture maintainers have acked this change. It should be
completely benign for all of the other architectures (though they may
decide to do something similar if they have a conditional trap
instruction available).
|
|
|
|
We had two major issues when unregistering networking devices.
1) Even trying to run hotplug asynchronously could deadlock
if keventd was currently trying to get the RTNL semaphore
in order to process linkwatch events.
2) Unregister needs to wait for the last reference to go away
before the finalization of the unregister can execute. This
cannot occur under the RTNL semaphore as this is deadlock
prone as well.
The solution is to do all of this stuff after dropping the
RTNL semaphore. rtnl_lock, if it is about to protect a region
of code that could unregister network devices, registers a list
to which unregistered netdevs are attached. At rtnl_unlock time
this list is processed to wait for refcounts to drop to zero and
then finalize the unregister.
|
|
From: Russell Miller <rmiller@duskglow.com>
A BUG or an oops will often leave a machine in a useless state. There is no
way to remotely recover the machine from that state.
The patch adds a /proc/sys/kernel/panic_on_oops sysctl which, when set, will
cause the x86 kernel to call panic() at the end of the oops handler. If the
user has also set /proc/sys/kernel/panic then a reboot will occur.
The implementation will try to sleep for a while before panicing so the oops
info has a chance of hitting the logs.
The implementation is designed so that other architectures can easily do this
in their oops handlers.
|
|
|
|
This patch moves BUG() and PAGE_BUG() from asm/page.h into asm/bug.h.
We also fix up linux/dcache.h, which included asm/page.h for the sole
purpose of getting the BUG() definition.
Since linux/kernel.h and linux/smp.h make use of BUG(), asm/bug.h is
included there as well.
In addition, linux/jbd.h did not contain a clear path with which to
obtain the archtecture BUG() definition, but did contain its own
definition.
|
|
Various archs (i386, m68k, s390, s390x, m68k, parisc, um, x86_64)
implement kernel_text_address. Put this in kernel/extable.c, and the
module iteration inside module.c.
Other than cleanliness, this finally allows the module list and lock
to be static to kernel/module.c (you didn't think I actually cared
about those archs did you?)
It also drops the module->init_size to zero when it's discarded, so
bounds checking is simplified (and the /proc/modules size statistic
will be more accurate, too).
|
|
This implements EXPORT_SYMBOL_GPL and MODULE_LICENSE properly (so
restrictions are enforced). Also fixes "proprietory" spelling.
|
|
ALIGN() currently has global scope in <linux/cache.h>. This causes a
compilation error in the defxx driver.
Move ALIGN() to <linux/kernel.h> and change the defxx driver to use the
generic macro in place of its own.
|
|
This patch is a rewrite of the insmod and boot parameter handling,
to unify them.
The new format is fairly simple: built on top of __module_param_call there
are several helpers, eg "module_param(foo, int, 000)". The final argument
is the permissions bits, for exposing parameters in sysfs (if
non-zero) at a later stage.
|
|
Moves console_loglevel & friends to an array, as sysctl expects.
|
|
This makes the sleep-under-spinlock-held check a CONFIG_ option.
|
|
This is the logical counterpoint to the code which marks modules
"[unsafe]" when obsolete (racy) interfaces are used. Allows "just
remove the damn thing" rmmod -f, and taints the kernel.
Mark it dangerous and experimental in the config file to make this
doubly clear.
|
|
compilers.
|
|
kill the machine.
Damn I hate people who kill the machine for no good reason.
|
|
|
|
[This has four scalps already. Thomas Molina has agreed
to track things as they are identified ]
Infrastructure to detect sleep-inside-spinlock bugs. Really only
useful if compiled with CONFIG_PREEMPT=y. It prints out a whiny
message and a stack backtrace if someone calls a function which might
sleep from within an atomic region.
This patch generates a storm of output at boot, due to
drivers/ide/ide-probe.c:init_irq() calling lots of things which it
shouldn't under ide_lock.
It'll find other bugs too.
|
|
From Christoph Hellwig, also present in 2.4.
Create an arch-independent `dump_stack()' function. So we don't need to do
#ifdef CONFIG_X86
show_stack(0); /* No prototype in scope! */
#endif
any more.
The whole dump_stack() implementation is delegated to the architecture.
If it doesn't provide one, there is a default do-nothing library
function.
|
|
some more pasters..
|
|
|
|
Define container_of which cast from member to struct with some type checking.
This is much like list_entry but is cearly for things other than lists.
List_entry now uses container_of.
|
|
Newer Athlons have means of checking if they are SMP capable or not.
This code adds checks that printk a warning on systems not intended
for SMP, and set the taint flag that modutils is already aware of.
The taint code is also improved to use defines instead of magic numbers.
|
|
- Jens Axboe: more bio updates, fix some request list bogosity under load
- Al Viro: export seq_xxx functions
- Manfred Spraul: include file cleanups, pc110pad compile fix
- David Woodhouse: fix JFFS2 write error handling
- Dave Jones: start merging up with 2.4.x patches
- Manfred Spraul: coredump fixes, FS event counter cleanups
- me: fix SCSI CD-ROM sectorsize BIO breakage
|
|
- Greg KH: USB updates
- Jens Axboe: more bio updates
- Christoph Rohland: fix up proper shmat semantics
|