aboutsummaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)AuthorFilesLines
2010-07-28Audit: split audit watch KconfigEric Paris2-3/+16
Audit watch should depend on CONFIG_AUDIT_SYSCALL and should select FSNOTIFY. This splits the spagetti like mixing of audit_watch and audit_filter code so they can be configured seperately. Signed-off-by: Eric Paris <[email protected]>
2010-07-28audit: reimplement audit_trees using fsnotify rather than inotifyEric Paris2-106/+132
Simply switch audit_trees from using inotify to using fsnotify for it's inode pinning and disappearing act information. Signed-off-by: Eric Paris <[email protected]>
2010-07-28fsnotify: allow addition of duplicate fsnotify marksEric Paris1-1/+1
This patch allows a task to add a second fsnotify mark to an inode for the same group. This mark will be added to the end of the inode's list and this will never be found by the stand fsnotify_find_mark() function. This is useful if a user wants to add a new mark before removing the old one. Signed-off-by: Eric Paris <[email protected]>
2010-07-28audit: do not get and put just to free a watchEric Paris3-31/+5
deleting audit watch rules is not currently done under audit_filter_mutex. It was done this way because we could not hold the mutex during inotify manipulation. Since we are using fsnotify we don't need to do the extra get/put pair nor do we need the private list on which to store the parents while they are about to be freed. Signed-off-by: Eric Paris <[email protected]>
2010-07-28audit: redo audit watch locking and refcnt in light of fsnotifyEric Paris1-40/+5
fsnotify can handle mutexes to be held across all fsnotify operations since it deals strickly in spinlocks. This can simplify and reduce some of the audit_filter_mutex taking and dropping. Signed-off-by: Eric Paris <[email protected]>
2010-07-28audit: convert audit watches to use fsnotify instead of inotifyEric Paris1-60/+148
Audit currently uses inotify to pin inodes in core and to detect when watched inodes are deleted or unmounted. This patch uses fsnotify instead of inotify. Signed-off-by: Eric Paris <[email protected]>
2010-07-28Audit: clean up the audit_watch splitEric Paris5-67/+60
No real changes, just cleanup to the audit_watch split patch which we done with minimal code changes for easy review. Now fix interfaces to make things work better. Signed-off-by: Eric Paris <[email protected]>
2010-07-28cgroups: Add an API to attach a task to current task's cgroupSridhar Samudrala1-0/+23
Add a new kernel API to attach a task to current task's cgroup in all the active hierarchies. Signed-off-by: Sridhar Samudrala <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Paul Menage <[email protected]> Acked-by: Li Zefan <[email protected]>
2010-07-27dynamic debug: move ddebug_remove_module() down into free_module()Jason Baron1-1/+3
The command echo "file ec.c +p" >/sys/kernel/debug/dynamic_debug/control causes an oops. Move the call to ddebug_remove_module() down into free_module(). In this way it should be called from all error paths. Currently, we are missing the remove if the module init routine fails. Signed-off-by: Jason Baron <[email protected]> Reported-by: Thomas Renninger <[email protected]> Tested-by: Thomas Renninger <[email protected]> Cc: <[email protected]> [2.6.32+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-07-27clocksource: Add __clocksource_updatefreq_hz/khz methodsJohn Stultz1-5/+24
To properly handle clocksources that change frequencies at the clocksource->enable() point, this patch adds a method that will update the clocksource's mult/shift and max_idle_ns values. Signed-off-by: John Stultz <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-27timekeeping: Make xtime and wall_to_monotonic staticJohn Stultz1-2/+2
This patch makes xtime and wall_to_monotonic static, as planned in Documentation/feature-removal-schedule.txt. This will allow for further cleanups to the timekeeping core. Signed-off-by: John Stultz <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-27hrtimer: Cleanup direct access to wall_to_monotonicJohn Stultz2-5/+9
Provides an accessor function to replace hrtimer.c's direct access of wall_to_monotonic. This will allow wall_to_monotonic to be made static as planned in Documentation/feature-removal-schedule.txt Signed-off-by: John Stultz <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-27timkeeping: Fix update_vsyscall to provide wall_to_monotonic offsetJohn Stultz1-3/+6
update_vsyscall() did not provide the wall_to_monotoinc offset, so arch specific implementations tend to reference wall_to_monotonic directly. This limits future cleanups in the timekeeping core, so this patch fixes the update_vsyscall interface to provide wall_to_monotonic, allowing wall_to_monotonic to be made static as planned in Documentation/feature-removal-schedule.txt Signed-off-by: John Stultz <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Tony Luck <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-27time: Kill off CONFIG_GENERIC_TIMEJohn Stultz5-73/+10
Now that all arches have been converted over to use generic time via clocksources or arch_gettimeoffset(), we can remove the GENERIC_TIME config option and simplify the generic code. Signed-off-by: John Stultz <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-27time: Implement timespec_addJohn Stultz1-3/+3
After accidentally misusing timespec_add_safe, I wanted to make sure we don't accidently trip over that issue again, so I created a simple timespec_add() function which we can use to replace the instances of timespec_add_safe() that don't want the overflow detection. Signed-off-by: John Stultz <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-26padata: Check for valid cpumasksSteffen Klassert1-1/+1
Now that we allow to change the cpumasks from userspace, we have to check for valid cpumasks in padata_do_parallel. This patch adds the necessary check. This fixes a division by zero crash if the parallel cpumask contains no active cpu. Signed-off-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2010-07-26padata: Allocate cpumask dependend recources in any caseSteffen Klassert1-17/+7
The cpumask separation work assumes the cpumask dependend recources present regardless of valid or invalid cpumasks. With this patch we allocate the cpumask dependend recources in any case. This fixes two NULL pointer dereference crashes in padata_replace and in padata_get_cpumask. Signed-off-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2010-07-26padata: Fix cpu index countingSteffen Klassert1-0/+1
The counting of the cpu index got lost with a recent commit. This patch restores it. This fixes a hang of the parallel worker threads on cpu hotplug. Signed-off-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2010-07-23posix_timer: Move copy_to_user(created_timer_id) down in timer_create()Andrey Vagin1-5/+6
According to Oleg Nesterov: We can move copy_to_user(created_timer_id) down after "if (timer_event_spec)" block too. (but before CLOCK_DISPATCH(), of course). Signed-off-by: Andrey Vagin <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Andrey Vagin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-23timer: Added usleep[_range] timerPatrick Pannuto1-0/+22
usleep[_range] are finer precision implementations of msleep and are designed to be drop-in replacements for udelay where a precise sleep / busy-wait is unnecessary. They also allow an easy interface to specify slack when a precise (ish) wakeup is unnecessary to help minimize wakeups Signed-off-by: Patrick Pannuto <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Arjan van de Ven <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-23timers: Document meaning of deferrable timerJ. Bruce Fields1-2/+7
Steal some text from 6e453a67510 "Add support for deferrable timers". A reader shouldn't have to dig through the git logs for the basic description of a deferrable timer. Signed-off-by: J. Bruce Fields <[email protected]> Cc: [email protected] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2010-07-23slow-work: kill itTejun Heo5-1377/+0
slow-work doesn't have any user left. Kill it. Signed-off-by: Tejun Heo <[email protected]> Acked-by: David Howells <[email protected]>
2010-07-23Merge branch 'tip/perf/core' of ↵Ingo Molnar7-14/+76
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
2010-07-22workqueue: fix how cpu number is stored in work->dataTejun Heo1-23/+13
Once a work starts execution, its data contains the cpu number it was on instead of pointing to cwq. This is added by commit 7a22ad75 (workqueue: carry cpu number in work data once execution starts) to reliably determine the work was last on even if the workqueue itself was destroyed inbetween. Whether data points to a cwq or contains a cpu number was distinguished by comparing the value against PAGE_OFFSET. The assumption was that a cpu number should be below PAGE_OFFSET while a pointer to cwq should be above it. However, on architectures which use separate address spaces for user and kernel spaces, this doesn't hold as PAGE_OFFSET is zero. Fix it by using an explicit flag, WORK_STRUCT_CWQ, to mark what the data field contains. If the flag is set, it's pointing to a cwq; otherwise, it contains a cpu number. Reported on s390 and microblaze during linux-next testing. Signed-off-by: Tejun Heo <[email protected]> Reported-by: Sachin Sant <[email protected]> Reported-by: Michal Simek <[email protected]> Reported-by: Martin Schwidefsky <[email protected]> Tested-by: Martin Schwidefsky <[email protected]> Tested-by: Michal Simek <[email protected]>
2010-07-22trace: strlen() return doesn't account for the NULLDan Carpenter1-1/+1
We need to add one to the strlen() return because of the NULL character. The type->name here generally comes from the kernel and I don't think any of them come close to being MAX_TRACER_SIZE (100) characters long so this is basically a cleanup. Signed-off-by: Dan Carpenter <[email protected]> LKML-Reference: <20100710100644.GV19184@bicker> Signed-off-by: Steven Rostedt <[email protected]>
2010-07-21sysrq,kdb: Use __handle_sysrq() for kdb's sysrq functionJason Wessel1-2/+1
The kdb code should not toggle the sysrq state in case an end user wants to try and resume the normal kernel execution. Signed-off-by: Jason Wessel <[email protected]> Acked-by: Dmitry Torokhov <[email protected]>
2010-07-21debug_core,kdb: fix kgdb_connected bit set in the wrong placeJason Wessel1-1/+1
Immediately following an exit from the kdb shell the kgdb_connected variable should be set to zero, unless there are breakpoints planted. If the kgdb_connected variable is not zeroed out with kdb, it is impossible to turn off kdb. This patch is merely a work around for now, the real fix will check for the breakpoints. Signed-off-by: Jason Wessel <[email protected]>
2010-07-21Fix merge regression from external kdb to upstream kdbJason Wessel1-0/+1
In the process of merging kdb to the mainline, the kdb lsmod command stopped printing the base load address of kernel modules. This is needed for using kdb in conjunction with external tools such as gdb. Simply restore the functionality by adding a kdb_printf for the base load address of the kernel modules. Signed-off-by: Jason Wessel <[email protected]>
2010-07-21repair gdbstub to match the gdbserial protocol specificationJason Wessel1-6/+3
The gdbserial protocol handler should return an empty packet instead of an error string when ever it responds to a command it does not implement. The problem cases come from a debugger client sending qTBuffer, qTStatus, qSearch, qSupported. The incorrect response from the gdbstub leads the debugger clients to not function correctly. Recent versions of gdb will not detach correctly as a result of this behavior. Signed-off-by: Jason Wessel <[email protected]> Signed-off-by: Dongdong Deng <[email protected]>
2010-07-21kdb: break out of kdb_ll() when command is terminatedMartin Hicks1-0/+3
Without this patch the "ll" linked-list traversal command won't terminate when you hit q/Q. Signed-off-by: Martin Hicks <[email protected]> Signed-off-by: Jason Wessel <[email protected]>
2010-07-21sched: Use correct macro to display sched_child_runs_first in /proc/sched_debugJosh Hunt1-1/+1
The sched_child_runs_first value in /proc/sched_debug is currently displayed using a macro meant to split ns time values. This patch uses the correct macro to display it as a plain decimal value. Signed-off-by: Josh Hunt <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-07-21Merge branch 'linus' into sched/coreIngo Molnar13-59/+87
Merge reason: Move from the -rc3 to the almost-rc6 base. Signed-off-by: Ingo Molnar <[email protected]>
2010-07-21Merge branch 'perf/core' of ↵Ingo Molnar8-524/+15
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
2010-07-21Merge branch 'linus' into perf/coreIngo Molnar1-0/+6
Merge reason: Pick up the latest perf fixes. Signed-off-by: Ingo Molnar <[email protected]>
2010-07-21tracing: Shrink max latency ringbuffer if unnecessaryKOSAKI Motohiro4-6/+38
Documentation/trace/ftrace.txt says buffer_size_kb: This sets or displays the number of kilobytes each CPU buffer can hold. The tracer buffers are the same size for each CPU. The displayed number is the size of the CPU buffer and not total size of all buffers. The trace buffers are allocated in pages (blocks of memory that the kernel uses for allocation, usually 4 KB in size). If the last page allocated has room for more bytes than requested, the rest of the page will be used, making the actual allocation bigger than requested. ( Note, the size may not be a multiple of the page size due to buffer management overhead. ) This can only be updated when the current_tracer is set to "nop". But it's incorrect. currently total memory consumption is 'buffer_size_kb x CPUs x 2'. Why two times difference is there? because ftrace implicitly allocate the buffer for max latency too. That makes sad result when admin want to use large buffer. (If admin want full logging and makes detail analysis). example, If admin have 24 CPUs machine and write 200MB to buffer_size_kb, the system consume ~10GB memory (200MB x 24 x 2). umm.. 5GB memory waste is usually unacceptable. Fortunatelly, almost all users don't use max latency feature. The max latency buffer can be disabled easily. This patch shrink buffer size of the max latency buffer if unnecessary. Signed-off-by: KOSAKI Motohiro <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
2010-07-20tracing: Reduce latency and remove percpu trace_seqLai Jiangshan1-3/+0
__print_flags() and __print_symbolic() use percpu trace_seq: 1) Its memory is allocated at compile time, it wastes memory if we don't use tracing. 2) It is percpu data and it wastes more memory for multi-cpus system. 3) It disables preemption when it executes its core routine "trace_seq_printf(s, "%s: ", #call);" and introduces latency. So we move this trace_seq to struct trace_iterator. Signed-off-by: Lai Jiangshan <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
2010-07-20trace: Reorder struct ring_buffer_per_cpu to remove padding on 64bitRichard Kennedy1-1/+1
Reorder structure to remove 8 bytes of padding on 64 bit builds. This shrinks the size to 128 bytes so allowing allocation from a smaller slab & needed one fewer cache lines. Signed-off-by: Richard Kennedy <[email protected]> LKML-Reference: <1269516456.2054.8.camel@localhost> Signed-off-by: Steven Rostedt <[email protected]>
2010-07-20tracing: Allow to disable cmdline recordingLi Zefan3-3/+36
We found that even enabling a single trace event that will rarely be triggered can add big overhead to context switch. (lmbench context switch test) ------------------------------------------------- 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ------ ------ ------ ------ ------ ------- ------- 2.19 2.3 2.21 2.56 2.13 2.54 2.07 2.39 2.51 2.35 2.75 2.27 2.81 2.24 The overhead is 6% ~ 11%. It's because when a trace event is enabled 3 tracepoints (sched_switch, sched_wakeup, sched_wakeup_new) will be activated to map pid to cmdname. We'd like to avoid this overhead, so add a trace option '(no)record-cmd' to allow to disable cmdline recording. Signed-off-by: Li Zefan <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
2010-07-20drop_monitor: convert some kfree_skb call sites to consume_skbNeil Horman1-1/+1
Convert a few calls from kfree_skb to consume_skb Noticed while I was working on dropwatch that I was detecting lots of internal skb drops in several places. While some are legitimate, several were not, freeing skbs that were at the end of their life, rather than being discarded due to an error. This patch converts those calls sites from using kfree_skb to consume_skb, which quiets the in-kernel drop_monitor code from detecting them as drops. Tested successfully by myself Signed-off-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-20workqueue: fix mayday_mask handling on UPTejun Heo1-7/+28
All cpumasks are assumed to have cpu 0 permanently set on UP, so it can't be used to signify whether there's something to be done for the CPU. workqueue was using cpumask to track which CPU requested rescuer assistance and this led rescuer thread to think there always are pending mayday requests on UP, which resulted in infinite busy loops. This patch fixes the problem by introducing mayday_mask_t and associated helpers which wrap cpumask on SMP and emulates its behavior using bitops and unsigned long on UP. Signed-off-by: Tejun Heo <[email protected]> Cc: Rusty Russell <[email protected]>
2010-07-20tracing: Use generic_file_llseek for debugfsArnd Bergmann1-0/+15
The default for llseek will change to no_llseek, so the tracing debugfs files need to add explicit .llseek assignments. Since we're dealing with regular files from a VFS perspective, use generic_file_llseek. Signed-off-by: Arnd Bergmann <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: John Kacur <[email protected]> Cc: Li Zefan <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
2010-07-20tracing: Remove special tracesFrederic Weisbecker5-146/+0
Special traces type was only used by sysprof. Lets remove it now that sysprof ftrace plugin has been dropped. Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Soeren Sandmann <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Li Zefan <[email protected]>
2010-07-20tracing: Remove sysprof ftrace pluginFrederic Weisbecker6-378/+0
The sysprof ftrace plugin doesn't seem to be seriously used somewhere. There is a branch in the sysprof tree that makes an interface to it, but the real sysprof tool uses either its own module or perf events. Drop the sysprof ftrace plugin then, as it's mostly useless. Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Soeren Sandmann <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Li Zefan <[email protected]>
2010-07-20workqueue: fix build problem on !CONFIG_SMPTejun Heo1-4/+14
Commit f3421797 (workqueue: implement unbound workqueue) incorrectly tested CONFIG_SMP as part of a C expression in alloc/free_cwqs(). As CONFIG_SMP is not defined in UP, this breaks build. Fix it by using Found during linux-next build test. Signed-off-by: Tejun Heo <[email protected]> Reported-by: Stephen Rothwell <[email protected]>
2010-07-19kmemleak: Add support for NO_BOOTMEM configurationsCatalin Marinas1-0/+6
With commits 08677214 and 59be5a8e, alloc_bootmem()/free_bootmem() and friends use the early_res functions for memory management when NO_BOOTMEM is enabled. This patch adds the kmemleak calls in the corresponding code paths for bootmem allocations. Signed-off-by: Catalin Marinas <[email protected]> Acked-by: Pekka Enberg <[email protected]> Acked-by: Yinghai Lu <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: [email protected]
2010-07-19update email addressPavel Machek5-5/+5
[email protected] no longer works, replace it with working address. Signed-off-by: Pavel Machek <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-07-19padata: Added sysfs primitives to padata subsystemDan Kruchinin1-9/+146
Added sysfs primitives to padata subsystem. Now API user may embedded kobject each padata instance contains into any sysfs hierarchy. For now padata sysfs interface provides only two objects: serial_cpumask [RW] - cpumask for serial workers parallel_cpumask [RW] - cpumask for parallel workers Signed-off-by: Dan Kruchinin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2010-07-19padata: Make two separate cpumasksDan Kruchinin1-124/+347
The aim of this patch is to make two separate cpumasks for padata parallel and serial workers respectively. It allows user to make more thin and sophisticated configurations of padata framework. For example user may bind parallel and serial workers to non-intersecting CPU groups to gain better performance. Also each padata instance has notifiers chain for its cpumasks now. If either parallel or serial or both masks were changed all interested subsystems will get notification about that. It's especially useful if padata user uses algorithm for callback CPU selection according to serial cpumask. Signed-off-by: Dan Kruchinin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2010-07-19PM / Suspend: Fix ordering of calls in suspend error pathsRafael J. Wysocki1-5/+4
The ACPI suspend code calls suspend_nvs_free() at a wrong place, which may lead to a memory leak if there's an error executing acpi_pm_prepare(), because acpi_pm_finish() will not be called in that case. However, the root cause of this problem is the apparently confusing ordering of calls in suspend error paths that needs to be fixed. In addition to that, fix a typo in a label name in suspend.c. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Len Brown <[email protected]>
2010-07-19PM / Hibernate: Fix snapshot error code pathRafael J. Wysocki1-1/+1
There is an inconsistency between hibernation_platform_enter() and hibernation_snapshot(), because the latter calls hibernation_ops->end() after failing hibernation_ops->begin(), while the former doesn't do that. Make hibernation_snapshot() behave in the same way as hibernation_platform_enter() in that respect. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Len Brown <[email protected]>