summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2009-05-29Merge branch 'quilt/driver-core'Stephen Rothwell
Conflicts: init/main.c
2009-05-29Merge commit 'asm-generic/next'Stephen Rothwell
2009-05-29Merge commit 'kmemleak/kmemleak'Stephen Rothwell
Conflicts: arch/x86/kernel/vmlinux_32.lds.S arch/x86/kernel/vmlinux_64.lds.S lib/Kconfig.debug mm/slob.c
2009-05-29Merge commit 'iommu/auto-iommu-next'Stephen Rothwell
2009-05-29Merge commit 'tip-core/auto-core-next'Stephen Rothwell
2009-05-29kobject: make kset_create check kobject_set_name return valueDave Young
kset_create should check the kobject_set_name return value. Add the return value checking code. Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-05-22Merge branch 'topic/slab/fixes' into for-nextPekka Enberg
2009-05-22Merge branch 'core/printk' into auto-core-nextIngo Molnar
2009-05-15add generic lib/checksum.cArnd Bergmann
Add a generic (unoptimized) implementation of checksum.c in pure C for use by all architectures. Based on microblaze code by Michal Simek <monstr@monstr.eu> Cc: Michal Simek <monstr@monstr.eu> Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2009-05-12Merge branch 'core/iommu' into auto-iommu-nextIngo Molnar
2009-05-11Merge commit 'v2.6.30-rc5' into core/iommuIngo Molnar
Merge reason: core/iommu was on an .30-rc1 base, update it to .30-rc5 to refresh. Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-05-11kmemleak: Simple testing module for kmemleakCatalin Marinas
This patch adds a loadable module that deliberately leaks memory. It is used for testing various memory leaking scenarios. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2009-05-11kmemleak: Enable the building of the memory leak detectorCatalin Marinas
This patch adds the Kconfig.debug and Makefile entries needed for building kmemleak into the kernel. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2009-05-08Remove old PRINTK_DEBUG config itemJason Baron
On Tue, Apr 21, 2009 at 01:55:53PM +0200, Stefan Richter wrote: > Robert P. J. Day wrote: > > lib/Kconfig.debug: select PRINTK_DEBUG > > > > should that perhaps refer to "DYNAMIC_PRINTK_DEBUG"? since there is > > no such thing as a PRINTK_DEBUG Kconfig variable. > > Looks like a rudiment from an earlier version of Jason's "driver core: > basic infrastructure for per-module dynamic debug messages", > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=346e15beb5343c2eb8216d820f2ed8f150822b08 > Search an LKML archive for '+#ifdef CONFIG_PRINTK_DEBUG'. > > Jason, should it be deleted or replaced by something? We re-named 'DYNAMIC_PRINTK_DEBUG' to 'DYNAMIC_DEBUG' in 2.6.30.... 'PRINTK_DEBUG' as pointed out never existed. So, it appears to be extraneous, and should be removed. thanks for pointing it out. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-05-06Merge branches 'topic/documentation', 'topic/slqb/core', 'topic/slub/fixes' ↵Pekka Enberg
and 'topic/urgent' into for-next
2009-05-05Merge branch 'core-fixes-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: kernel/posix-cpu-timers.c: fix sparse warning dma-debug: remove broken dma memory leak detection for 2.6.30 locking: Documentation: lockdep-design.txt, fix note of state bits
2009-04-29vsprintf: introduce %pf format specifierFrederic Weisbecker
A printf format specifier which would allow us to print a pure function name has been suggested by Andrew Morton a couple of months ago. The current %pF is very convenient to print a function symbol, but often we only want to print the name of the function, without its asm offset. That's what %pf does in this patch. The lowecase f has been chosen for its intuitive meaning of a 'weak kind of %pF'. The support for this new format would be welcome by the tracing code where the need to print pure function names is often needed. This is also true for other parts of the kernel: $ git-grep -E "kallsyms_lookup\(.+?\)" arch/blackfin/kernel/traps.c: symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); arch/powerpc/xmon/xmon.c: name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr); arch/sh/kernel/cpu/sh5/unwind.c: sym = kallsyms_lookup(pc, NULL, &offset, NULL, namebuf); arch/x86/kernel/ftrace.c: kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str); kernel/kprobes.c: sym = kallsyms_lookup((unsigned long)p->addr, NULL, kernel/lockdep.c: return kallsyms_lookup((unsigned long)key, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup((unsigned long)rec->ops->func, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); kernel/trace/ftrace.c: kallsyms_lookup(rec->ip, NULL, NULL, &modname, str); kernel/trace/ftrace.c: kallsyms_lookup(*ptr, NULL, NULL, NULL, str); kernel/trace/trace_functions.c: kallsyms_lookup(ip, NULL, NULL, NULL, str); kernel/trace/trace_output.c: kallsyms_lookup(address, NULL, NULL, NULL, str); Changes in v2: - Add the explanation of the %pf role for vsnprintf() and bstr_printf() - Change the comments by dropping the "asm offset" notion and only define the %pf against the actual function offset notion. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Zhaolei <zhaolei@cn.fujitsu.com> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <20090415154817.GC5989@nowhere> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-26dma-debug: remove broken dma memory leak detection for 2.6.30Joerg Roedel
The feature needs some more work because the notfier which is used to check for pending allocations is called before the device drivers ->remove() function. Therefore this feature reports false positives. A real fix for this issue is to introduce a new notifier event which sent _after_ the driver has deinitialized itself. That will done for the next kernel version. [ Impact: reduce the scope of CONFIG_DMA_API_DEBUG=y checks ] Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: iommu@lists.linux-foundation.org LKML-Reference: <1240576557-22442-1-git-send-email-joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-24lib: find_last_bit.o needed by a module only, move it from lib to objFred Isaman
Currently, although find_last_bit is EXPORTed, it is statically linked with the kernel and is referenced only under CONFIG_SMP. When CONFIG_SMP is undefined and find_last_bit is referenced only by modules, linking fails with: ERROR: "find_last_bit" [fs/nfs/nfs.ko] undefined! Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-24Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6Linus Torvalds
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: [S390] update default configuration. [S390] omit frame pointers on s390 when possible [S390] Use tape_generic_offline directly. [S390] /proc/stat idle field for idle cpus [S390] appldata: avoid deadlock with appldata_mem [S390] ipl: fix compile breakage
2009-04-23[S390] omit frame pointers on s390 when possibleHeiko Carstens
Always omit frame pointers on s390. They aren't too useful for the kernel since we have already the kernel stack backchain which allows us to walk the kernel stack. So eleminate the extra code for frame pointers. Only allow the extra code for the function tracer since the gcc compile options -pg and -fomit-frame-pointer are incompatible. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-04-22scatterlist: make sure sg_miter_next() doesn't return 0 sized mappingsTejun Heo
Impact: fix not-so-critical but annoying bug sg_miter_next() returns 0 sized mapping if there is an zero sized sg entry in the list or at the end of each iteration. As the users always check the ->length field, this bug shouldn't be critical other than causing unnecessary iteration. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-20driver: dont update dev_name via device_add pathKay Sievers
notice one system /proc/iomem some entries missed the name for pci_devices it turns that dev->dev.kobj name is changed after device_add. for pci code: via acpi_pci_root_driver.ops.add (aka acpi_pci_root_add) ==> pci_acpi_scan_root is used to scan pci bus/device, and at the same time we read the resource for pci_dev in the pci_read_bases, we have res->name = pci_name(pci_dev); pci_name is calling dev_name. later via acpi_pci_root_driver.ops.start (aka acpi_pci_root_start) ==> pci_bus_add_device to add all pci_dev in kobj tree. pci_bus_add_device will call device_add. actually in device_add /* first, register with generic layer. */ error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev)); if (error) goto Error; will get one new name for that kobj, old name is freed. [Impact: fix corrupted names in /proc/iomem ] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-16driver core: allow non-root users to listen to ueventsKay Sievers
Users can read sysfs files, there is no reason they should not be allowed to listen to uevents. This lets xorg and other userspace programs properly get these messages without having to be root. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-16Revert "kobject: don't block for each kobject_uevent".Hugh Dickins
This reverts commit f520360d93cdc37de5d972dac4bf3bdef6a7f6a7. Tetsuo Handa, running a kernel with CONFIG_DEBUG_PAGEALLOC=y and CONFIG_UEVENT_HELPER_PATH=/sbin/hotplug, has been hitting RCU detected CPU stalls: it's been spinning in the loop where do_execve() counts up the args (but why wasn't fixup_exception working? dunno). The recent change, switching kobject_uevent_env() from UMH_WAIT_EXEC to UMH_NO_WAIT, is broken: the exec uses args on the local stack here, and an env which is kfreed as soon as call_usermodehelper() returns. It very much needs to wait for the exec to be done. An alternative would be to keep the UMH_NO_WAIT, and complicate the code to allocate and free these resources correctly? but no, as GregKH pointed out when making the commit, CONFIG_UEVENT_HELPER_PATH="" is a much better optimization - though some distros are still saying /sbin/hotplug in their .config, yet with no such binary in their initrd or their root. Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Hugh Dickins <hugh@veritas.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Will Newton <will.newton@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-16SLQB slab allocator (try 2)Nick Piggin
Introducing the SLQB slab allocator. SLQB takes code and ideas from all other slab allocators in the tree. The primary method for keeping lists of free objects within the allocator is a singly-linked list, storing a pointer within the object memory itself (or a small additional space in the case of RCU destroyed slabs). This is like SLOB and SLUB, and opposed to SLAB, which uses arrays of objects, and metadata. This reduces memory consumption and makes smaller sized objects more realistic as there is less overhead. Using lists rather than arrays can reduce the cacheline footprint. When moving objects around, SLQB can move a list of objects from one CPU to another by simply manipulating a head pointer, wheras SLAB needs to memcpy arrays. Some SLAB per-CPU arrays can be up to 1K in size, which is a lot of cachelines that can be touched during alloc/free. Newly freed objects tend to be cache hot, and newly allocated ones tend to soon be touched anyway, so often there is little cost to using metadata in the objects. SLQB has a per-CPU LIFO freelist of objects like SLAB (but using lists rather than arrays). Freed objects are returned to this freelist if they belong to the node which our CPU belongs to. So objects allocated on one CPU can be added to the freelist of another CPU on the same node. When LIFO freelists need to be refilled or trimmed, SLQB takes or returns objects from a list of slabs. SLQB has per-CPU lists of slabs (which use struct page as their metadata including list head for this list). Each slab contains a singly-linked list of objects that are free in that slab (free, and not on a LIFO freelist). Slabs are freed as soon as all their objects are freed, and only allocated when there are no slabs remaining. They are taken off this slab list when if there are no free objects left. So the slab lists always only contain "partial" slabs; those slabs which are not completely full and not completely empty. SLQB slabs can be manipulated with no locking unlike other allocators which tend to use per-node locks. As the number of threads per socket increases, this should help improve the scalability of slab operations. Freeing objects to remote slab lists first batches up the objects on the freeing CPU, then moves them over at once to a list on the allocating CPU. The allocating CPU will then notice those objects and pull them onto the end of its freelist. This remote freeing scheme is designed to minimise the number of cross CPU cachelines touched, short of going to a "crossbar" arrangement like SLAB has. SLAB has "crossbars" of arrays of objects. That is, NR_CPUS*MAX_NUMNODES type arrays, which can become very bloated in huge systems (this could be hundreds of GBs for kmem caches for 4096 CPU, 1024 nodes systems). SLQB also has similar freelist, slablist structures per-node, which are protected by a lock, and usable by any CPU in order to do node specific allocations. These allocations tend not to be too frequent (short lived allocations should be node local, long lived allocations should not be too frequent). There is a good overview and illustration of the design here: http://lwn.net/Articles/311502/ By using LIFO freelists like SLAB, SLQB tries to be very page-size agnostic. It tries very hard to use order-0 pages. This is good for both page allocator fragmentation, and slab fragmentation. SLQB initialistaion code attempts to be as simple and un-clever as possible. There are no multiple phases where different things come up. There is no weird self bootstrapping stuff. It just statically allocates the structures required to create the slabs that allocate other slab structures. SLQB uses much of the debugging infrastructure, and fine-grained sysfs statistics from SLUB. There is also a Documentation/vm/slqbinfo.c, derived from slabinfo.c, which can query the sysfs data. Documentation/vm/slqbinfo.c | 1054 +++++++++++++ arch/x86/include/asm/page.h | 1 include/linux/mm.h | 4 include/linux/rcu_types.h | 18 include/linux/rcupdate.h | 11 include/linux/slab.h | 10 include/linux/slqb_def.h | 295 +++ init/Kconfig | 9 lib/Kconfig.debug | 20 mm/Makefile | 1 mm/slqb.c | 3562 ++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 4971 insertions(+), 14 deletions(-) Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
2009-04-15dma-debug: add dma_debug_resize_entries() to adjust the number of ↵FUJITA Tomonori
dma_debug_entries We use a static value for the number of dma_debug_entries. It can be overwritten by a kernel command line option. Some IOMMUs (e.g. GART) can't set an appropriate value by a kernel command line option because they can't know such value until they finish initializing up their hardware. This patch adds dma_debug_resize_entries() enables IOMMUs to adjust the number of dma_debug_entries anytime. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Joerg Roedel <joerg.roedel@amd.com> Cc: fujita.tomonori@lab.ntt.co.jp Cc: akpm@linux-foundation.org LKML-Reference: <20090415182234R.fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-12lockdep: warn about lockdep disabling after kernel taintFrederic Weisbecker
Impact: provide useful missing info for developers Kernel taint can occur in several situations such as warnings, load of prorietary or staging modules, bad page, etc... But when such taint happens, a developer might still be working on the kernel, expecting that lockdep is still enabled. But a taint disables lockdep without ever warning about it. Such a kernel behaviour doesn't really help for kernel development. This patch adds this missing warning. Since the taint is done most of the time after the main message that explain the real source issue, it seems safe to warn about it inside add_taint() so that it appears at last, without hurting the main information. v2: Use a generic helper to disable lockdep instead of an open coded xchg(). Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <1239412638-6739-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08printk: add support of hh length modifier for printkZhaolei
Impact: new feature, extend vsprintf format strings hh is used as length modifier for signed char or unsigned char. It is supported by glibc, we add kernel support now. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Acked-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: torvalds@linux-foundation.org Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <49CC9739.30107@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08printk: fix wrong format string iter for printkZhaolei
printk("%Q"); Output before patch: %QQ Output after patch: %Q Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Acked-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: torvalds@linux-foundation.org Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <49CC97B6.7040809@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: change swiotlb_bus_to[phys,virt] prototypesBecky Bruce
Add a hwdev argument that is needed on some architectures in order to access a per-device offset that is taken into account when producing a physical address (also needed to get from bus address to virtual address because the physical address is an intermediate step). Also make swiotlb_bus_to_virt weak so architectures can override it. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-8-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: use swiotlb_sync_single instead of duplicating codeBecky Bruce
Right now both swiotlb_sync_single_range and swiotlb_sync_sg were duplicating the code in swiotlb_sync_single. Just call it instead. Also rearrange the sync_single code for readability. Note that the swiotlb_sync_sg code was previously doing a complicated comparison to determine if an addresses needed to be unmapped where a simple is_swiotlb_buffer() call would have sufficed. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-7-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: rename unmap_single to do_unmap_singleBecky Bruce
Previously, swiotlb_unmap_page and swiotlb_unmap_sg were duplicating very similar code. Refactor that code into a new unmap_single and unmap_single use do_unmap_single. Note that the swiotlb_unmap_sg code was previously doing a complicated comparison to determine if an addresses needed to be unmapped where a simple is_swiotlb_buffer() call would have sufficed. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-6-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: allow arch override of address_needs_mappingBecky Bruce
Some architectures require additional checking to determine if a device can dma to an address and need to provide their own address_needs_mapping.. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-5-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: map_page fix for highmem systemsBecky Bruce
The current code calls virt_to_phys() on address that might be in highmem, which is bad. This wasn't needed, anyway, because we already have the physical address we need. Get rid of the now-unused virtual address as well. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-4-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: fix compile warningBecky Bruce
Squash a build warning seen on 32-bit powerpc caused by calling min() with 2 different types. Use min_t() instead. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-3-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-08swiotlb: comment correctionsBecky Bruce
Impact: cleanup swiotlb_map/unmap_single are now swiotlb_map/unmap_page; trivially change all the comments to reference new names. Also, there were some comments that should have been referring to just plain old map_single, not swiotlb_map_single; fix those as well. Also change a use of the word "pointer", when what is referred to is actually a dma/physical address. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: <1239199761-22886-2-git-send-email-galak@kernel.crashing.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-07Merge branch 'core/softlockup' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: softlockup: make DETECT_HUNG_TASK default depend on DETECT_SOFTLOCKUP softlockup: move 'one' to the softlockup section in sysctl.c softlockup: ensure the task has been switched out once softlockup: remove timestamp checking from hung_task softlockup: convert read_lock in hung_task to rcu_read_lock softlockup: check all tasks in hung_task softlockup: remove unused definition for spawn_softlockup_task softlockup: fix potential race in hung_task when resetting timeout softlockup: fix to allow compiling with !DETECT_HUNG_TASK softlockup: decouple hung tasks check from softlockup detection
2009-04-07dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)Yang Hongyang
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07Merge branch 'linus' into core/softlockupIngo Molnar
Conflicts: kernel/sysctl.c
2009-04-07softlockup: make DETECT_HUNG_TASK default depend on DETECT_SOFTLOCKUPIngo Molnar
Don't offer a default-y option when the user has turned off CONFIG_DETECT_SOFTLOCKUP already. Do offer it as 'y' only if DETECT_SOFTLOCKUP is on already. This makes it match previous behavior - where the hung-task check was embedded i CONFIG_DETECT_SOFTLOCKUP code. Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-06Merge branch 'kmemtrace-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'kmemtrace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: kmemtrace: trace kfree() calls with NULL or zero-length objects kmemtrace: small cleanups kmemtrace: restore original tracing data binary format, improve ABI kmemtrace: kmemtrace_alloc() must fill type_id kmemtrace: use tracepoints kmemtrace, rcu: don't include unnecessary headers, allow kmemtrace w/ tracepoints kmemtrace, rcu: fix rcupreempt.c data structure dependencies kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies kmemtrace, mm: fix slab.h dependency problem in mm/failslab.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_unlzma.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_bunzip2.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_inflate.c kmemtrace, squashfs: fix slab.h dependency problem in squasfs kmemtrace, befs: fix slab.h dependency problem kmemtrace, security: fix linux/key.h header file dependencies kmemtrace, fs: fix linux/fdtable.h header file dependencies kmemtrace, fs: uninline simple_transaction_set() kmemtrace, fs, security: move alloc_secdata() and free_secdata() to linux/security.h
2009-04-05Merge branch 'core/debugobjects' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core/debugobjects' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: debugobjects: delay free of internal objects debugobjects: replace static objects when slab cache becomes available debug_objects: add boot-parameter toggle to turn object debugging off again
2009-04-05Merge branch 'printk-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: printk: correct the behavior of printk_timed_ratelimit() vsprintf: unify the format decoding layer for its 3 users, cleanup fix regression from "vsprintf: unify the format decoding layer for its 3 users" vsprintf: fix bug in negative value printing vsprintf: unify the format decoding layer for its 3 users vsprintf: add binary printf printk: introduce printk_once() Fix trivial conflicts (printk_once vs log_buf_kexec_setup() added near each other) in include/linux/kernel.h.
2009-04-03Merge branch 'locking-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit] lockdep: remove duplicate CONFIG_DEBUG_LOCKDEP definitions lockdep: require framepointers for x86 lockdep: remove extra "irq" string lockdep: fix incorrect state name
2009-04-03kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_unlzma.cPekka Enberg
Impact: cleanup lib/decompress_unlzma.c depends on slab.h without including it: CC lib/decompress_unlzma.o lib/decompress_unlzma.c: In function ‘rc_free’: lib/decompress_unlzma.c:122: error: implicit declaration of function ‘kfree’ lib/decompress_unlzma.c: In function ‘unlzma’: lib/decompress_unlzma.c:551: error: implicit declaration of function ‘kmalloc’ lib/decompress_unlzma.c:551: warning: assignment makes pointer from integer without a cast make[1]: *** [lib/decompress_unlzma.o] Error 1 make: *** [lib/] Error 2 It gets included implicitly currently - but this will not be the case with upcoming kmemtrace changes. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> LKML-Reference: <1237886521.25315.58.camel@penberg-laptop> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-03kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_bunzip2.cPekka Enberg
Impact: cleanup lib/decompress_bunzip2.c depends on slab.h without including it: CC lib/decompress_bunzip2.o lib/decompress_bunzip2.c: In function ‘start_bunzip’: lib/decompress_bunzip2.c:636: error: implicit declaration of function ‘kmalloc’ lib/decompress_bunzip2.c:636: warning: assignment makes pointer from integer without a cast lib/decompress_bunzip2.c: In function ‘bunzip2’: lib/decompress_bunzip2.c:682: warning: assignment makes pointer from integer without a cast lib/decompress_bunzip2.c:693: warning: assignment makes pointer from integer without a cast lib/decompress_bunzip2.c:726: error: implicit declaration of function ‘kfree’ make[1]: *** [lib/decompress_bunzip2.o] Error 1 make: *** [lib/] Error 2 It gets included implicitly currently - but this will not be the case with upcoming kmemtrace changes. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> LKML-Reference: <1237886032.25315.48.camel@penberg-laptop> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-03kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_inflate.cPekka Enberg
Impact: fix build lib/decompress_inflate.c depends on slab.h without including it: CC lib/decompress_inflate.o lib/decompress_inflate.c: In function ‘gunzip’: lib/decompress_inflate.c:45: error: implicit declaration of function ‘kmalloc’ lib/decompress_inflate.c:45: warning: assignment makes pointer from integer without a cast lib/decompress_inflate.c:57: warning: assignment makes pointer from integer without a cast lib/decompress_inflate.c:65: warning: assignment makes pointer from integer without a cast lib/decompress_inflate.c:71: warning: assignment makes pointer from integer without a cast lib/decompress_inflate.c:154: error: implicit declaration of function ‘kfree’ make[1]: *** [lib/decompress_inflate.o] Error 1 make: *** [lib/] Error 2 It gets included implicitly currently - but this will not be the case with upcoming kmemtrace changes. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> LKML-Reference: <1237886030.25315.47.camel@penberg-laptop> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-02cpumask: fix slab corruption caused by alloc_cpumask_var_node()Jack Steiner
Fix slab corruption caused by alloc_cpumask_var_node() overwriting the tail end of an off-stack cpumask. The function zeros out cpumask bits beyond the last possible cpu. The starting point for zeroing should be the beginning of the mask offset by a byte count derived from the number of possible cpus. The offset was calculated in bits instead of bytes. This resulted in overwriting the end of the cpumask. Signed-off-by: Jack Steiner <steiner@sgi.com> Acked-by: Mike Travis <travis.sgi.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: <stable@kernel.org> [2.6.29.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-02cgroup: CSS ID supportKAMEZAWA Hiroyuki
Patch for Per-CSS(Cgroup Subsys State) ID and private hierarchy code. This patch attaches unique ID to each css and provides following. - css_lookup(subsys, id) returns pointer to struct cgroup_subysys_state of id. - css_get_next(subsys, id, rootid, depth, foundid) returns the next css under "root" by scanning When cgroup_subsys->use_id is set, an id for css is maintained. The cgroup framework only parepares - css_id of root css for subsys - id is automatically attached at creation of css. - id is *not* freed automatically. Because the cgroup framework don't know lifetime of cgroup_subsys_state. free_css_id() function is provided. This must be called by subsys. There are several reasons to develop this. - Saving space .... For example, memcg's swap_cgroup is array of pointers to cgroup. But it is not necessary to be very fast. By replacing pointers(8bytes per ent) to ID (2byes per ent), we can reduce much amount of memory usage. - Scanning without lock. CSS_ID provides "scan id under this ROOT" function. By this, scanning css under root can be written without locks. ex) do { rcu_read_lock(); next = cgroup_get_next(subsys, id, root, &found); /* check sanity of next here */ css_tryget(); rcu_read_unlock(); id = found + 1 } while(...) Characteristics: - Each css has unique ID under subsys. - Lifetime of ID is controlled by subsys. - css ID contains "ID" and "Depth in hierarchy" and stack of hierarchy - Allowed ID is 1-65535, ID 0 is UNUSED ID. Design Choices: - scan-by-ID v.s. scan-by-tree-walk. As /proc's pid scan does, scan-by-ID is robust when scanning is done by following kind of routine. scan -> rest a while(release a lock) -> conitunue from interrupted memcg's hierarchical reclaim does this. - When subsys->use_id is set, # of css in the system is limited to 65535. [bharata@linux.vnet.ibm.com: remove rcu_read_lock() from css_get_next()] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Paul Menage <menage@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>