Age | Commit message (Collapse) | Author | Files | Lines |
|
This config option was lost during the creation of lib/Kconfig.debug, due to a
bad expressed dependency; I also moved the option back to its original place
for UML (it is near CONFIG_MCONSOLE since it depends on that).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch enables the DEBUG_PREEMPT config option for PPC64. I have
this turned on on my desktop G5 and it isn't finding any problems.
(It did find one problem, in flush_tlb_pending(), that I have just
sent a patch for.)
BTW, do we really need to restrict which architectures the config
option is available on?
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into kroah.com:/home/greg/linux/BK/usb-2.6
|
|
IN_STRING_C was an i386-specific hack by Andi Kleen to provide out-of-line
versions of some lib/string.c functions that aren't directly used on i386
(because there are inline assembly versions).
This can cause problems if gcc chooses to transparently replace a call to one
string function with a call to another string function (the example Andi gave
was a replacement of a sprintf call with a strcpy call) which generates a
function call to the replacement function.
The problems observed by Andi only occur in recent kernels without
-fno-unit-at-a-time.
With -ffreestanding it can't even cause any problems in case we'd one day drop
the -fno-unit-at-a-time since gcc mustn't assume in a freestanding environment
that all standard C library functions are available.
The effect of this patch is a small space saving in the kernel.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The patch below implements CONFIG_DEBUG_BUGVERBOSE for i386 (more exactly, it
allows disabling the verbose BUG() reporting).
Also, require CONFIG_EMBEDDED for this option: we don't want to make it easy
for people to disable useful debug info.
(With lots of help from Roman Zippel <zippel@linux-m68k.org>)
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>
|
|
Kernel core files converted to use the new lock initializers.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This is the current remove-BKL patch. I test-booted it on x86 and x64, trying
every conceivable combination of SMP, PREEMPT and PREEMPT_BKL. All other
architectures should compile as well. (most of the testing was done with the
zaphod patch undone but it applies cleanly on vanilla -mm3 as well and should
work fine.)
this is the debugging-enabled variant of the patch which has two main
debugging features:
- debug potentially illegal smp_processor_id() use. Has caught a number
of real bugs - e.g. look at the printk.c fix in the patch.
- make it possible to enable/disable the BKL via a .config. If this
goes upstream we dont want this of course, but for now it gives
people a chance to find out whether any particular problem was caused
by this patch.
This patch has one important fix over the previous BKL patch: on PREEMPT
kernels if we preempted BKL-using code then the code still auto-dropped the
BKL by mistake. This caused a number of breakages for testers, which
breakages went away once this bug was fixed.
Also the debugging mechanism has been improved alot relative to the previous
BKL patch.
Would be nice to test-drive this in -mm. There will likely be some more
smp_processor_id() false positives but they are 1) harmless 2) easy to fix up.
We could as well find more real smp_processor_id() related breakages as well.
The most noteworthy fact is that no BKL-using code was found yet that relied
on smp_processor_id(), which is promising from a compatibility POV.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
|
|
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
|
|
Last but not least, move the general prio_tree code from mm/ to lib/. This
patch also duplicates some macros, which are used in the VMA code for
debugging purposes, so we can't properly separate them yet.
Note that this patch conflicts with a patch in 2.6.10-rc3-mm1
(frv-better-mmap-support-in-uclinux.patch), which removes mm/prio_tree in
systems without an MMU. Not making that other patch provide a dummy for
prio_tree_init should resolve the conflict. (That's just from reading the
patch - I haven't actually tried this.)
Signed-off-by: Werner Almesberger <werner@almesberger.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The attached patch provides an out-of-line implementation of find_next_bit()
and rearranges linux/bitops.h to avoid a dependency loop between inline
functions in there and in asm/bitops.h trying to include one another.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
debugfs is a filesystem that is just for debug data. Start moving stuff out of proc and sysfs now :)
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
|
|
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into dwmw2.baythorne.internal:/inst/bk/mtd-2.6
|
|
Some of the fixes from Joe Perches <joe@perches.com> got missed out
of the last update.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
This patch updates Kconfig and add Kconfig.debug for m32r.
- arch/m32r/Kconfig: Move "Kernel hacking" menu to Kconfig.debug.
- arch/m32r/Kconfig.debug: Newly added.
- lib/Kconfig.debug: Add m32r arch.
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Gerd Knorr <kraxel@bytesex.org>
It uses the varargs list twice in a illegal way. That doesn't harm on i386
by pure luck, but blows things up on amd64 machines.
Using var args list twice without calling va_start twice is illegal.
Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Originally from Joe Perches <joe@perches.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
I was looking through the radix tree code and came across what I think
is a bug in radix_tree_delete.
for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) {
if (pathp[0].node->tags[tag][idx]) {
tags[tag] = 1;
nr_cleared_tags--;
break;
}
}
The above loop should only be executed if tags[tag] is zero. Otherwise,
when walking up the tree, we can decrement nr_cleared_tags twice or more
for the same value of tag, thus potentially exiting the outer loop too
early.
Ensure that nr_cleared_tags is only decremented once for each tag.
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
In do_mounts_rd.c and initramfs.c there are many references
from .text to .text.init because of the inclusion of lib/inflate.c.
The below adds INIT markup in lib/inflate.c.
|
|
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
I am trying to fix the current ACPI container.ko and processor.ko to use
kobject_hotplug() for notification. For this I would be requiring the
KOBJ_ONLINE definitions to be added to kobject_action.
Signed-off-by: Anil Keshavamurty <anil.s.keshavamurthy@intel.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Code looks like it intended to parse "%%" in pattern string as "%". Fix
it, so it really does that.
Compile and run tested.
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This fixes a problem introduced in the previous set of driver model
changes that has been seen by a lot of people (most notibly the greater
than 256 pty users, but others might also be hitting this without
realizing it.)
Also add a comment so we don't try to "fix" this again.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Looks like kobject_uevent_init is executed before netlink_proto_init and
consequently always fails. Not cool.
Attached patch switches the initialization over from core_initcall (init
level 1) to postcore_initcall (init level 2). Netlink's initialization
is done in core_initcall, so this should fix the problem. We should be
fine waiting until postcore_initcall.
Also a couple white space changes mixed in, because I am anal.
Signed-Off-By: Robert Love <rml@novell.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Thanks to Serge Hallyn <serue@us.ibm.com> for pointing this out.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
df_04_kobject_add_ref_fix.patch
In kobject_add(), @kobj wasn't put'd properly on error path. This
patch fixes it.
Signed-off-by: Tejun Heo <tj@home-tj.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Move hotplug_path[] out of kmod.[ch] to kobject_uevent.[ch] where
it belongs now. At some time in the future we should fix the remaining bad
hotplug calls (no SEQNUM, no netlink uevent):
./drivers/input/input.c (no DEVPATH on some hotplug events!)
./drivers/pnp/pnpbios/core.c
./drivers/s390/crypto/z90main.c
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
On Sat, Oct 30, 2004 at 04:54:29AM +0200, Kay Sievers wrote:
> On Sat, Oct 30, 2004 at 02:25:23AM +0200, Kay Sievers wrote:
> > On Sat, Oct 30, 2004 at 02:00:45AM +0200, Kay Sievers wrote:
> > > On Fri, Oct 29, 2004 at 06:13:19PM -0500, Greg KH wrote:
> > > > On Fri, Oct 29, 2004 at 11:28:56PM +0200, Kay Sievers wrote:
> > > > > > But there might still be a problem. With this change, the sequence
> > > > > > number is not sent out the kevent message. Kay, do you think this is an
> > > > > > issue? I don't think we can get netlink messages out of order, right?
> > > > >
> > > > > Right, especially not the events with the same DEVPATH, like "remove"
> > > > > beating an "add". But I'm not sure if the number isn't useful. Whatever
> > > > > we may do with the hotplug over netlink in the future, we will only have
> > > > > /sbin/hotplug for the early boot and it may be nice to know, what events
> > > > > we have already handled...
> > > > >
> > > > > > I'll hold off on applying this patch until we figure this out...
> > > > >
> > > > > How about just reserving 20 bytes for the number (u64 will never be
> > > > > more than that), save the pointer to that field, and fill the number in
> > > > > later?
> > > >
> > > > Ah, something like this instead? I like it, it's even smaller than the
> > > > previous patch. Compile tested only...
> > >
> > > I like that. How about the following. It will keep the buffer clean from
> > > random chars, cause the kevent does not have the vector and relies on
> > > the '\0' to separate the strings from each other.
> > > I've tested it. The netlink-hotplug message looks like this:
> > >
> > > recv(3, "remove@/class/input/mouse2\0ACTION=remove\0DEVPATH=/class/input/mouse2\0SUBSYSTEM=input\0SEQNUM=961 \0", 1024, 0) = 113
> >
> > Hmm, these trailing spaces are just bad, sorry. I'll better pass the
> > envp array over to send_uevent() and clean up the keys while copying
> > the env values into the skb buffer. This will make the event payload
> > more safe too. So your first version looks better.
>
> How about this? We copy over key by key into the skb buffer and the
> netlink message can get the envp array without depending on a single
> continuous buffer.
>
> The netlink message looks nice like this now:
>
> recv(3, "
> add@/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0
> HOME=/\0
> PATH=/sbin:/bin:/usr/sbin:/usr/bin\0
> ACTION=add\0
> DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0
> SUBSYSTEM=usb\0
> SEQNUM=991\0
> DEVICE=/proc/bus/usb/003/008\0
> PRODUCT=46d/c03e/2000\0
> TYPE=0/0/0\0
> INTERFACE=3/1/2\0
> ", 1024, 0) = 268
Here is an improved version that uses skb_put() to fill the skb buffer,
instead of trimming the buffer to the final size after we've copied over
all keys.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
PA-RISC does have spinlock debugging and doesn't have the frame pointer
option. USERMODE had been added twice to spinlock debugging, so remove that.
Committed-by: Randolph Chung <tausq@parisc-linux.org>
Committed-by: Matthew Wilcox <willy@parisc-linux.org>
|
|
We rename the actual architecture-specific low-level implementation
to have a prepended underscore: "_atomic_dec_and_lock()".
This extra macro indirection is so that we can make the macro do
the lock context counting. That will be the next patch.
|
|
Update Kconfig.debug so we get SYSRQ back and also the spinlock
debugging options.
Signed-off-by: Chris Wedgwood <cw@f00f.org>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This preserves the ioreadX() == inX() semantics (same as i386), since it's
not clear that the speedup of omitting the mf.a for port operations is
worth the risk of breaking drivers.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into mars.ravnborg.org:/home/sam/bk/to-linus
|
|
idr_remove() should fail gracefully and warn if the id being removed is not
valid.
The attached patch should do the job without additional overhead.
With the existing code, removing an id which was not allocated could remove
a valid id which shares the same lowest layer of the radix tree.
I ran a kernel with this patch but have not done any tests to force
a failure.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This allows for low-latency BKL contention even with
preemption. Previously, since preemption is disabled
over context switches, re-acquiring the kernel lock when
resuming a process would be non-preemtible.
|
|
Now that spinlocks are uninlined, it is silly to keep the
BKL inlined. And this should make it a lot easier for people
to play around with variations on the locking (ie Ingo's
semaphores etc).
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
lib/kobject_uevent.c:39: warning: `action_to_string' defined but not used
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
From: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com>
Remove cpu_run_sbin_hotplug() - use kobject_hotplug() instead.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Make kobject_hotplug() work even if the kobject's kset doesn't implement any
hotplug_ops.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
The attached patch contains a shared Reed-Solomon Library analogous to
the shared zlib.
(N)AND FLASH is gaining popularity and there are a lot of ASIC/SoC/FPGA
controllers around which implement hardware support for Reed-Solomon
error correction. As usual they use different implementations
(polynomials etc.). So it's obvious to use a shared library for the
common tasks of error correction.
A short scan through the kernel revealed that at least the ftape driver
uses Reed-Solomon error correction. It could be easily converted to use
the shared library code.
The encoder/decoder code is lifted from the GPL'd userspace RS-library
written by Phil Karn. I modified/wrapped it to provide the different
functions which we need in the MTD/NAND code.
The library is tested in extenso under various MTD/NAND configurations.
The lib should be usable for other purposes right out of the box.
Adjustment for currently not implemented functionality is an easy task.
I'm willing to take the maintainership of the library.
Signed-Off-By: Thomas Gleixner <tglx@linutronix.de>
Signed-Off-By: David Woodhouse <dwmw2@infradead.org>
"No objections at all. Just keep the authorship notices." -- Phil Karn
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Config option CONFIG_SCHEDSTATS is currently enabled via arch specific
Kconfig.debug. Only x86 and ppc arches has code to turn it on. Why not
put it in generic lib/Kconfig.debug so it is done once to enable everyone?
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
There's no reason to directly #include <asm/bitops.h> since it's
available on all architectures and also included by
#include <linux/bitops.h>.
This patch changes #include <asm/bitops.h> to #include <linux/bitops.h>.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
|
|
The last change to alloc_layer in lib/idr.c unnecessarily complicates
the code and depending on the definition of spin_unlock will cause worse
code to be generated than necessary. The following patch should improve
the situation.
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
|
|
Paul cares. I think there's something in the water at IBM
that makes people sticklers ;)
|
|
I experienced x3 slowdown due to this option being set.
Please add this small warning to DEBUG_SLAB help text.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Add a (non-inlined) add_hotplug_env_var() function to <linux/kobject.h>
and lib/kobject.c. There's a lot of boilerplate code involved in
setting environment variables in a hotplug method, so we should have a
convenience function to consolidate it (and avoid subtle bugs).
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
Otherwise modules that get loaded dynamically will not be able
to resolve the iomap functions, if no built-in drivers caused
it to be linked in at compile-time.
|
|
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into press.kroah.org:/home/greg/linux/BK/driver-2.6
|
|
Send notification over the new netlink socket to let userspace know that
the filesystem code claims/releases the superblock on an blockdevice.
This way, userspace can get rid of constantly polling /proc/mounts to
watch for filesystem changes.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
This prevents any potential typos from happening.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Things like SATA use this for data transfer.
Also export the iomap routines on ppc64.
|
|
lib/kobject_uevent.c: In function `kobject_hotplug':
lib/kobject_uevent.c:225: warning: long long int format, u64 arg (arg 3)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
|
Jeff wants to use this to clean up SATA and some network drivers.
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
Implemetation of userspace events through a netlink socket. The kernel events
layer provides the functionality to raise an event from a given kobject
represented by its sysfs-path and a signal string to describe the type of
event.
Currently, kobject additions and removals are signalized to userspace by forking
the /sbin/hotplug helper. This patch moves this special case of userspace-event
out of the kobject core to the new kobject_uevent implementation. This makes it
possible to send all hotplug messages also through the new netlink transport.
Possible new users of the kernel userspace functionality are filesystem
mount events (block device claim/release) or simple device state transitions
(cpu overheating).
To send an event, the user needs to pass the kobject, a optional
sysfs-attribute and the signal string to the following function:
kobject_uevent(const char *signal,
struct kobject *kobj,
struct attribute *attr)
Example:
kobject_uevent("overheating", &cpu->kobj, NULL);
The message itself is sent over multicast netlink socket, which makes
it possible for userspace to listen with multiple applications for the same
messages.
Signed-off-by: Robert Love <rml@novell.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
is not enabled.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Thanks to Kay Sievers for pointing this out.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
The following changes zlib_inflate_trees_fixed(...) from using a statically
defined table, to generating this table. This cuts out 4-8kB from
inftrees.o (4kB on IBM 440GP, 8kB on PPC 74xx).
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The following patch moves zlib_inflateSync and friends, which are used by
PPP and not a 'normal' gzip, into inflate_sync.c.
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Convert all in-kernel users of the deprecated EXPORT_SYMBOL_NOVERS() to
EXPORT_SYMBOL().
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Thanks to Kay Sievers for pointing this out.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
|
|
o /sys/kernel/hotplug_seqnum exports the current number
o lib/kobject.c's sequence_num is renamed to hotplug_seqnum and
exported by include/linux/kobject.h
o the source file ksysfs.c in kernel/ creates on init the
sybsystem "/sys/kernel/" in sysfs
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
DEBUG_SPINLOCK_SLEEP is useful on ppc64, so allow it to be selected.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
We dereference 'z' a few lines above this check.
If it was possible to hit this condition, it wouldve
triggered long ago, in the form of a crash.
Spotted with the source checker from Coverity.com.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into ppc970.osdl.org:/home/torvalds/v2.6/linux
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
into ppc970.osdl.org:/home/torvalds/v2.6/linux
|
|
into ppc970.osdl.org:/home/torvalds/v2.6/linux
|
|
Thanks to Kiran for bugging me to do this.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
The generation counters were removed from the idr code. Update idr.c
comments, now uses doc-book style API documentation.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Localize Kconfig debug options into one file (lib/Kconfig.debug)
for easier maintenance, searching, and menu-building.
Updated to 2.6.8.
Summary of changes:
. localizes the following symbols in lib/Kconfig.debug:
DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK,
DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE,
DEBUG_INFO
and FRAME_POINTER for some instances of it (if it's freely
user-selectable) but not for the cases where it's forced or
it depends on some other options.
. adds DEBUG_KERNEL requirement to some DEBUG_vars;
. remove KALLSYMS from S390-specific kernel hacking menu;
use KALLSYMS in the EMBEDDED menu instead;
. add CRIS and M68KNOMMU symbols for use in lib/Kconfig.debug;
. eliminate duplicate "General setup" labels in sparc64 config;
. whitespace cleanup;
. fixed a few trival typos;
Portions of the original patch were also done by
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@redhat.com>
|
|
into mars.ravnborg.org:/home/sam/bk/kbuild
|
|
|
|
Bug spotted by: Ian Molton <spyro@f2s.com>
BITS_TO_LONGS() can't be used to derive an index
into a bitmap array.
Also put a BUG_ON() for the pages > BITS_PER_LONG case
we don't cope with.
|
|
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Adds support for 'hh' (store number in char *) and 'll' (proper C99 for
long long) modifiers to sscanf().
|
|
Add a new kobject helper, kobject_get_path(), which is the greatest
function ever.
Signed-Off-By: Robert Love <rml@ximian.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
This was based on a patch from Kiran, but tweaked further by me.
Signed-off-by: Ravikiran Thirumalai <kiran@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
Quite a few functions in lib/string.c are not exported. I ran into this
trying to use strnchr() in a module.
This patch
- exports every function defined in lib/string.c
- adds some missing __HAVE_ARCH_xxx defines for i386
- gets rid of the exports of functions from lib/string.c in arch/s390
(BTW, why is s390 exporting things NOVERS?)
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12
+ x^5 + 1) implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks
like we need to rename it accordingly and this patchset does exactly this.
Signed-off-by: Andrey Panin <pazke@donpac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
kset_find_obj should increment refcount of the found object so users of
the function can safely use returned object
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
gcc 3.5 is warning about unused static variables, add __attribute_unused__
to the 2 places to silence 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>
|
|
The radix tree functions __lookup and __lookup_tag uses (1 << shift) in
their index calculations. On 64 bit systems the shift can be bigger than
32. The shift of an integer by more than 32 bits evaluates to zero which
causes the lookup to fail.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
These APIs deal with bitmaps representing contiguous
memory regions. The idea is to set, free and find
a contiguous area.
For ease of implementation (as well as to conform
to the standard requirements), the bitmaps always
return n aligned n length regions. The implementation
is also limited to BITS_PER_LONG contiguous regions.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
Use NULL, not 0, where appropriate.
|
|
build
Well, one of these (fs/block_dev.c) is little non-trivial, but i felt
throwing that away would be a shame (and I did add comments ;-).
Also almost all of these have been submitted earlier through other
channels, but have not been picked up (the only controversial is again the
fs/block_dev.c patch, where Linus felt a better job would be done with
__ffs(), but I could not convince myself that is does the same thing as
original code).
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Currently we have 8 copies of CRC16 calculation table in different device
drivers, this patch creates common crc16.c module to replace them.
Signed-off-by: Andrey Panin <pazke@donpac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Paul Jackson <pj@sgi.com>
These bitmap improvements make it a suitable basis for fully supporting
cpumask_t and nodemask_t. Inline macros with compile-time checks enable
generating tight code on both small and large systems (large meaning cpumask_t
requires more than one unsigned long's worth of bits).
The existing bitmap_<op> macros in lib/bitmap.c are renamed to __bitmap_<op>,
and wrappers for each bitmap_<op> are exposed in include/linux/bitmap.h
This patch _includes_ Bill Irwins rewrite of the bitmap_shift operators to not
require a fixed length intermediate bitmap.
Improved comments list each available operator for easy browsing.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Paul Jackson <pj@sgi.com>
Document the bitmap bit model and handling of unused bits.
Tighten up bitmap so it does not generate nonzero bits in the unused tail if
it is not given any on input.
Add intersects, subset, xor and andnot operators. Change bitmap_complement to
take two operands.
Add a couple of missing 'const' qualifiers on bitops test_bit and bitmap_equal
args.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
|
|
Lindent rwsem.c and rwsem-spinlock.c and fix a few things by hand. Also
added a couple of comments for the memory barriers. Added the __sched
annotation that was left out of rwsem-spinlock.c.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
A classic..
lib/string.c:165:19: warning: assignment expression in conditional
From: Mika Kukkonen <mika@osdl.org>
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
|
|
I know it's simple_strtoul, but is it meant to be that simple? Fix up for
both simple_strtoul and simple_strtoull.
simple_strtoul(0x401b, NULL, 0) = 0x401b
simple_strtoul(0X401b, NULL, 0) = 0x0
simple_strtoul(0x401b, NULL, 16) = 0x0
simple_strtoul(0X401b, NULL, 16) = 0x0
simple_strtoull(0x401b, NULL, 0) = 0x401b
simple_strtoull(0X401b, NULL, 0) = 0x0
simple_strtoull(0x401b, NULL, 16) = 0x0
simple_strtoull(0X401b, NULL, 16) = 0x0
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
There were definately some problems in there. I've made some changes and
tested with a lot of bounds. I don't have a machine with enough memory to
fill it up (it would take ~16GB on a 64-bit machine), but I use the "above"
code to simulate a lot of situations.
The problems were:
* IDR_FULL was not the right value
* idr_get_new_above() was not defined in the headers or documented.
* idr_alloc() bug-ed if there was a race and not enough memory was
allocated. It should have returned NULL.
* id will overflow when you go past the end.
* There was a "(id >= (1 << (layers*IDR_BITS)))" comparison, but at
the top layer it would overflow the id and be zero.
* The allocation should return ENOSPC for an "above" value with
nothing above it, but it returned EAGAIN.
I have not tested on 64-bits (as I don't have a 64-bit machine).
I've included the files, a diff from the previous version, and my test
programs.
For the test programs, idr_test <size> will just attempt to allocate
<size> elements, check them, free them, and check them again.
idr_test2 <size> <incr> will allocate <size> element with <incr> between
them.
idr_test3 just tests some bounds and tries all values with just a few in
the idr.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
idr_get_new() currently returns an incrementing counter in the top 8 bits of
the counter. Which means that most users have to mask it off again, and we
only have a 24-bit range.
So remove that counter. Also:
- Remove the BITS_PER_INT define due to namespace collision risk.
- Make MAX_ID_SHIFT 31, so counters have a 0 to 2G-1 range.
- Why is MAX_ID_SHIFT using sizeof(int) and not sizeof(long)? If it's for
consistency across 32- and 64-bit machines, why not just make it "31"?
- Does this still hold true with the counter removed?
/* We can only use half the bits in the top level because there are
only four possible bits in the top level (5 bits * 4 levels = 25
bits, but you only use 24 bits in the id). */
If not, what needs to change?
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
* On a 32-bit architecture, the idr code will cease to work if you add
more than 2^20 entries. You will not be able to find many of the
entries. The problem is that the IDR code uses 5-bit chunks of the
number and the lower portion used by IDR is 24 bits, so you have one bit
that leaks over into the comparisons that should not be there. The
solution is to mask off that bit before doing IDR processing. This
actually causes the POSIX timer code to crash if you create that many
timers. I have included an idr_test.tar.gz file that demonstrates this
with and without the fix, in case you need more evidence :).
* When the IDR fills up, it returns -1. However, there was no way to
check for this condition. This patch adds the ability to check for the
idr being full and fixes all the users. It also fixes a problem in
fs/super.c where the idr code wasn't checking for -1.
* There was a race condition creating POSIX timers. The timer was added
to a task struct for another process then the data for the timer was
filled out. The other task could use/destroy time timer as soon as it is
in the task's queue and the lock is released. This moves settup up the
timer data to before the timer is enqueued or (for some data) into the
lock.
* Change things so that the caller doesn't need to run idr_full() to find
out the reason for an idr_get_new() failure.
Just return -ENOSPC if the tree was full, or -EAGAIN if the caller needs
to re-run idr_pre_get() and try again.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Stop downgrade_write() from under-adjusting the rwsem counter in optimised
rw-semaphores.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Many places do:
if (kmem_cache_create(...) == NULL)
panic(...);
We can consolidate all that by passing another flag to kmem_cache_create()
which says "panic if it doesn't work".
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
o The following patch cleans up sysfs_rename_dir(). It now checks the
return code of kobject_set_name() and propagates the error code to its
callers. Because of this there are changes in the following two APIs. Both
return int instead of void.
int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
int kobject_rename(struct kobject * kobj, char *new_name)
|
|
From: Alexey Dobriyan <adobriyan@mail.ru>
Fix various kernel-doc parameters.
|
|
Get a reference count on the the sleeper, so that
it can't possibly go away before we've sent it the
wakeup event.
Noted by Nick Piggin <nickpiggin@yahoo.com.au>
David Howells <dhowells@redhat.com>
|
|
Don't touch the wakee stack after marking it runnable.
|
|
into kernel.bkbits.net:/home/davem/net-2.6
|
|
|
|
|
|
Thanks to Dru <andru@treshna.com>, who provided an easy way to reproduce
the problem.
What we have in lib/rwsem.c:__rwsem_do_wake():
int woken, loop;
^^^
and several lines below:
loop = woken;
woken *= RWSEM_ACTIVE_BIAS-RWSEM_WAITING_BIAS;
woken -= RWSEM_ACTIVE_BIAS;
However, rw_semaphore->count is 64-bit on Alpha, so
RWSEM_WAITING_BIAS has been defined as -0x0000000100000000L.
Obviously, this blows up in the write contention case.
|
|
From: Jim Houston <jim.houston@comcast.net>
- Adds idr_get_new_above(), whihc permits us to do a first-fit search
from a specified offset rather than always from zero.
- Add IDR_INIT() DEFINE_IDR() constructors. Often idr's are singletons
and having to cook up an initcall for them is a pain.
This is needed by the "Increase number of dynamic inodes in procfs" patch.
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
Fix various bogons and outright lies.
|
|
From: Rusty Russell <rusty@rustcorp.com.au>
clear_bit(n, addr) clears the nth bit.
test_and_clear_bit(n, addr) clears the nth bit.
cpu_clear(n, cpumask) clears the nth bit (vs. cpus_clear()).
bitmap_clear(bitmap, n) clears out all the bits up to n.
Moreover, there's a CLEAR_BITMAP() in linux/types.h which bitmap_clear() is
a wrapper for.
Rename bitmap_clear to bitmap_zero, which is harder to confuse (yes, it bit
me), and make everyone use it.
|
|
Add radix-tree tagging so we can look up dirty or writeback pages in
O(log64(n)) time.
Each radix-tree node gains two bits for each slot: one for page dirtiness and
one for page writebackness.
If a tag bit is set on a leaf node, it indicates that item at the
corresponding slot is tagged (say, a dirty page).
If a tag bit is set in a non-leaf node it indicates that the same tag bit is
set in the subtree which lies under the corresponding slot. ie: "there is a
dirty page under here somewhere, but you need to search down further to find
it".
A gang lookup function is provided which can walk the radix tree in
logarithmic time looking for items which are tagged, starting from a
specified offset. We use this for in-order searches for dirty or writeback
pages.
There is a userspace test harness for this code at
http://www.zip.com.au/~akpm/linux/patches/stuff/rtth.tar.gz
|
|
From: William Lee Irwin III <wli@holomorphy.com>
Chang bitmap_shift_left()/bitmap_shift_right() to have O(1) stackspace
requirements.
Given zeroed tail preconditions these implementations satisfy zeroed tail
postconditions, which makes them compatible with whatever changes from Paul
Jackson one may want to merge in the future. No particular effort was
required to ensure this.
A small (but hopefully forgiveable) cleanup is a spelling correction:
s/bitmap_shift_write/bitmap_shift_right/ in one of the kerneldoc comments.
The primary effect of the patch is to remove the MAX_BITMAP_BITS
limitation, so restoring the NR_CPUS to be limited only by stackspace and
slab allocator maximums. They also look vaguely more efficient than the
current code, though as this was not done for performance reasons, no
performance testing was done.
|
|
From: Joe Korty <joe.korty@ccur.com>
This patch replaces the call to bitmap_shift_right() in bitmap_parse() with
bitmap_shift_left().
I also prepended comments to the bitmap_shift_* functions defining what
'left' and 'right' means. This is under the theory that if I and all the
reviewers were bamboozled, others in the future occasionally might be too.
|
|
From: William Lee Irwin III <wli@holomorphy.com>
This addresses the issue with get_wchan() that the various functions acting
as scheduling-related primitives are not, in fact, contiguous in the text
segment. It creates an ELF section for scheduling primitives to be placed
in, and places currently-detected (i.e. skipped during stack decoding)
scheduling primitives and others like io_schedule() and down(), which are
currently missed by get_wchan() code, into this section also.
The net effects are more reliability of get_wchan()'s results and the new
ability, made use of by this code, to arbitrarily place scheduling
primitives in the source code without disturbing get_wchan()'s accuracy.
Suggestions by Arnd Bergmann and Matthew Wilcox regarding reducing the
invasiveness of the patch were incorporated during prior rounds of review.
I've at least tried to sweep all arches in this patch.
|
|
|
|
This cleans up a larger amount of superfluos ";;" statements in current
Linux kernel sources by converting them to the regular single ";"
statments.
It seems to be a common problem that at the end of a line the semicolon
key is producing an echo.
|
|
The gcc-3.5 patch broke building on x86_64 and possibly
others, because inflate.c does not pull in the definition
for noinline.
|
|
From: Matt Mackall <mpm@selenic.com>
Quick fix to work around gcc3.5's automatic inline and broken stack
requirements calculation. Without this, I see stack overflows at boot
with 4k stacks.
|
|
Various files keep per-cpu caches which need to be freed/moved when a
CPU goes down. All under CONFIG_HOTPLUG_CPU ifdefs.
scsi.c: drain dead cpu's scsi_done_q onto this cpu.
buffer.c: brelse the bh_lrus queue for dead cpu.
timer.c: migrate timers from dead cpu, being careful of lock order vs
__mod_timer.
radix_tree.c: free dead cpu's radix_tree_preloads
page_alloc.c: empty dead cpu's nr_pagecache_local into nr_pagecache, and
free pages on cpu's local cache.
slab.c: stop reap_timer for dead cpu, adjust each cache's free limit, and
free each slab cache's per-cpu block.
swap.c: drain dead cpu's lru_add_pvecs into ours, and empty its committed_space
counter into global counter.
dev.c: drain device queues from dead cpu into this one.
flow.c: drain dead cpu's flow cache.
|
|
From: "Randy.Dunlap" <rddunlap@osdl.org>
From: Michael Veeck <michael.veeck@gmx.net>
Remove unnecessary min/max macros and changes calls to use kernel.h macros
instead.
|
|
Based on the kobject structure, but much smaller and simpler to use.
|
|
From: Gerd Knorr <kraxel@suse.de>
Current gcc's error out if a function's declaration and definition disagree
about the register passing convention.
The patch adds a new `fastcall' declatation primitive, and uses that in all
the FASTCALL functions which we could find. A number of inconsistencies were
fixed up along the way.
|
|
|
|
|
|
From: Matt Domsch <Matt_Domsch@dell.com>
Patch below applies to both 2.4.25 and 2.6.3, and replaces the public
domain statement and non-warranty with the GPL, as is permitted by the code
being in the public domain, and is done with legal advice.
|
|
From: Tim Hockin <thockin@sun.com>
Remove the max_anon via dynamically allocation. We also change the
idr_pre_get() interface to take a gfp mask, which should have always been
there.
|
|
From: Joe Korty <joe.korty@ccur.com>
Rename bitmap_snprintf() to bitmap_scnprintf() and cpumask_snprintf() to
cpumask_scnprintf(), as these functions now belong to the scnprintf family
of functions.
|
|
From: Valdis.Kletnieks@vt.edu
15 changes of #if to #ifdef and 2 places CONFIG_FOO should be
defined(CONFIG_FOO). This gets rid of spurious warnings if you build with
"-Wundef" so you get a warning if you have a preprocessor command like:
#if CONFIG_ETRAX_DS1302_RSTBIT == 27
and you'll be told if it's substituting a zero rather than silent
weirdness and unexpected code generation.
|
|
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.
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
From: Joe Korty <joe.korty@ccur.com>
Now that bitmap_parse is part of bitmap.[ch], it is allowed to manipulate
bits directly as the other bitmap routines do.
|
|
Convert dev_alloc_name from O(n^2) lookup to O(n) by using a page as
bitmap to figure out how many devices of that pattern have been allocated.
This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other
platforms. Correctly handles the boundary cases where number of devices
won't fit because name length is limited.
Adds strnchr to the string libraries since we need to find the % format
character, but only care if it is in the first 15 bytes.
|
|
into kroah.com:/home/greg/linux/BK/driver-2.6
|
|
From: <gb@phonema.ea.univpm.it>
The "%c" in sscanf actually reads and writes one extra character (i.e. 2
characters insted of just one), and may thus easily overflow caller's
buffer.
Also affects 2.4 tree, even if there "%c" seems not to be used at all.
|
|
From: Paul Jackson <pj@sgi.com>
Explain the snprintf() return value.
|
|
From: Pratik Solanki <pratik.solanki@timesys.com>
I came across this C standards issue while cross-compiling the Linux kernel
with gcc on Solaris. The file gen_crc32table.c uses the non-standard type
u_int32_t. It's possible that the host machine's sys/types.h does not
define u_int32_t. The attached patch replaces u_int32_t with the POSIX
standard uint32_t and includes POSIX inttypes.h instead of sys/types.h.
|
|
From: Joe Korty <joe.korty@ccur.com>
1) the version in 2.6.1 is broken, doesn't work on 64bit big endian
machines at all. This needed fixing. I thought it best to fix by
rewriting the printer/parser with an algorithm that is naturally endian &
sizeof(long) resistant.
2) I wanted all digits to print, eg, 0000ffff,00000004 not ffff,4.
3) I wanted exactly NR_CPUS bits to print (or whatever the bitmap size is
in bits, and not have what is displayed rounded up to the nearest full
byte, as the current version did.
4) The bitmap printer and parser should be part of bitmap.[ch] with syntax
and semantics to match. The original lib/mask.c versions did not
recognize this commonality.
|
|
From: Andi Kleen <ak@muc.de>
gcc 3.4 optimizes sprintf(foo,"%s",string) into strcpy. Unfortunately that
isn't seen by the inliner and linux/i386 has no out-of-line strcpy so you
end up with a linker error.
This patch adds out of line copies for most string functions to avoid this.
Actually it doesn't export them to modules yet, that would be the next
step.
BTW In my opinion we shouldn't use inline string functions at all. The
__builtin_str* in modern gcc are better (I used them very successfully on
x86-64) and for the bigger functions like strrchr,strtok et.al. it just
doesn't make any sense to inline them or even code them in assembler.
Also fix the bcopy prototype gcc was complaining about.
|
|
From: Andi Kleen <ak@muc.de>
Just many more warning fixes for a gcc 3.4 snapshot.
It warns for a lot of things now, e.g. for ?: and ({ ... }) and casts as
lvalues. And for functions marked inline in headers, but no body.
Actually there are more warnings, i stopped fixing at some point. Some of
the warnings seem to be dubious (e.g. the binfmt_elf.c one, which looks
more like a compiler bug to me)
I also fixed the _exit() prototype to be void because gcc was complaining
about this.
|
|
the size to "vsnprintf()".
That's a pretty clear case of overflow.
|
|
|
|
From: Jes Sorensen <jes@trained-monkey.org>
The new sort_extable and shared search_extable code doesn't work on ia64.
I have introduced two new #defines that archs can define to avoid the
common code being built. ARCH_HAS_SEARCH_EXTABLE and
ARCH_HAS_SORT_EXTABLE.
|
|
The exception table search code currently fails if addresses differ by more
than 2G. This is only a problem when using the 4g/4g address space split,
but it's more robust this way.
Also, shuffle the comparison order n there so the least likely case comes
last.
|
|
This patch arranges for the exception tables to be sorted on most
architectures. It sorts the main kernel exception table on startup
and the module exception tables when they get loaded. The main table
is sorted reasonably early - just after kmem_cache_init - but that
could be moved even earlier if necessary.
There is now a lib/extable.c which includes the sort_extable()
function from arch/ppc/mm/extable.c and the search_extable() function
from arch/i386/mm/extable.c, which had been copied to many
architectures. On many architectures, arch/$(ARCH)/mm/extable.c
became empty and so I have removed it.
There are four architectures which do things differently from i386:
alpha, ia64, sparc and sparc64. Alpha and ia64 store the offset from
the offset from the exception table entry to the instruction, and
sparc and sparc64 have range entries in the table. For those
architectures I have added empty sort_extable functions. The
maintainers for those architectures can implement something better if
they care to. As it is they are no worse off than before.
Although it is a moderately sizable patch, it ends up with a net
reduction of 377 lines in the size of the kernel source. :)
I have tested this on x86 and ppc with a module that uses __get_user
in an init function, deliberately laid out to get the exception table
out of order, and it works (whereas it oopsed without this patch).
|
|
into home.osdl.org:/home/torvalds/v2.5/linux
|
|
gcc miscompiles this. Scary.
|
|
- A couple of them are using alloca (via DECLARE_BITMAP) and this generates
a cannot-inline warning with -Winline.
- These functions are too big to inline anwyay.
|
|
Thanks to Hollis Blanchard <hollisb@us.ibm.com> for pointing this out.
|
|
make kobject hotplug mechanism public so that others may call it.
|
|
From: "H. Peter Anvin" <hpa@zytor.com>
This patch fixes the "non-terminating inflate" problem that Russell King
complained about on LKML earlier today.
I chose to use "goto" much like zlib does, in order to not require
setjmp/longjmp inside the kernel. It's a bit ugly, but it also lets each
function chose how it needs to be terminated on error, which is a good
thing.
|
|
From: Paul Jackson <pj@sgi.com>
This patch is a followup to one from Bill Irwin. On Nov
17, he had consolidated the half-dozen chunks of code
that displayed cpumasks in /proc/irq/prof_cpu_mask and
/proc/irq/<pid>/smp_affinity into a single routine, which he
called format_cpumask().
I believe that Andrew Morton has accepted Bill's patch into
his 2.6.0-test10-mm1 patch set as the "format_cpumask" patch.
I hope that the following patch will replace Bill's patch.
I look forward to Bill's feedback on this patch.
The following patch carries Bill's work further:
1) It also consolidates the input side (write syscalls).
2) It adapts a new format, same on input and output.
3) The core routines work for any multi-word bitmask,
not just cpumasks.
4) The core routines avoid overrunning their output
buffers.
Note esp. for David Mosberger:
The small patch I sent you and the linux-ia64 list
yesterday entitled: "check user access ok writing
/proc/irq/<pid>/smp_affinity" for arch ia64 only is
_separate_ from the following patch. Neither presumes the
other. However, they do collide on one line. Last one in
is a Monkey's Uncle and will need an updated patch from me
(or otherwise need to resolve the one obvious collision).
Details of the following patch:
Both the display and input of cpumasks on 9 arch's are
consolidated into a single pair of routines, which use the
same format for input and output, as recommended by Tony
Luck. The two common routines work on any multi-word bitmask
(array of unsigned longs). A pair of trivial inline wrappers
cpumask_snprintf() and cpumask_parse() hide this generality
for the common case of cpumask input and output.
My real motivation for consolidating this code will become
visible later - when I seek to add a nodemask_t that resembles
cpumask_t (just a different length). These common underlying
routines will be used there as well, following up on a suggestion
of Christoph Hellwig that I investigate implementing nodemask_t
as an ADT sharing infrastructure with cpumask_t. However, I
believe that this patch stands on its own merit, consolidating
a couple hundred lines of duplicated code, and making the
cpumask display format usable on very large systems.
There are two exceptions to the consolidation - the alpha and
sparc64 arch's manipulate bare unsigned longs, not cpumask_t's,
on input (write syscall), and do stuff that was more funky than
I could make sense of. So the input side of these two arch's
was left as-is. I'd welcome someone with access to either of
these systems to provide additional patches.
The new format consists of multiple 32 bit words, separated by
commas, displayed and input in hex. The following comment from
this patch describes this format further:
* The ascii representation of multi-word bit masks displays each
* 32bit word in hex (not zero filled), and for masks longer than
* one word, uses a comma separator between words. Words are
* displayed in big-endian order most significant first. And hex
* digits within a word are also in big-endian order, of course.
*
* Examples:
* A mask with just bit 0 set displays as "1".
* A mask with just bit 127 set displays as "80000000,0,0,0".
* A mask with just bit 64 set displays as "1,0,0".
* A mask with bits 0, 1, 2, 4, 8, 16, 32 and 64 set displays
* as "1,1,10117". The first "1" is for bit 64, the second
* for bit 32, the third for bit 16, and so forth, to the
* "7", which is for bits 2, 1 and 0.
* A mask with bits 32 through 39 set displays as "ff,0".
The essential reason for adding the comma breaks was to make
the long masks from our (SGI's) big 512 CPU systems parsable by
humans. An unbroken string of 128 hex digits is pretty difficult
to read. For those who are compiling systems with CONFIG_NR_CPUS
of 32 or less, there should be no visible change in format.
There are of course a thousand possible output formats that
meet similar criteria. If someone wants to lobby for and seek
consensus behind another such format, that's fine. Now that
the format is consolidated into a single pair of routines,
it should be easy to adapt whatever we choose.
Internally, the display routine uses snprintf to track the
remaining space in its output buffer, to avoid the risk of
overrunning it.
A new file, lib/mask.c, is added to the lib directory, to
hold the two common routines. I anticipate adding a few more
common routines for generic support of multi-word bit masks to
lib/mask.c, in subsequent patches that will add a nodemask_t
type as an ADT sharing implementation with cpumask_t.
|
|
From: Will Dyson <will_dyson@pobox.com>
Add documentation and comments to lib/parser.c and include/linux/parser.h
|
|
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>)
|
|
|
|
If both ext2 and ext3 are built as modules there is nothing to pull
percpu_counter_mod() into the kernel build and the ext2 and ext3 modules do
not load.
So move percpu_counter_mod() out of lib.a.
|
|
This fixes the generic __div64_32() to correctly handle divisions by
large 32-bit values (as used by nanosleep() and friends, for example).
It's a simple bit-at-a-time implementation with a reduction of the high
32-bits handled manually. Architectures that can do 64/32-bit divisions
in hardware should implement their own more efficient versions.
|
|
|
|
Expand printk's traditional handling of null pointers so that anything in the
first page is considered a null pointer.
This gives us better behaviour when someone (acpi..) accidentally prints a
string which is embedded in a struct, the pointer to which is null.
|
|
into kernel.bkbits.net:/home/mochel/linux-2.5-core
|
|
|
|
into kernel.bkbits.net:/home/mochel/linux-2.5-core
|
|
Current match_token recognize "foo=" as "foo=%s". So this change the
nul string does not recognize as "%s".
|
|
into kernel.bkbits.net:/home/mochel/linux-2.5-core
|
|
From: "Randy.Dunlap" <rddunlap@osdl.org>, Will Dyson <will_dyson@pobox.com>, me
Add generic filesystem options parser (infrastructure) and use it to parse
mount options in several filesystems (adfs, affs, autofs, autofs4, ext2,
ext3, fat, hfs, hpfs, isofs, jfs, procfs, udf, and ufs).
It saves between 128 and 512 bytes per filesystem.
|
|
If kobject_set_name() is called when the kobject already has a name that was
dynamically allocated (too long for the static array), then we must free that
memory.
Noticed by Jon Corbet.
|
|
into osdl.org:/home/mochel/src/kernel/linux-2.5-core
|
|
Similar to the patch Brian Gerst sent for CRC32, this patch changes
ZLIB_{IN,DE}FLATE to be select'ed.
The dependencies are much better maintainable that way.
|
|
Use "select CRC32" in Kconfig instead of makefile includes.
|
|
From John Rose <johnrose@austin.ibm.com>
The patch below exposes some kset functions for use by modules. In the
development of a PPC64 pci hotplug drv, we have found it necessary to use ksets
of different types under a single subsystem. After discussing with GregKH,
we agreed that this change makes this possible.
|
|
From: Andre McCurdy <armcc2000@yahoo.com>
There is some inconsistency within lib/inflate.c and its users about
whether the error message text or the error() function should provide
the '\n'.
This patch tries to make everyone consistent - by removing the
newline from all message texts, and adding one to the only error()
function which did not provide it (in init/do_mounts_rd.c).
|
|
Bah, stupid mistake. After you call ->release(), you cannot touch the object.
|
|
Add ->k_name pointer which points to the name for a kobject. By default, this
points to ->name (the static name array).
Users of kobjects may use the helper function kobject_set_name() (and are
encouraged to do so in all cases). This function will determined whether or
not the name is short enough to fit in ->name. If so, great.
Otherwise, a dyanamic string is allocated and the name is stored there.
->k_name will point to that, and will be freed when the kobject is released.
kobject_set_name() may take a format string, like:
kobject_set_name(kobj,"%s%d",base_name,id);
and will behave as expected (will put in ->name, unless it's too long, in
which case a new string will be allocated and it will be stored in there).
|
|
This is Erik Andersen's excellent strncpy.
It works like magic. That "if" isn't a jump;
gcc uses a few integer instructions to wipe
out all jumps except for the loop itself and
the function call/return.
This has been exhaustively tested against glibc.
The existing code has 5 extra branches and
is over twice as large. (my gcc, etc.)
|
|
From: Yoshinori Sato <ysato@users.sourceforge.jp>
It writes one too many zeroes when nulling out the destination.
|
|
into kernel.bkbits.net:/home/davem/sparc-2.5
|
|
|
|
From: Leann Ogasawara <ogasawara@osdl.org>
Uninitialize static variables initialized to 0 so they are pushed to the
.bss instead of .data.
|
|
|
|
It used to depend on us having a signed type (which in turn is
incorrect for the later division).
|
|
- __div64_32(): remove __attribute_pure__ qualifier from the prototype
since this function obviously clobbers memory through &(n);
- do_div(): add a check to ensure (n) is type-compatible with uint64_t;
- as_update_iohist(): Use sector_div() instead of do_div().
(Whether the result of the addition should always be stored in 64bits
regardless of CONFIG_LBD is still being discussed, therefore it's
unadderessed here);
- Fix all places where do_div() was being called with a bad divisor argument.
|
|
- export the __div64_32 symbol for modules;
- add likely() to the fast path (divisor>>32 == 0);
- add __attribute__((pure)) to __div64_32() prototype so
the compiler knows global memory isn't clobbered;
- avoid building __div64_32() on 64bit architectures.
|
|
This offers a generic do_div64() that actually does the right thing,
unlike some architectures that "optimized" the 64-by-32 divide into
just a 32-bit divide.
Both ppc and sh were already providing an assembly optimized
__div64_32(). I called my function the same, so that their optimized
versions will automatically override mine in lib.a.
I've only tested extensively on m68knommu (uClinux) and made
sure generated code is reasonably short. Should be ok also on
parisc, since it's the same algorithm they were using before.
- add generic C implementations of the do_div() for 32bit and 64bit
archs in asm-generic/div64.h;
- add generic library support function __div64_32() to handle the
full 64/32 case on 32bit archs;
- kill multiple copies of generic do_div() in architecture
specific subdirs. Most copies were either buggy or not doing
what they were supposed to do;
- ensure all surviving instances of do_div() have their parameters
correctly parenthesized to avoid funny side-effects;
|