[RFC PATCH] panic: fix deadlock in panic()

2020-06-03 Thread Cheng Jian
, it will try to hold the logbuf_lock. To avoid this deadlock, drop the num_online_cpus() check and call the printk_safe_flush_on_panic() before panic_notifier_list callback, attempt to re-init logbuf_lock from panic CPU. Signed-off-by: Cheng Jian --- kernel/panic.c | 3 +++ kernel

[PATCH] module: make module symbols visible after init

2020-06-03 Thread Cheng Jian
llsyms_lookup_name() and kallsyms_on_each_symbol()") restricts the invocation for kernel unexported symbols, but it is still incorrect to make the symbols of non-LIVE modules visible to the outside. Signed-off-by: Cheng Jian --- kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] perf/evsel: Fix missing close fd when ignore_missing_thread

2020-05-30 Thread Cheng Jian
remove it. Fixes: ca8000684ec4 ("perf evsel: Enable ignore_missing_thread for pid option") Signed-off-by: Cheng Jian --- tools/perf/util/evsel.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index eb

[PATCH] ftrace: show debugging information when panic_on_warn set

2020-05-15 Thread Cheng Jian
+0x204/0x238 Signed-off-by: Cheng Jian --- kernel/trace/ftrace.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index bd030b1b9514..cd39cbf3631a 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2027,14

[PATCH] sched/core: decrease rq->nr_uninterruptible before set_task_cpu

2019-08-06 Thread Cheng Jian
rq->nr_uninterruptible to atomic_t. Signed-off-by: Cheng Jian --- kernel/sched/core.c| 14 +- kernel/sched/debug.c | 2 +- kernel/sched/loadavg.c | 2 +- kernel/sched/sched.h | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/kernel/sched/core.c b/

[PATCH] epoll: optimize epmutex in ep_free and eventpoll_release_file

2019-07-27 Thread Cheng Jian
RPS is ~240K. We also measure the overhead of eventpoll_release_file() and its children by perf: 29% before and 2% after. Link : https://lkml.org/lkml/2017/10/28/81 Signed-off-by: Cheng Jian Signed-off-by: Hou Tao --- fs/eventpoll.c | 106 ++--- 1 f

[PATCH] Revert "x86/module: Detect and skip invalid relocations"

2019-06-20 Thread Cheng Jian
' To fix this, just revert that commit. Signed-off-by: Cheng Jian --- arch/x86/kernel/module.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index d5c72cb..3eb23a8 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel

[PATCH] ftrace: enable trampoline when rec count decrement to one

2019-05-04 Thread Cheng Jian
l/debug/tracing/enabled_functions unshare_files (1) R I tramp: 0xc000(klp_ftrace_handler+0x0/0xa0) ->ftrace_ops_assist_func+0x0/0xf0 Signed-off-by: Cheng Jian --- kernel/trace/ftrace.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --

[PATCH] sched/fair: Use 'unsigned long' for group_shares,group_runnable

2019-04-12 Thread Cheng Jian
el0_svc_handler+0x50/0xa8 el0_svc+0x8/0xc == Cc: sta...@vger.kernel.org Signed-off-by: Cheng Jian --- kernel/sched/fair.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b

[PATCH v3] perf/trace : Fix repetitious traces of perf on tracepoint

2018-01-16 Thread Cheng Jian
1040 [002]36.536079: sched:sched_wakeup_new: comm=test_fork pid=1041 prio=120 target_cpu=003 It will match it only once for tracing task(child-1041). Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/events/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel

[PATCH v3] perf/trace : Fix repetitious traces of perf on tracepoint

2018-01-16 Thread Cheng Jian
1040 [002]36.536079: sched:sched_wakeup_new: comm=test_fork pid=1041 prio=120 target_cpu=003 It will match it only once for tracing task(child-1041). Signed-off-by: Cheng Jian --- kernel/events/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/co

[PATCH v2] perf/trace : Fix repetitious traces of perf on tracepoint

2018-01-15 Thread Cheng Jian
1 prio=120 target_cpu=003 bug_fork 1040 [002]36.536079: sched:sched_wakeup_new: comm=bug_fork pid=1041 prio=120 target_cpu=003 match it twice, an match for tracing current(parent) and an match for task(child). Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/events/

[PATCH v2] perf/trace : Fix repetitious traces of perf on tracepoint

2018-01-15 Thread Cheng Jian
1 prio=120 target_cpu=003 bug_fork 1040 [002]36.536079: sched:sched_wakeup_new: comm=bug_fork pid=1041 prio=120 target_cpu=003 match it twice, an match for tracing current(parent) and an match for task(child). Signed-off-by: Cheng Jian --- kernel/events/core.c | 2 ++ 1 file

[PATCH] perf/trace : Fix repetitious traces of perf on tracepoint When i use perf to trace the sched_wakeup_new tracepoint, there is a bug that output the same event repetitiously. It can be reproduce

2018-01-15 Thread Cheng Jian
003 match it twice, an match for tracing current(parent) and an match for task(child). Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/events/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index 4df5b69..a199c03 100644 ---

[PATCH] perf/trace : Fix repetitious traces of perf on tracepoint When i use perf to trace the sched_wakeup_new tracepoint, there is a bug that output the same event repetitiously. It can be reproduce

2018-01-15 Thread Cheng Jian
003 match it twice, an match for tracing current(parent) and an match for task(child). Signed-off-by: Cheng Jian --- kernel/events/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index 4df5b69..a199c03 100644 --- a/kernel/events/core.c +++ b/ker

[PATCH] kprobe : fix out-of-bounds in register_kretprobe when parsing negative data_size

2017-12-13 Thread Cheng Jian
fc fc fc fc b732a700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >b732a780: 00 00 00 00 07 fc fc fc fc fc fc fc fc fc fc fc ^ If data_size is invalid, then we should not register it. Signed-off-by: Cheng Jian <cj.chengj...@huawe

[PATCH] kprobe : fix out-of-bounds in register_kretprobe when parsing negative data_size

2017-12-13 Thread Cheng Jian
fc fc fc fc b732a700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >b732a780: 00 00 00 00 07 fc fc fc fc fc fc fc fc fc fc fc ^ If data_size is invalid, then we should not register it. Signed-off-by: Cheng Jian Reported-by: Kong ZhangHuan --

[tip:sched/core] sched/fair: Remove unused 'curr' parameter from wakeup_gran

2017-12-08 Thread tip-bot for Cheng Jian
Commit-ID: a555e9d86ee384d9d3cb3310a57aed33f7e053d4 Gitweb: https://git.kernel.org/tip/a555e9d86ee384d9d3cb3310a57aed33f7e053d4 Author: Cheng Jian <cj.chengj...@huawei.com> AuthorDate: Thu, 7 Dec 2017 21:30:43 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 8

[tip:sched/core] sched/fair: Remove unused 'curr' parameter from wakeup_gran

2017-12-08 Thread tip-bot for Cheng Jian
Commit-ID: a555e9d86ee384d9d3cb3310a57aed33f7e053d4 Gitweb: https://git.kernel.org/tip/a555e9d86ee384d9d3cb3310a57aed33f7e053d4 Author: Cheng Jian AuthorDate: Thu, 7 Dec 2017 21:30:43 +0800 Committer: Ingo Molnar CommitDate: Fri, 8 Dec 2017 07:51:53 +0100 sched/fair: Remove unused

[PATCH] sched: remove unused parameter from wakeup_gran

2017-12-07 Thread Cheng Jian
The first parameter 'curr' in wakeup_gran is unnecessary now. Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4037e19..005e196 100644 --- a/

[PATCH] sched: remove unused parameter from wakeup_gran

2017-12-07 Thread Cheng Jian
The first parameter 'curr' in wakeup_gran is unnecessary now. Signed-off-by: Cheng Jian --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4037e19..005e196 100644 --- a/kernel/sched/fair.c +++ b/kernel

[PATCH] futex: use fault_in to avoid infinite loop

2017-12-06 Thread Cheng Jian
goto retry */ //.. } So retry - => goto retry -=> retry -=> goto retry ... Then dead loop here. So use fault_in to avoid it, It will not enter the retry label twice under this branch. Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> -

[PATCH] futex: use fault_in to avoid infinite loop

2017-12-06 Thread Cheng Jian
goto retry */ //.. } So retry - => goto retry -=> retry -=> goto retry ... Then dead loop here. So use fault_in to avoid it, It will not enter the retry label twice under this branch. Signed-off-by: Cheng Jian --- kernel/futex.c | 9 +++-

[tip:locking/core] locking/rwlocks: Fix comments

2017-11-07 Thread tip-bot for Cheng Jian
Commit-ID: f791dd2589d7e217625d7e411621a5bac71cbf69 Gitweb: https://git.kernel.org/tip/f791dd2589d7e217625d7e411621a5bac71cbf69 Author: Cheng Jian <cj.chengj...@huawei.com> AuthorDate: Fri, 3 Nov 2017 18:59:48 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Tue, 7

[tip:locking/core] locking/rwlocks: Fix comments

2017-11-07 Thread tip-bot for Cheng Jian
Commit-ID: f791dd2589d7e217625d7e411621a5bac71cbf69 Gitweb: https://git.kernel.org/tip/f791dd2589d7e217625d7e411621a5bac71cbf69 Author: Cheng Jian AuthorDate: Fri, 3 Nov 2017 18:59:48 +0800 Committer: Ingo Molnar CommitDate: Tue, 7 Nov 2017 12:22:21 +0100 locking/rwlocks: Fix comments

[PATCH] lib/traceevent : clean up clang build warning

2017-11-05 Thread Cheng Jian
' warning: implicit conversion from enumeration type 'enum filter_cmp_type' to different enumeration type 'enum filter_exp_type' Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- tools/lib/traceevent/parse-filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH] lib/traceevent : clean up clang build warning

2017-11-05 Thread Cheng Jian
' warning: implicit conversion from enumeration type 'enum filter_cmp_type' to different enumeration type 'enum filter_exp_type' Signed-off-by: Cheng Jian --- tools/lib/traceevent/parse-filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/traceevent

[PATCH] lib/traceevent : fix some issue in Makefile

2017-11-05 Thread Cheng Jian
plugin_xen.so plugin_scsi.so plugin_cfg80211.so] or bad version of nm So just use the LC_ALL=C (POSIX) default when sort. Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- tools/lib/traceevent/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a

[PATCH] lib/traceevent : fix some issue in Makefile

2017-11-05 Thread Cheng Jian
gin_scsi.so plugin_cfg80211.so] or bad version of nm So just use the LC_ALL=C (POSIX) default when sort. Signed-off-by: Cheng Jian --- tools/lib/traceevent/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/M

[PATCH] lock/rwlock fix comment for rwlock

2017-11-03 Thread Cheng Jian
The kernel/locking/spinlock.c file contains the implementations of spinlock and rwlock. and __lock_function inlines are taken from other include files. the comment miss rwlock_api_smp.h about rwlock. also fix a little comment in rwlock_api_smp.h Signed-off-by: Cheng Jian <cj.chengj...@huawei.

[PATCH] lock/rwlock fix comment for rwlock

2017-11-03 Thread Cheng Jian
The kernel/locking/spinlock.c file contains the implementations of spinlock and rwlock. and __lock_function inlines are taken from other include files. the comment miss rwlock_api_smp.h about rwlock. also fix a little comment in rwlock_api_smp.h Signed-off-by: Cheng Jian --- include/linux

[tip:sched/core] sched/idle: Micro-optimize the idle loop

2017-10-26 Thread tip-bot for Cheng Jian
Commit-ID: 54b933c6c954a8b7b0c2b40a1c4d3f7279d11e22 Gitweb: https://git.kernel.org/tip/54b933c6c954a8b7b0c2b40a1c4d3f7279d11e22 Author: Cheng Jian <cj.chengj...@huawei.com> AuthorDate: Wed, 25 Oct 2017 19:28:27 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Thu,

[tip:sched/core] sched/idle: Micro-optimize the idle loop

2017-10-26 Thread tip-bot for Cheng Jian
Commit-ID: 54b933c6c954a8b7b0c2b40a1c4d3f7279d11e22 Gitweb: https://git.kernel.org/tip/54b933c6c954a8b7b0c2b40a1c4d3f7279d11e22 Author: Cheng Jian AuthorDate: Wed, 25 Oct 2017 19:28:27 +0800 Committer: Ingo Molnar CommitDate: Thu, 26 Oct 2017 08:31:29 +0200 sched/idle: Micro-optimize

[PATCH] sched/idle: fetch smp_processor_id out of the idle loop

2017-10-25 Thread Cheng Jian
st x0, x20 c90: 54000580b.eqd40 <do_idle+0x138> Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/sched/idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 257f4f0..41f16b8

[PATCH] sched/idle: fetch smp_processor_id out of the idle loop

2017-10-25 Thread Cheng Jian
c90: 54000580b.eqd40 Signed-off-by: Cheng Jian --- kernel/sched/idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 257f4f0..41f16b8 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -209,6 +

[PATCH] perf/tools : remove default system_wide in sched record

2017-10-24 Thread Cheng Jian
ed-off-by: Cheng Jian <cj.chengj...@huawei.com> Signed-off-by: Zhang MengTing <zhangmengt...@huawei.com> --- tools/perf/builtin-sched.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 322b4de..47b79fc 100644 --- a/tools/pe

[PATCH] perf/tools : remove default system_wide in sched record

2017-10-24 Thread Cheng Jian
ed-off-by: Cheng Jian Signed-off-by: Zhang MengTing --- tools/perf/builtin-sched.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 322b4de..47b79fc 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -3248,7 +

[PATCH] perf/ftrace : Fix repetitious traces when specify a target task

2017-10-09 Thread Cheng Jian
only match an event event at a time, so we will return after an event matched. Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- kernel/events/core.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index baa134c

[PATCH] perf/ftrace : Fix repetitious traces when specify a target task

2017-10-09 Thread Cheng Jian
only match an event event at a time, so we will return after an event matched. Signed-off-by: Cheng Jian --- kernel/events/core.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index baa134c..5682ead 100644 --- a/ker

[PATCH] arm64: Convert pr_warning to standard pr_warn for arm64

2017-09-05 Thread Cheng Jian
This patch convert pr_warning to standard pr_warn for arm64. Signed-off-by: Cheng Jian <cj.chengj...@huawei.com> --- arch/arm64/include/asm/syscall.h | 4 ++-- arch/arm64/kernel/hw_breakpoint.c | 8 arch/arm64/kernel/smp.c | 4 ++-- 3 files changed, 8 insertions

[PATCH] arm64: Convert pr_warning to standard pr_warn for arm64

2017-09-05 Thread Cheng Jian
This patch convert pr_warning to standard pr_warn for arm64. Signed-off-by: Cheng Jian --- arch/arm64/include/asm/syscall.h | 4 ++-- arch/arm64/kernel/hw_breakpoint.c | 8 arch/arm64/kernel/smp.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch

[tip:sched/core] sched/core: Remove unnecessary initialization init_idle_bootup_task()

2017-08-10 Thread tip-bot for Cheng Jian
Commit-ID: 18f08dae19990f5fffde92e3a63e0d90cda0f1a8 Gitweb: http://git.kernel.org/tip/18f08dae19990f5fffde92e3a63e0d90cda0f1a8 Author: Cheng Jian <cj.chengj...@huawei.com> AuthorDate: Fri, 4 Aug 2017 17:19:37 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Thu, 10

[tip:sched/core] sched/core: Remove unnecessary initialization init_idle_bootup_task()

2017-08-10 Thread tip-bot for Cheng Jian
Commit-ID: 18f08dae19990f5fffde92e3a63e0d90cda0f1a8 Gitweb: http://git.kernel.org/tip/18f08dae19990f5fffde92e3a63e0d90cda0f1a8 Author: Cheng Jian AuthorDate: Fri, 4 Aug 2017 17:19:37 +0800 Committer: Ingo Molnar CommitDate: Thu, 10 Aug 2017 12:18:18 +0200 sched/core: Remove

[PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()

2017-08-04 Thread Cheng Jian
ple scheduling class: */ idle->sched_class = _sched_class; We've already set the boot thread to idle class in start_kernel()->sched_init()->init_idle() so it's unnecessary to set it again in start_kernel()->rest_init()->init_idle_bootup_task() Signed-off-by: Cheng Jian <cj

[PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()

2017-08-04 Thread Cheng Jian
ple scheduling class: */ idle->sched_class = _sched_class; We've already set the boot thread to idle class in start_kernel()->sched_init()->init_idle() so it's unnecessary to set it again in start_kernel()->rest_init()->init_idle_bootup_task() Signed-off-by: Cheng Jian Signed