Re: rcu: Throttle rcu_try_advance_all_cbs() execution causes visible slowdown in ftrace switching

2013-11-05 Thread Petr Mladek
Hello Paul, Paul E. McKenney píše v Po 04. 11. 2013 v 09:02 -0800: On Fri, Nov 01, 2013 at 06:19:44PM +0100, Petr Mladek wrote: Hi, I am doing some clean up in x86 ftrace code. I check the performance by switching between different tracers and by enabling and disabling them

[PATCH v2 1/8] x86: speed up int3-based patching using less paranoid write

2013-11-08 Thread Petr Mladek
3m26.686s user0m0.004s 0m0.004s 0m0.004s sys 0m3.724s 0m3.772s 0m3.588s Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 49 ++- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH v2 3/8] x86: allow to call text_poke_bp during boot

2013-11-08 Thread Petr Mladek
in smp_call_function_many, kernel/smp.c:371. Note that the check might need an update when we add support for zero CPUS or complex numbers, e.g 5i-3 CPUs. The change is inspired by the code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 17

[PATCH v2 0/8] x86: use new text_poke_bp in ftrace

2013-11-08 Thread Petr Mladek
Merge branch 'tools/kvm perf fixes' Petr Mladek (8): x86: speed up int3-based patching using less paranoid write x86: return error code in text_poke_bp x86: allow to call text_poke_bp during boot x86: add generic function to modify more calls using int3 framework x86: do not trace

[PATCH v2 2/8] x86: return error code in text_poke_bp

2013-11-08 Thread Petr Mladek
) can be written and the other parts of the code can not be modified. It is probably not worth the extra complexity. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 3 ++- arch/x86/kernel/alternative.c | 18 +- 2 files changed, 15 insertions

[PATCH v2 0/8] x86: use new text_poke_bp in ftrace

2013-11-08 Thread Petr Mladek
branch 'tools/kvm perf fixes' Petr Mladek (8): x86: speed up int3-based patching using less paranoid write x86: return error code in text_poke_bp x86: allow to call text_poke_bp during boot x86: add generic function to modify more calls using int3 framework x86: do not trace

[PATCH v2 6/8] x86: modify ftrace function using the new int3-based framework

2013-11-08 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interrupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 106 --- 1 file changed, 46 insertions(+), 60 deletions

[PATCH v2 8/8] x86: enable/disable ftrace graph call using new int3-based framework

2013-11-08 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 92fe8ca..20d2028 100644 --- a/arch/x86

[PATCH v2 4/8] x86: add generic function to modify more calls using int3 framework

2013-11-08 Thread Petr Mladek
the return value. The failing address and the number of the failed record is passed via the iterator structure. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 36 ++ arch/x86/kernel/alternative.c | 251 +++-- 2 files

[PATCH v2 7/8] x86: patch all traced function calls using the int3-based framework

2013-11-08 Thread Petr Mladek
the ftrace-specific code. Well, this is the cost for using a generic API that can be used also in other locations. Signed-off-by: Petr Mladek pmla...@suse.cz --- --- arch/x86/kernel/alternative.c | 4 +- arch/x86/kernel/ftrace.c | 428 +++--- arch/x86/kernel

[PATCH v2 5/8] x86: do not trace __probe_kernel_read

2013-11-08 Thread Petr Mladek
0m17.104s 0m17.300s and after this commit: real16m14.390s16m15.200s16m19.632s user0m0.028s 0m0.024s 0m0.028s sys 0m23.788s 0m23.812s 0m23.804s Signed-off-by: Petr Mladek pmla...@suse.cz --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 0/6] x86: use new text_poke_bp in ftrace

2013-10-18 Thread Petr Mladek
the patches accordingly. The patches are agaist kernel/git/tip/tip.git on top of the commit f3db36699379159b761cdbc (Merge branch 'sched/core'). Petr Mladek (6) x86: speed up int3-based patching using less paranoid x86: allow to call text_poke_bp during boot x86: allow to modify more

[PATCH 6/6] x86: enable/disable ftrace graph call using new int3-based framework

2013-10-18 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index f3c5f3a..d550ce9 100644 --- a/arch/x86

[PATCH 5/6] x86: patch all traced function calls using the int3-based framework

2013-10-18 Thread Petr Mladek
. Otherwise, we get either infinite loop or too many operations going through the relatively slow handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 6 +- arch/x86/kernel/ftrace.c | 461 +- arch/x86/kernel/traps.c

[PATCH 2/6] x86: allow to call text_poke_bp during boot

2013-10-18 Thread Petr Mladek
the current code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index f714316..13cae15

[PATCH 4/6] x86: modify ftrace function using the new int3-based framework

2013-10-18 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 105 --- 1 file changed, 45 insertions(+), 60 deletions

[PATCH 3/6] x86: allow to modify more instructions in one text_poke_bp call

2013-10-18 Thread Petr Mladek
. Finally, the list of handlers is optional. ftrace and jump labels pretend that there are nops. Hence. the int3 handler could calculate the next IP address from the lenght of the patched instruction. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 3 +- arch/x86

[PATCH 1/6] x86: speed up int3-based patching using less paranoid write

2013-10-18 Thread Petr Mladek
code is guarded by the int3 handler. The int3 interupt itself is added and removed by an atomic operation because we modify only one byte. This patch adds text_poke_part which is inspired by ftrace_write. Then it is used in text_poke_bp instead of the paranoid text_poke. Signed-off-by: Petr Mladek

[PATCH v4 0/8] x86: use new text_poke_bp in ftrace

2013-11-25 Thread Petr Mladek
0m0.052s 0m0.056s 0m0.052s sys 0m20.236s 0m20.068s 0m20.264s The patches are against kernel/git/tip/tip.git on top of the commit af7949e870d4632b Merge branch 'tools/kvm perf fixes' Petr Mladek (8): x86: allow to handle errors in text_poke function family x86: allow

[PATCH v4 1/8] x86: allow to handle errors in text_poke function family

2013-11-25 Thread Petr Mladek
but the operation can not be finished. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 7 +++-- arch/x86/kernel/alternative.c | 59 -- arch/x86/kernel/jump_label.c | 11 --- arch/x86/kernel/kgdb.c | 11

[PATCH v4 2/8] x86: allow to call text_poke_bp during boot

2013-11-25 Thread Petr Mladek
in smp_call_function_many, kernel/smp.c:371. The change is inspired by the code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH v4 3/8] x86: add generic function to modify more calls using int3 framework

2013-11-25 Thread Petr Mladek
the return value. The failing address and the number of the failed record is passed via the iterator structure. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 36 ++ arch/x86/kernel/alternative.c | 256 +++-- 2 files

[PATCH v4 5/8] x86: do not trace __probe_kernel_read

2013-11-25 Thread Petr Mladek
0m17.104s 0m17.300s and after this commit: real16m14.390s16m15.200s16m19.632s user0m0.028s 0m0.024s 0m0.028s sys 0m23.788s 0m23.812s 0m23.804s Signed-off-by: Petr Mladek pmla...@suse.cz --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v4 4/8] x86: speed up int3-based patching using direct write

2013-11-25 Thread Petr Mladek
0m0.004s 0m0.004s 0m0.004s sys 0m3.724s 0m3.772s 0m3.588s Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 67 --- 1 file changed, 57

[PATCH v4 6/8] x86: modify ftrace function using the new int3-based framework

2013-11-25 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interrupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 106 --- 1 file changed, 46 insertions(+), 60 deletions

[PATCH v4 7/8] x86: patch all traced function calls using the int3-based framework

2013-11-25 Thread Petr Mladek
the ftrace-specific code. Well, this is the cost for using a generic API that can be used also in other locations. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 14 +- arch/x86/kernel/ftrace.c | 428 +++--- arch/x86/kernel/traps.c

[PATCH v4 8/8] x86: enable/disable ftrace graph call using new int3-based framework

2013-11-25 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 92fe8cac0802..20d20289f402 100644

Re: [PATCH v2 1/8] x86: speed up int3-based patching using less paranoid write

2013-11-12 Thread Petr Mladek
Steven Rostedt píše v Pá 08. 11. 2013 v 07:43 -0500: On Fri, 08 Nov 2013 21:04:26 +0900 Masami Hiramatsu masami.hiramatsu...@hitachi.com wrote: (2013/11/08 18:12), Petr Mladek wrote: This change is inspired by the int3-based patching code used in ftrace. See the commit fd4363fff3d9

[PATCH v3 0/8] x86: use new text_poke_bp in ftrace

2013-11-14 Thread Petr Mladek
Merge branch 'tools/kvm perf fixes' Petr Mladek (8): x86: allow to handle errors in text_poke function family x86: allow to call text_poke_bp during boot x86: add generic function to modify more calls using int3 framework x86: speed up int3-based patching using direct write x86: do not trace

[PATCH v3 3/8] x86: add generic function to modify more calls using int3 framework

2013-11-14 Thread Petr Mladek
the return value. The failing address and the number of the failed record is passed via the iterator structure. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 36 ++ arch/x86/kernel/alternative.c | 256 +++-- 2 files

[PATCH v3 2/8] x86: allow to call text_poke_bp during boot

2013-11-14 Thread Petr Mladek
in smp_call_function_many, kernel/smp.c:371. The change is inspired by the code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/alternative.c b

[PATCH v3 1/8] x86: allow to handle errors in text_poke function family

2013-11-14 Thread Petr Mladek
but the operation can not be finished. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 7 +++-- arch/x86/kernel/alternative.c | 64 -- arch/x86/kernel/jump_label.c | 11 --- arch/x86/kernel/kgdb.c | 11

[PATCH v3 6/8] x86: modify ftrace function using the new int3-based framework

2013-11-14 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interrupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 106 --- 1 file changed, 46 insertions(+), 60 deletions

[PATCH v3 4/8] x86: speed up int3-based patching using direct write

2013-11-14 Thread Petr Mladek
0m0.004s 0m0.004s 0m0.004s sys 0m3.724s 0m3.772s 0m3.588s Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 67 --- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH v3 5/8] x86: do not trace __probe_kernel_read

2013-11-14 Thread Petr Mladek
0m17.104s 0m17.300s and after this commit: real16m14.390s16m15.200s16m19.632s user0m0.028s 0m0.024s 0m0.028s sys 0m23.788s 0m23.812s 0m23.804s Signed-off-by: Petr Mladek pmla...@suse.cz --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v3 7/8] x86: patch all traced function calls using the int3-based framework

2013-11-14 Thread Petr Mladek
the ftrace-specific code. Well, this is the cost for using a generic API that can be used also in other locations. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 14 +- arch/x86/kernel/ftrace.c | 428 +++--- arch/x86/kernel/traps.c

[PATCH v3 8/8] x86: enable/disable ftrace graph call using new int3-based framework

2013-11-14 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 92fe8ca..20d2028 100644 --- a/arch/x86

Re: [PATCH v3 4/8] x86: speed up int3-based patching using direct write

2013-11-14 Thread Petr Mladek
Masami Hiramatsu píše v Čt 14. 11. 2013 v 20:36 +0900: (2013/11/14 19:41), Petr Mladek wrote: @@ -837,7 +882,7 @@ static void recover_iter(struct text_poke_bp_iter *iterator, } /* Finally, put back the first byte from the old code */ - err = text_poke(addr, old_opcode

[PATCH] ipc: avoid overflow of semop undo (semadj) value

2013-12-03 Thread Petr Mladek
2nd deposit); return 1; } if (semop(semid, collector_op, 2) == -1) { perror(Failed to do 2nd collect); return 1; } return 0; It passes without error now but the semadj value has overflown in the 2nd collector operation. Signed-off-by: Petr Mladek pmla...@suse.cz

[PATCH v5 0/8] x86: use new text_poke_bp in ftrace

2013-12-03 Thread Petr Mladek
0m20.264s The patches are against kernel/git/tip/tip.git on top of the commit c22638a1d22e79c Merge branch 'tools/kvm' Petr Mladek (8): x86: allow to handle errors in text_poke function family x86: allow to call text_poke_bp during boot x86: add generic function to modify more calls using int3

[PATCH v5 1/8] x86: allow to handle errors in text_poke function family

2013-12-03 Thread Petr Mladek
but the operation can not be finished. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 7 +++-- arch/x86/kernel/alternative.c | 59 -- arch/x86/kernel/jump_label.c | 11 --- arch/x86/kernel/kgdb.c | 11

[PATCH v5 2/8] x86: allow to call text_poke_bp during boot

2013-12-03 Thread Petr Mladek
in smp_call_function_many, kernel/smp.c:371. The change is inspired by the code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH v5 3/8] x86: add generic function to modify more calls using int3 framework

2013-12-03 Thread Petr Mladek
the return value. The failing address and the number of the failed record is passed via the iterator structure. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 36 ++ arch/x86/kernel/alternative.c | 256 +++-- 2 files

[PATCH v5 5/8] x86: do not trace __probe_kernel_read

2013-12-03 Thread Petr Mladek
0m17.104s 0m17.300s and after this commit: real16m14.390s16m15.200s16m19.632s user0m0.028s 0m0.024s 0m0.028s sys 0m23.788s 0m23.812s 0m23.804s Signed-off-by: Petr Mladek pmla...@suse.cz --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 6/8] x86: modify ftrace function using the new int3-based framework

2013-12-03 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interrupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 120 +++ 1 file changed, 47 insertions(+), 73 deletions

[PATCH v5 4/8] x86: speed up int3-based patching using direct write

2013-12-03 Thread Petr Mladek
0m0.004s 0m0.004s 0m0.004s sys 0m3.724s 0m3.772s 0m3.588s Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 67 --- 1 file changed, 57

[PATCH v5 8/8] x86: enable/disable ftrace graph call using new int3-based framework

2013-12-03 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 92fe8cac0802..20d20289f402 100644

[PATCH v5 7/8] x86: patch all traced function calls using the int3-based framework

2013-12-03 Thread Petr Mladek
the ftrace-specific code. Well, this is the cost for using a generic API that can be used also in other locations. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 14 +- arch/x86/kernel/ftrace.c | 428 +++--- arch/x86/kernel/traps.c

[BUG] ftrace: support for SOFT_DISABLE to syscall events caused huge slowdown of ftrace startup test

2013-12-03 Thread Petr Mladek
Hi, I tested my ftrace-related patches and enabled also the startup test: CONFIG_FTRACE_SELFTEST=y CONFIG_FTRACE_STARTUP_TEST=y On today's kernel/git/tip/tip.git, the boot freezed for 1 minute when doing Testing event system syscalls. A bisect pointed finger to the commit

Re: [BUG] ftrace: support for SOFT_DISABLE to syscall events caused huge slowdown of ftrace startup test

2013-12-04 Thread Petr Mladek
Steven Rostedt píše v Út 03. 12. 2013 v 12:41 -0500: On Tue, 03 Dec 2013 18:16:09 +0100 Petr Mladek pmla...@suse.cz wrote: Hi, I tested my ftrace-related patches and enabled also the startup test: CONFIG_FTRACE_SELFTEST=y CONFIG_FTRACE_STARTUP_TEST=y On today's kernel

[PATCH v2 0/3] ftrace/x86: Recovery code fixes and improvements

2014-02-24 Thread Petr Mladek
was not brave enough to do modify the generic code when I sent the patch on Friday. Petr Mladek (3): ftrace/x86: One more missing sync after fixup of function modification failure ftrace: Warn on error when modifying ftrace function ftrace/x86: BUG when ftrace recovery fails arch/x86

[PATCH 2/3] ftrace: Warn on error when modifying ftrace function

2014-02-24 Thread Petr Mladek
in ftrace_replace_code(). We print more details about the particular failing address via ftrace_bug() there. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/trace/ftrace.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace

[PATCH 1/3] ftrace/x86: One more missing sync after fixup of function modification failure

2014-02-24 Thread Petr Mladek
If a failure occurs while modifying ftrace function, it bails out and will remove the tracepoints to be back to what the code originally was. There is missing the final sync run across the CPUs after the fix up is done and before the ftrace int3 handler flag is reset. Signed-off-by: Petr Mladek

[PATCH 3/3] ftrace/x86: BUG when ftrace recovery fails

2014-02-24 Thread Petr Mladek
. The return value was ignored before, so it does not cause any troubles. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index

[PATCH 1/5] printk: Remove duplicated check for log level

2014-02-14 Thread Petr Mladek
The check for the exact log level is already done in printk_get_level. We do not need to duplicate it in printk_skip_level. Signed-off-by: Petr Mladek pmla...@suse.cz --- include/linux/printk.h | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/linux/printk.h

[PATCH 0/5] printk: Use whole ring buffer + some clean up

2014-02-14 Thread Petr Mladek
a comment that would have saved me some time when trying to understand the code. Well, maybe it is useful only for kernel newbies like me ;-) 4th patch fixes two problems from the by-one department. They caused that we have newer used the last 4 bytes of the ring buffer. Petr Mladek (5): printk

[PATCH 2/5] printk: Remove obsolete check for log level c

2014-02-14 Thread Petr Mladek
The kernel log level c has been removed in the commit 61e99ab8e35a88b8 (printk: remove the now unnecessary C annotation for KERN_CONT). It is not longer detected in printk_get_level. Hence we do not need to check it in vprintk_emit. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk

[PATCH 3/5] printk: Add comment about tricky check for text buffer size

2014-02-14 Thread Petr Mladek
There is no check for potential text_len overflow. It is not needed because only valid level is detected. It took me some time to understand why. It would deserve a comment ;-) Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH 4/5] printk: Use also the last bytes in the ring buffer

2014-02-14 Thread Petr Mladek
. Then the beginning of the buffer is rewritten and valid entries get corrupted. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index bc6eed48a454..a463707ca88f

[PATCH 5/5] printk: Do not compute the size of the message twice

2014-02-14 Thread Petr Mladek
This is just a tiny optimization. It removes duplicate computation of the message size. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index a463707ca88f

[PATCH 0/4] x86: Fix ftrace recovery when code modification failed

2014-02-17 Thread Petr Mladek
restrictions. I did not find a way how to make the universal text_poke_bp effective, safe, and clean to be usable there. The patch set is against linux/tip. Last commit is a5b3cca53c43c3ba7 (Merge tag 'v3.14-rc3') Petr Mladek (4): x86: Clean up remove_breakpoint() in ftrace code x86: Fix ftrace

[PATCH 2/4] x86: Fix ftrace patching recovery code to work on x86_64

2014-02-17 Thread Petr Mladek
the address is read-only. We need to use ftrace_write() that gets write access via the kernel identity mapping. It is used everywhere else in the code. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86

[PATCH 3/4] x86: BUG when ftrace patching recovery fails

2014-02-17 Thread Petr Mladek
is not handled or an invalid instruction is proceed. A better solution is to BUG() when the recovery fails. It helps to point to the sinner responsible for the reboot. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions

[PATCH 4/4] x86: Fix order of warning messages when ftrace modifies code

2014-02-17 Thread Petr Mladek
The colon at the end of the printk message suggests that it should get printed before the details printed by ftrace_bug(). When touching the line, let's use the preferred pr_warn() macro as suggested by checkpatch.pl. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 2

[PATCH 1/4] x86: Clean up remove_breakpoint() in ftrace code

2014-02-17 Thread Petr Mladek
The ftrace recovery code does not work on x86_64. I tried to debug it and got a bit confused by remove_breakpoint(). One problem was reusing the nop pointer for different types of code. Also the combination of two level if-condition and goto was a bit tricky. Signed-off-by: Petr Mladek pmla

rcu: Throttle rcu_try_advance_all_cbs() execution causes visible slowdown in ftrace switching

2013-11-01 Thread Petr Mladek
Hi, I am doing some clean up in x86 ftrace code. I check the performance by switching between different tracers and by enabling and disabling them. The operation has started to be much slower after rebasing on the kernel tip tree. Bisecting has shown that the difference was caused by the commit

[RFC PATCH 00/11] printk: safe printing in NMI context

2014-05-09 Thread Petr Mladek
. The last commit is a42b108e06bb28348 (Add linux-next specific files for 20140507). It can be applied also on the Linus' tree if you apply the recent patches that touch kernel/printk/printk.c Petr Mladek (11): printk: rename struct printk_log to printk_msg printk: allow to handle more log buffers

[RFC PATCH 02/11] printk: allow to handle more log buffers

2014-05-09 Thread Petr Mladek
into the ring buffer, will work with the selected ring buffer and we need to pass it as a parameter. IMPORTANT: This change causes problems for the external tools that are accessing the structures, e.g. crash, makedumpfile. They need to get updated. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel

[RFC PATCH 01/11] printk: rename struct printk_log to printk_msg

2014-05-09 Thread Petr Mladek
for the NMI log buffer. IMPORTANT: This change causes problems for the external tools that are accessing the structures, e.g. crash, makedumpfile. They need to get updated. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 100 - 1

[RFC PATCH 05/11] printk: allow to modify NMI log buffer size using boot parameter

2014-05-09 Thread Petr Mladek
the index. Signed-off-by: Petr Mladek pmla...@suse.cz --- Documentation/kernel-parameters.txt | 19 +-- kernel/printk/printk.c | 22 +- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation

[RFC PATCH 03/11] printk: rename logbuf_lock to main_logbuf_lock

2014-05-09 Thread Petr Mladek
Make the naming consistent with the main_log and main_cont. This commit does not change the behavior. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 98 +- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git

[RFC PATCH 04/11] printk: add NMI ring and cont buffers

2014-05-09 Thread Petr Mladek
for the printed messages. The logic for using the NMI buffer will be added in followup patches. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 104 ++--- 1 file changed, 91 insertions(+), 13 deletions(-) diff --git a/kernel

[RFC PATCH 06/11] printk: NMI safe printk

2014-05-09 Thread Petr Mladek
in a single unsigned long and accessed by the bunch of helper functions. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 282 + 1 file changed, 261 insertions(+), 21 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk

[RFC PATCH 07/11] printk: right ordering of the cont buffers from NMI context

2014-05-09 Thread Petr Mladek
case, this patch helped a lot. Especially it fixed problems with ordering of the line parts. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c

[RFC PATCH 08/11] printk: try hard to print Oops message in NMI context

2014-05-09 Thread Petr Mladek
and flush the buffer. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 7c992b8f44a4..cc6e77f6d72b 100644 --- a/kernel/printk/printk.c

[RFC PATCH 09/11] printk: merge and flush NMI buffer predictably via IRQ work

2014-05-09 Thread Petr Mladek
. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 131 - 1 file changed, 74 insertions(+), 57 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index cc6e77f6d72b..874ebab41ba3 100644 --- a/kernel/printk

[RFC PATCH 10/11] printk: survive rotation of sequence numbers

2014-05-09 Thread Petr Mladek
NMI log buffer uses half of unsigned long to store the sequence number. The maximum value might be relatively small, especially on 32-bit systems. This patch makes the check for free space more strict, so it does give false results after the rotation. Signed-off-by: Petr Mladek pmla...@suse.cz

[RFC PATCH 11/11] printk: avoid staling when merging NMI log buffer

2014-05-09 Thread Petr Mladek
limit 5000 messages. The number is sucked out of my little finger ;-) I would feel better with some limit but I also might be too paranoid. Any better idea is welcome. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[PATCH] ftrace/x86: Call text_ip_addr() instead of the duplicated code

2014-06-03 Thread Petr Mladek
(ftrace/x86: Use breakpoints for converting function graph caller). Anyway, better do it now before it shots people into their leg ;-) Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled

2014-06-04 Thread Petr Mladek
This is just a tiny optimization. The remapping is not needed when the kernel text mapping is read write all the time. Suggested-by: Jan Beulich jbeul...@suse.com Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

Re: [PATCH v6 1/8] x86: allow to handle errors in text_poke function family

2014-01-21 Thread Petr Mladek
On Tue, 2014-01-14 at 18:20 -0500, Steven Rostedt wrote: FYI, for future patches, start the subject with a capital letter. ie: x86: Allow to handle errors in text_poke function family On Tue, 10 Dec 2013 16:42:13 +0100 Petr Mladek pmla...@suse.cz wrote: The text_poke functions called

Re: [PATCH v6 3/8] x86: add generic function to modify more calls using int3 framework

2014-01-21 Thread Petr Mladek
On Tue, 2014-01-14 at 19:33 -0500, Steven Rostedt wrote: On Tue, 10 Dec 2013 16:42:15 +0100 Petr Mladek pmla...@suse.cz wrote: diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 6436beec7b0c..8e57ac03a0e8 100644 --- a/arch/x86/kernel/alternative.c +++ b

Re: [PATCH v6 7/8] x86: patch all traced function calls using the int3-based framework

2014-01-22 Thread Petr Mladek
On Wed, 2014-01-15 at 10:47 -0500, Steven Rostedt wrote: On Tue, 10 Dec 2013 16:42:19 +0100 Petr Mladek pmla...@suse.cz wrote: diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 03abf9abf681..e5c02af3a8cc 100644 --- a/arch/x86/kernel/alternative.c +++ b

Re: [PATCH v6 7/8] x86: patch all traced function calls using the int3-based framework

2014-01-23 Thread Petr Mladek
On Wed, 2014-01-22 at 14:20 +0100, Petr Mladek wrote: On Wed, 2014-01-15 at 10:47 -0500, Steven Rostedt wrote: On Tue, 10 Dec 2013 16:42:19 +0100 Petr Mladek pmla...@suse.cz wrote: diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 03abf9abf681

[PATCH v6 0/8] x86: use new text_poke_bp in ftrace

2013-12-10 Thread Petr Mladek
0m20.236s 0m20.068s 0m20.264s The patches are against kernel/git/tip/tip.git on top of the commit 631d5ea8b461f906f87c864f1c27db6eb5211591 (Merge branch 'linus') Petr Mladek (8): x86: allow to handle errors in text_poke function family x86: allow to call text_poke_bp during boot x86

[PATCH v6 1/8] x86: allow to handle errors in text_poke function family

2013-12-10 Thread Petr Mladek
functions were used and the error code has to be handled now. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 10 +-- arch/x86/kernel/alternative.c | 61 ++ arch/x86/kernel/jump_label.c | 7 +++-- arch/x86

[PATCH v6 2/8] x86: allow to call text_poke_bp during boot

2013-12-10 Thread Petr Mladek
in smp_call_function_many, kernel/smp.c:371. The change is inspired by the code in arch/x86/kernel/ftrace.c. Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH v6 5/8] x86: do not trace __probe_kernel_read

2013-12-10 Thread Petr Mladek
0m17.104s 0m17.300s and after this commit: real16m14.390s16m15.200s16m19.632s user0m0.028s 0m0.024s 0m0.028s sys 0m23.788s 0m23.812s 0m23.804s Signed-off-by: Petr Mladek pmla...@suse.cz --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v6 3/8] x86: add generic function to modify more calls using int3 framework

2013-12-10 Thread Petr Mladek
the return value. The failing address and the number of the failed record is passed via the iterator structure. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/include/asm/alternative.h | 36 ++ arch/x86/kernel/alternative.c | 257 +++-- 2 files

[PATCH v6 4/8] x86: speed up int3-based patching using direct write

2013-12-10 Thread Petr Mladek
0m0.004s 0m0.004s 0m0.004s sys 0m3.724s 0m3.772s 0m3.588s Signed-off-by: Petr Mladek pmla...@suse.cz Reviewed-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com --- arch/x86/kernel/alternative.c | 67 --- 1 file changed, 57

[PATCH v6 6/8] x86: modify ftrace function using the new int3-based framework

2013-12-10 Thread Petr Mladek
need to set modifying_ftrace_code in ftrace_update_ftrace_func. The int3 interrupt will be handled by poke_int3_handler. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 120 +++ 1 file changed, 47 insertions(+), 73 deletions

[PATCH v6 7/8] x86: patch all traced function calls using the int3-based framework

2013-12-10 Thread Petr Mladek
the ftrace-specific code. Well, this is the cost for using a generic API that can be used also in other locations. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/alternative.c | 14 +- arch/x86/kernel/ftrace.c | 428 +++--- arch/x86/kernel/traps.c

[PATCH v6 8/8] x86: enable/disable ftrace graph call using new int3-based framework

2013-12-10 Thread Petr Mladek
the change. Signed-off-by: Petr Mladek pmla...@suse.cz --- arch/x86/kernel/ftrace.c | 63 +++- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 92fe8cac0802..20d20289f402 100644

Re: [PATCH v6 2/8] x86: allow to call text_poke_bp during boot

2013-12-10 Thread Petr Mladek
Borislav Petkov píše v Út 10. 12. 2013 v 17:08 +0100: On Tue, Dec 10, 2013 at 11:01:57AM -0500, Steven Rostedt wrote: That can be changed in a later patch if needed. It's a static function so the visibility is limited. Not to mention, it was just moved from ftrace.c which calls it

[PATCH 0/5] printk: Check for too long messages

2014-04-10 Thread Petr Mladek
. The patches can be applied against both linux.git and linux-next.git. Just a heads up. These patches were created when working safe printk in NMI context. I have resolved most problems, including my sickness, and should be able to send the NMI stuff soon. Petr Mladek (5): printk: Split code for making

[PATCH 1/5] printk: Split code for making free space in the log buffer

2014-04-10 Thread Petr Mladek
There will be needed some fixes in the check for free space. They will be easier if the code is moved outside of the quite long log_store() function. This patch does not change the existing behavior. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 44

[PATCH 2/5] printk: Ignore too long messages

2014-04-10 Thread Petr Mladek
ignores the problematic message. Let's do something better in a followup patch. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 30 +++--- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c

[PATCH 4/5] printk: Shrink too long messages

2014-04-10 Thread Petr Mladek
dictionary. We do not want to parse it or break it in the middle of some pair of values. It would not cause any real harm but still. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 42 +++--- 1 file changed, 39 insertions(+), 3 deletions

[PATCH 3/5] printk: Split message size computation

2014-04-10 Thread Petr Mladek
messages safe way in NMI context. This patch does not change the existing behavior. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel/printk/printk.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index

[PATCH 5/5] printk: Return really stored message length

2014-04-10 Thread Petr Mladek
() but we could ignore the return value there. The function works with characters that were already counted earlier. In addition, the store could newer fail here because the length of the printed text is limited by the cont buffer and dict is NULL. Signed-off-by: Petr Mladek pmla...@suse.cz --- kernel

  1   2   3   4   5   6   7   8   9   10   >