| Age | Commit message (Collapse) | Author |
|
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
|
|
- Mikael Pettersson: make proc_misc happy without modules
- Arjan van de Ven: clean up acpitable implementation ("micro-acpi")
- Anton Altaparmakov: LDM partition code update
- Alan Cox: final (yeah, sure) small missing pieces
- Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend
- Arjan van de Ven: remove power from pcmcia socket on card remove
- Greg KH: USB updates
- Neil Brown: multipath updates
- Martin Dalecki: fix up some "asmlinkage" routine markings
|
|
- me: fix page flags race condition Andrea found
- David Miller: sparc and network updates
- various: fix loop driver that thought it was part of the VM system
- me: teach DRM about VM_RESERVED
- Alan Cox: more merging
|
|
- me/Al Viro: fix bdget() oops with block device modules that don't
clean up after they exit
- Alan Cox: continued merging (drivers, license tags)
- David Miller: sparc update, network fixes
- Christoph Hellwig: work around broken drivers that add a gendisk more
than once
- Jakub Jelinek: handle more ELF loading special cases
- Trond Myklebust: NFS client and lockd reclaimer cleanups/fixes
- Greg KH: USB updates
- Mikael Pettersson: sparate out local APIC / IO-APIC config options
|
|
- Neil Brown: md cleanups/fixes
- Andrew Morton: console locking merge
- Andrea Arkangeli: major VM merge
|
|
- Greg KH: start migration to new "min()/max()"
- Roman Zippel: move affs over to "min()/max()".
- Vojtech Pavlik: VIA update (make sure not to IRQ-unmask a vt82c576)
- Jan Kara: quota bug-fix (don't decrement quota for non-counted inode)
- Anton Altaparmakov: more NTFS updates
- Al Viro: make nosuid/noexec/nodev be per-mount flags, not per-filesystem
- Alan Cox: merge input/joystick layer differences, driver and alpha merge
- Keith Owens: scsi Makefile cleanup
- Trond Myklebust: fix oopsable race in locking code
- Jean Tourrilhes: IrDA update
|
|
- Christoph Hellwig: clean up personality handling a bit
- Robert Love: update sysctl/vm documentation
- make the three-argument (that everybody hates) "min()" be "min_t()",
and introduce a type-anal "min()" that complains about arguments of
different types.
|
|
- Al Viro: block device cleanups
- Marcelo Tosatti: make bounce buffer allocations more robust (it's ok
for them to do IO, just not cause recursive bounce IO. So allow them)
- Anton Altaparmakov: NTFS update (1.1.17)
- Paul Mackerras: PPC update (big re-org)
- Petko Manolov: USB pegasus driver fixes
- David Miller: networking and sparc updates
- Trond Myklebust: Export atomic_dec_and_lock
- OGAWA Hirofumi: find and fix umsdos "filldir" users that were broken
by the 64-bit-cleanups. Fix msdos warnings.
- Al Viro: superblock handling cleanups and race fixes
- Johannes Erdfelt++: USB updates
|
|
- Jeff Hartmann: DRM AGP/alpha cleanups
- Ben LaHaise: highmem user pagecopy/clear optimization
- Vojtech Pavlik: VIA IDE driver update
- Herbert Xu: make cramfs work with HIGHMEM pages
- David Fennell: awe32 ram size detection improvement
- Istvan Varadi: umsdos EMD filename bug fix
- Keith Owens: make min/max work for pointers too
- Jan Kara: quota initialization fix
- Brad Hards: Kaweth USB driver update (enable, and fix endianness)
- Ralf Baechle: MIPS updates
- David Gibson: airport driver update
- Rogier Wolff: firestream ATM driver multi-phy support
- Daniel Phillips: swap read page referenced set - avoid swap thrashing
|
|
- David Miller: sparc updates, FAT fs fixes, btaudio build fix
- David Gibson: Orinoco driver update
- Kevin Fleming: more disks the HPT controller doesn't like
- David Miller: "min()/max()" cleanups. Understands signs and sizes.
- Ben LaHaise: make vma merging more generous, help Mozilla /proc/<>/maps
- Jens Axboe: CD updates
- Trond Myklebust: save away NFS credentials in inode, so that mmap can
writeout.
- Mark Hemment: HIGHMEM ops cleanups
- Jes Sorensen: use "unsigned long" for flags in various drivers
|
|
- Rui Sousa: emu10k1 module fixes, remove joystick part.
- Alan Cox: driver merges
- Andrea Arkangeli: alpha updates
- David Woodhouse: up_and_exit -> complete_and_exit
- David Miller: sparc and network update
- Andrew Morton: update 3c59x driver
- Neil Brown: NFS export VFAT, knfsd cleanups, raid fixes
- Ben Collins: ieee1394 updates
- Paul Mackerras: PPC update
- me: make sure we don't lose position bits in "filldir()"
|