[RFC PATCH] Fix abnormal rcu dynticks_nesting values related to async page fault

2012-11-26 Thread Li Zhong
cause rcu hard-code the value to be 0. I will send another patch for this.) This patch below tries to replace the rcu_irq_enter/exit() with rcu_idle_exit/enter(), if it is in rcu idle, and it is idle process; otherwise, rcu_user_exit() is called to exit user eqs if necessary. Signed-off-by: Li

[PATCH rcu] use new nesting value for rcu_dyntick trace in rcu_eqs_enter_common

2012-11-26 Thread Li Zhong
This patch uses the real new value of dynticks_nesting instead of 0 in rcu_eqs_enter_common(). Signed-off-by: Li Zhong --- kernel/rcutree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 7733eb5..6b7e314 100644 --- a/kernel

[RFC PATCH v2] Add rcu user eqs exception hooks for async page fault

2012-11-28 Thread Li Zhong
4949aa665 seems related to schedule(), which is not in the code path if we are in cpu idle eqs ) I think we still need Gleb's patch about the idle check in kvm_async_pf_task_wait(), and maybe another patch for the exit_idle()/enter_idle() issue. Signed-off-by: Li Zhong --- arch/x86/kerne

Re: 3.7-rc7: BUG: MAX_STACK_TRACE_ENTRIES too low!

2012-11-28 Thread Li Zhong
On Tue, 2012-11-27 at 19:22 -0800, Christian Kujau wrote: > On Tue, 27 Nov 2012 at 19:06, Christian Kujau wrote: > > the same thing[0] happened again in 3.7-rc7, after ~20h uptime: > > I found the following on patchwork, but this seems to deal with powerpc64 > only, while this PowerBook G4 of min

Re: [RFC PATCH v2] Add rcu user eqs exception hooks for async page fault

2012-11-28 Thread Li Zhong
On Wed, 2012-11-28 at 13:55 +0100, Frederic Weisbecker wrote: > 2012/11/28 Li Zhong : > > Thank you all for the review and education. > > > > Below are my current understandings and an update version. Would you > > please help to review it again and give your comm

Re: [PATCH] context_tracking: New context tracking susbsystem

2012-11-29 Thread Li Zhong
On Tue, 2012-11-27 at 19:33 +0100, Frederic Weisbecker wrote: [] > - > - WARN_ON_ONCE(!current->mm); > - > - local_irq_save(flags); > - rdtp = &__get_cpu_var(rcu_dynticks); > - if (!rdtp->ignore_user_qs && !rdtp->in_user) { > - rdtp->in_user = true; > - r

[PATCH rcu] Remove unused code originally used for context tracking

2012-11-29 Thread Li Zhong
As new context tracking subsystem added, it seems ignore_user_qs and in_user defined in struct rcu_dynticks are no longer needed, so remove them. Signed-off-by: Li Zhong --- kernel/rcutree.c | 3 --- kernel/rcutree.h | 4 2 files changed, 7 deletions(-) diff --git a/kernel/rcutree.c b

Re: [RFC PATCH v2] Add rcu user eqs exception hooks for async page fault

2012-11-30 Thread Li Zhong
On Thu, 2012-11-29 at 19:25 +0200, Gleb Natapov wrote: > On Thu, Nov 29, 2012 at 03:40:05PM +0100, Frederic Weisbecker wrote: > > 2012/11/29 Li Zhong : > > > On Wed, 2012-11-28 at 13:55 +0100, Frederic Weisbecker wrote: > > >> > With rcu_user_exit() at the be

[RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-11-30 Thread Li Zhong
a matching rcu_irq_enter() before it, which is illegal if the cpu happens to be in rcu idle state. Signed-off-by: Li Zhong --- arch/x86/kernel/kvm.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 4180a87..342b

Re: [PATCH v2 3/3] mm: accelerate munlock() treatment of THP pages

2013-02-06 Thread Li Zhong
On Wed, 2013-02-06 at 18:44 -0500, Sasha Levin wrote: > On 02/04/2013 02:17 AM, Michel Lespinasse wrote: > > munlock_vma_pages_range() was always incrementing addresses by PAGE_SIZE > > at a time. When munlocking THP pages (or the huge zero page), this resulted > > in taking the mm->page_table_lock

Re: [RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-02-07 Thread Li Zhong
On Thu, 2013-02-07 at 01:29 +0100, Frederic Weisbecker wrote: > 2013/2/1 Li Zhong : > > This is the syscall slow path hooks for context tracking subsystem, > > corresponding to > > [PATCH] x86: Syscall hooks for userspace RCU extended QS > > commit bf5a3c13b9398

[PATCH cpuset] Use rebuild_sched_domains() in cpuset_hotplug_workfn()

2013-04-02 Thread Li Zhong
. Signed-off-by: Li Zhong --- kernel/cpuset.c | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4f9dfe4..515a713 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -,17 +,8 @@ static void cpuset_hotplug_workfn

[RFC PATCH 0/5] powerpc: Support context tracking for Power pSeries

2013-02-01 Thread Li Zhong
These patches try to support context tracking for Power arch, beginning with 64-bit pSeries. The codes are ported from that of the x86_64, and in each patch, I listed the corresponding patch for x86. Would you please help review and give your comments? Thanks, Zhong Li Zhong (5): powerpc

[RFC PATCH 3/5] powerpc: Exit user context on notify resume

2013-02-01 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong --- arch/powerpc/kernel/signal.c |5 + 1 file changed, 5 insertions

[RFC PATCH 5/5] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-02-01 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 837cf49..a9570fe 100644 --- a/arch

[RFC PATCH 2/5] powerpc: Exception hooks for context tracking subsystem

2013-02-01 Thread Li Zhong
for userspace RCU extended QS commit 6ba3c97a38803883c2eee489505796cb0a727122 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 20 +++ arch/powerpc/kernel/exceptions-64s.S|4 +- arch/powerpc/kernel/traps.c | 79

[RFC PATCH 4/5] powerpc: Use the new schedule_user API on userspace preemption

2013-02-01 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 11 +++ arch/powerpc/kernel/entry_64.S |3 ++- 2

[RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-02-01 Thread Li Zhong
. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong --- arch/powerpc/include/asm/thread_info.h |7 +-- arch/powerpc/kernel/ptrace.c |5

[RFC PATCH] context_tracking/rcu: don't function trace before rcu_user_exit() finishes

2013-02-28 Thread Li Zhong
, including user_exit(), and a few callers of user_exit(). Signed-off-by: Li Zhong -- arch/x86/kernel/ptrace.c | 4 ++-- arch/x86/kernel/signal.c | 2 +- include/linux/rcupdate.h | 2 ++ kernel/context_tracking.c | 2 +- kernel/sched/core.c | 2 +- 5 files changed, 7 insertions(+), 5

Re: [RFC PATCH] context_tracking/rcu: don't function trace before rcu_user_exit() finishes

2013-02-28 Thread Li Zhong
On Thu, 2013-02-28 at 08:38 -0800, Paul E. McKenney wrote: > On Thu, Feb 28, 2013 at 04:26:10PM +0800, Li Zhong wrote: > > I saw some RCU illegal usage from idle complaints when function tracer > > is enabled with forced context tracking. > > > > It seems that __sc

[PATCH rcu] Move TINY_RCU quiescent state out of extended quiescent state

2012-09-20 Thread Li Zhong
ons, which are illegal in extended quiescent states. This patch therefore moves the call to rcu_sched_qs() so that it precedes the point at which we set the new value of rcu_dynticks_nesting, which may indicate RCU is in an extended quiescent state. Signed-off-by: Li Zhong Signed-off-by: Paul E

[PATCH scsi] Add NULL checking of return value from scsi_cmd_to_driver()

2012-09-23 Thread Li Zhong
is a delta of my previous patch [https://lkml.org/lkml/2012/4/11/814] and commit 919f797 Signed-off-by: Li Zhong --- diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 2936b44..b9dd7f0 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -832,7 +832,7 @@ void scsi_finish_co

Re: [PATCH scsi] Add NULL checking of return value from scsi_cmd_to_driver()

2012-09-24 Thread Li Zhong
On Mon, 2012-09-24 at 09:44 +0400, James Bottomley wrote: > On Mon, 2012-09-24 at 13:30 +0800, Li Zhong wrote: > > Just noticed that after commit 919f797, it is possible that > > scsi_cmd_to_driver() returns NULL. This patch adds the NULL checking for > > drv > &

Re: [PATCH scsi] Add NULL checking of return value from scsi_cmd_to_driver()

2012-09-24 Thread Li Zhong
On Mon, 2012-09-24 at 11:35 +0400, James Bottomley wrote: > On Mon, 2012-09-24 at 15:03 +0800, Li Zhong wrote: > > On Mon, 2012-09-24 at 09:44 +0400, James Bottomley wrote: > > > On Mon, 2012-09-24 at 13:30 +0800, Li Zhong wrote: > > > > Just noticed that after commi

[RFC PATCH 0/2] partial revoke implementation for procfs

2013-07-11 Thread Li Zhong
file system (with backing device) to try other things that's not implemented this time. Thanks, Zhong Li Zhong (2): vfs: partial revoke implementation suggested by Al Viro proc: covert procfs to use the general revoke implementation fs/Makefile|2 +- fs/compat_ioctl.

[PATCH 1/2] vfs: partial revoke implementation suggested by Al Viro

2013-07-11 Thread Li Zhong
This patch tries to partially implement what Al Viro suggested in https://lkml.org/lkml/2013/4/5/15 Code also mostly copied from the above link Signed-off-by: Li Zhong --- fs/Makefile|2 +- fs/revoke.c| 133 include

[PATCH 2/2] proc: covert procfs to use the general revoke implementation

2013-07-11 Thread Li Zhong
y. remove_proc_entry()/remove_proc_subtree() would call revoke_it() on everything we are removing. Signed-off-by: Li Zhong --- fs/compat_ioctl.c |8 +- fs/eventpoll.c | 10 ++- fs/file_table.c| 13 ++- fs/ioctl.c |7 +- fs/proc/generic.c | 12 +-- fs/p

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-02 Thread Li Zhong
On Fri, 2012-11-30 at 12:26 +0200, Gleb Natapov wrote: > On Fri, Nov 30, 2012 at 05:18:41PM +0800, Li Zhong wrote: > > This patch adds user eqs exception hooks for async page fault page not > > present code path, to exit the user eqs and re-enter it as necessary. > > &g

Re: 3.7-rc7: BUG: MAX_STACK_TRACE_ENTRIES too low!

2012-12-02 Thread Li Zhong
On Sat, 2012-12-01 at 12:32 -0800, Christian Kujau wrote: > On Wed, 28 Nov 2012 at 16:41, Li Zhong wrote: > > On Tue, 2012-11-27 at 19:22 -0800, Christian Kujau wrote: > > > On Tue, 27 Nov 2012 at 19:06, Christian Kujau wrote: > > > > the same thing[0] happened again

[ PATCH] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Li Zhong
a matching rcu_irq_enter() before it, which is illegal if the cpu happens to be in rcu idle state. Signed-off-by: Li Zhong --- arch/x86/kernel/kvm.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 08b973f..e99af60 100

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Li Zhong
n't be conflicts, but we need change the including file name after that. I don't know how to handle this kind of thing... Thanks, Zhong > > On Fri, Nov 30, 2012 at 05:18:41PM +0800, Li Zhong wrote: > > This patch adds user eqs exception hooks for async page fault page not > &

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Li Zhong
On Tue, 2012-12-04 at 07:11 +0200, Gleb Natapov wrote: > On Tue, Dec 04, 2012 at 10:36:02AM +0800, Li Zhong wrote: > > On Mon, 2012-12-03 at 11:57 +0200, Gleb Natapov wrote: > > > Please regenerate the patch against > > > git://git.kernel.org/pub/scm/virt/kvm/k

Re: [REGRESSION][3.8.-rc1][ INFO: possible circular locking dependency detected ]

2012-12-26 Thread Li Zhong
.}, at: [] > console_callback+0x20/0x194 > [ 97.803112] > [ 97.803112] which lock already depends on the new lock. > > ...and on it goes. Please see the URL above for the whole dmesg and > .config. > > @Li Zhong: I have applied your fix for the "MAX_STACK_TRACE_EN

Re: [PATCH 02/24] cputime: Generic on-demand virtual cputime accounting

2012-12-26 Thread Li Zhong
On Thu, 2012-12-20 at 19:32 +0100, Frederic Weisbecker wrote: > If we want to stop the tick further idle, we need to be > able to account the cputime without using the tick. > > Virtual based cputime accounting solves that problem by > hooking into kernel/user boundaries. > > However implementing

Re: [PATCH 05/27] cputime: Safely read cputime of full dynticks CPUs

2012-12-30 Thread Li Zhong
On Sat, 2012-12-29 at 17:42 +0100, Frederic Weisbecker wrote: > While remotely reading the cputime of a task running in a > full dynticks CPU, the values stored in utime/stime fields > of struct task_struct may be stale. Its values may be those > of the last kernel <-> user transition time snapshot

Re: [PATCH 06/27] nohz: Basic full dynticks interface

2012-12-30 Thread Li Zhong
On Sat, 2012-12-29 at 17:42 +0100, Frederic Weisbecker wrote: > Start with a very simple interface to define full dynticks CPU: > use a boot time option defined cpumask through the "full_nohz=" > kernel parameter. > > Make sure you keep at least one CPU outside this range to handle > the timekeepi

Re: [PATCH] Remove WARN_ON_ONCE in __smp_call_function_single and smp_call_function_single

2013-01-05 Thread Li Zhong
On Sat, 2013-01-05 at 12:26 +0800, Hui Zhu wrote: > The comments of these WARN_ON_ONCE said "Can deadlock when called with > interrupts disabled". > But I didn't find anything that will block this function. It seems that if two cpus try to IPI each other with wait equals true, they will deadlock i

[PATCH] nohz: fix compile warning in tick_nohz_init()

2013-07-15 Thread Li Zhong
cpu is not used after commit 5b8621a68fdcd2baf1d3b413726f913a5254d46a Signed-off-by: Li Zhong --- kernel/time/tick-sched.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index e80183f..8145860 100644 --- a/kernel/time/tick-sched.c +++ b

[RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
9b da 01 00 e9 4f ff ff ff 66 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 83 ec 08 48 85 ff 74 1d 87 00 01 00 00 01 74 1e 48 8d 7b 38 83 6b 38 01 0f 94 c0 84 [ 1845.185026] RIP [] kobject_put+0x11/0x60 [ 1845.185026] RSP [ 1845.185026] CR2: a01601d0 [ 1845.185026] ---[ end trace

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > DEBUG_KOBJECT_RELEASE helps to find the issue attached below. > > > > After some investigation, it seems the reason is: > > The mod->mkobj.kobj(ff

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 21:03 -0700, Greg KH wrote: > On Thu, Aug 22, 2013 at 10:34:06AM +0800, Li Zhong wrote: > > On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: > > > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > > > DEBUG_KOBJECT_RELEASE helps to

[RFC PATCH v2 next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-22 Thread Li Zhong
74 1e 48 8d 7b 38 83 6b 38 01 0f 94 c0 84 [ 1845.185026] RIP [] kobject_put+0x11/0x60 [ 1845.185026] RSP [ 1845.185026] CR2: a01601d0 [ 1845.185026] ---[ end trace 49a70afd109f5653 ]--- Signed-off-by: Li Zhong --- drivers/base/core.c| 2 +- drivers/base/module.c | 4 ++--

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-22 Thread Li Zhong
On Thu, 2013-08-22 at 16:30 +0930, Rusty Russell wrote: > Greg KH writes: > > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > > struct kobj_type module_ktype = { > > > + .release =module_kobj_release, > > > .sysfs_ops =&module_sys

Re: [RFC PATCH] context_tracking/rcu: don't function trace before rcu_user_exit() finishes

2013-03-04 Thread Li Zhong
attribute to a couple of functions where the above could happen, including user_exit(), and a few callers of user_exit(). Signed-off-by: Li Zhong -- arch/x86/kernel/ptrace.c | 4 ++-- arch/x86/kernel/signal.c | 2 +- kernel/context_tracking.c | 2 +- kernel/sched/core.c | 2 +- 4 files

[RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-12 Thread Li Zhong
exception are pulled into 3.10, so there is no dependency on tip tree. So patch #2 and #6 in previous version_2 is merged together. Li Zhong (5): powerpc: Syscall hooks for context tracking subsystem powerpc: Exception hooks for context tracking subsystem powerpc: Exit user context on

[RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-12 Thread Li Zhong
6c1e0256fad84a843d915414e4b5973b7443d48d context_tracking: Restore correct previous context state on exception exit it is able for exception hooks to use the generic code above instead of a redundant arch implementation. Signed-off-by: Li Zhong --- arch/powerpc/kernel/traps.c | 91

[RFC PATCH v3 4/5] powerpc: Use the new schedule_user API on userspace preemption

2013-05-12 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 10 ++ arch/powerpc/kernel/entry_64.S |3 ++- 2

[RFC PATCH v3 5/5] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-05-12 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288 100644 --- a/arch

[RFC PATCH v3 3/5] powerpc: Exit user context on notify resume

2013-05-12 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong --- arch/powerpc/kernel/signal.c |5 + 1 file changed, 5 insertions

[RFC PATCH v3 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-05-12 Thread Li Zhong
. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong Acked-by: Frederic Weisbecker --- arch/powerpc/include/asm/thread_info.h |7 +-- arch/powerpc

Re: [RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 15:51 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-05-13 at 13:21 +0800, Li Zhong wrote: > > These patches try to support context tracking for Power arch, beginning with > > 64-bit pSeries. The codes are ported from that of the x86_64, and in each >

Re: [RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 15:57 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-05-13 at 13:21 +0800, Li Zhong wrote: > > int recover = 0; > > + enum ctx_state prev_state; > > + > > + prev_state = exception_enter(); > > Please make it nicer: >

Re: [RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 18:59 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-05-13 at 16:03 +0800, Li Zhong wrote: > > > > To my understanding, it is used to enable RCU user extended quiescent > > state, so RCU on that cpu doesn't need scheduler ticks. And togethe

Re: [RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 19:06 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-05-13 at 16:44 +0800, Li Zhong wrote: > > Yes, the above and hash_page() are two C functions for a same exception. > > And the exception hooks enable RCU usage in those C codes. But for asm > > co

Re: [PATCH 1/3] x86/sched/context_tracking: Call new schedule_preempt_user() from entry_64.S

2013-05-13 Thread Li Zhong
On Fri, 2013-05-10 at 17:12 -0400, Steven Rostedt wrote: > plain text document attachment (fix-user-exit-preempt.patch) > I started testing the new NOHZ_FULL in the kernel and had some issues, > so I started function tracing and this bug report came out: > > > [23446.458073] [ cut her

[RFC PATCH v4 3/5] powerpc: Exit user context on notify resume

2013-05-13 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong --- arch/powerpc/kernel/signal.c |5 + 1 file changed, 5 insertions

[RFC PATCH v4 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
6c1e0256fad84a843d915414e4b5973b7443d48d context_tracking: Restore correct previous context state on exception exit it is able for exception hooks to use the generic code above instead of a redundant arch implementation. Signed-off-by: Li Zhong --- arch/powerpc/kernel/traps.c | 80

[RFC PATCH v4 4/5] powerpc: Use the new schedule_user API on userspace preemption

2013-05-13 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 10 ++ arch/powerpc/kernel/entry_64.S |3 ++- 2

[RFC PATCH v4 5/5] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-05-13 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288 100644 --- a/arch

[RFC PATCH v4 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
These patches try to support context tracking for Power arch, beginning with 64-bit pSeries. The codes are ported from that of the x86_64, and in each patch, I listed the corresponding patch for x86. v4: fixed some cosmetic issues suggested by Ben. Li Zhong (5): powerpc: Syscall hooks for

[RFC PATCH v4 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong Acked-by: Frederic Weisbecker --- arch/powerpc/include/asm/thread_info.h |7 +-- arch/powerpc

Re: [PATCH 1/3] x86/sched/context_tracking: Call new schedule_preempt_user() from entry_64.S

2013-05-14 Thread Li Zhong
On Mon, 2013-05-13 at 11:03 -0400, Steven Rostedt wrote: > On Mon, 2013-05-13 at 17:56 +0800, Li Zhong wrote: > > > > All this before schedule_user() was able to call user_exit() and take us > > > out of dynamic tick user context. > > > > Maybe we c

Re: [PATCH 1/3] x86/sched/context_tracking: Call new schedule_preempt_user() from entry_64.S

2013-05-14 Thread Li Zhong
On Tue, 2013-05-14 at 16:13 +0200, Frederic Weisbecker wrote: > On Fri, May 10, 2013 at 05:12:26PM -0400, Steven Rostedt wrote: > > +/* > > + * This is a entry point to the scheduler() just before going > > + * back to user space. This is called with irqs disabled > > + * which prevents races with

Re: [RFC PATCH v2 2/6] powerpc: Exception hooks for context tracking subsystem

2013-04-08 Thread Li Zhong
On Fri, 2013-04-05 at 13:50 +1100, Paul Mackerras wrote: > On Fri, Mar 29, 2013 at 06:00:17PM +0800, Li Zhong wrote: > > This is the exception hooks for context tracking subsystem, including > > data access, program check, single step, instruction breakpoint, machine > > che

Re: [PATCH cpuset] Use rebuild_sched_domains() in cpuset_hotplug_workfn()

2013-04-08 Thread Li Zhong
On Wed, 2013-04-03 at 17:32 +0800, Li Zefan wrote: > On 2013/4/2 15:16, Li Zhong wrote: > > In cpuset_hotplug_workfn(), partition_sched_domains() is called without > > hotplug lock held, which is actually needed (stated in the function > > header of partition_sched_domains()).

[RFC PATCH v2 cpuset] Don't pass offlined cpus to partition_sched_domains()

2013-04-09 Thread Li Zhong
Hi Zefan, I did some test today, enabling cpuset and online/offline the cpus. It caused NULL address dereferencing in get_group(). After adding some debugging code, it seems that it is caused by using some offlined cpus as the parameter to partition_sched_domains(). More details below: =

Re: [RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-04-09 Thread Li Zhong
On Wed, 2013-04-10 at 14:56 +1000, Michael Ellerman wrote: > On Fri, Mar 29, 2013 at 06:00:21PM +0800, Li Zhong wrote: > > After the exception handling moved to generic code, and some changes in > ... > > diff --git a/arch/powerpc/mm/hash_utils_64.c > > b/arch/powerpc/mm/h

Re: [RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-04-09 Thread Li Zhong
On Wed, 2013-04-10 at 13:32 +0800, Li Zhong wrote: > On Wed, 2013-04-10 at 14:56 +1000, Michael Ellerman wrote: > > On Fri, Mar 29, 2013 at 06:00:21PM +0800, Li Zhong wrote: > > > After the exception handling moved to generic code, and some changes in > > ... > >

[RFC PATCH]nohz: Use raw_smp_processor_id() in tick_nohz_task_switch()

2013-04-27 Thread Li Zhong
igned-off-by: Li Zhong --- kernel/time/tick-sched.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index da53c8f..0aa575b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -251,7 +251,7 @@

Re: [RFC PATCH]nohz: Use raw_smp_processor_id() in tick_nohz_task_switch()

2013-04-27 Thread Li Zhong
On Sat, 2013-04-27 at 15:40 +0200, Frederic Weisbecker wrote: > 2013/4/27 Li Zhong : > > I saw following error when testing the latest nohz code on Power: > > > > [ 85.295384] BUG: using smp_processor_id() in preemptible [] > > code: rsyslogd/3493 &

Re: [PATCH] cpuset: fix compile warning when CONFIG_SMP=n

2013-04-27 Thread Li Zhong
On Sun, 2013-04-28 at 09:46 +0800, Li Zefan wrote: > Reported by Fengguang's kbuild test robot: Thank you for the quick fix, Zefan. Strong robot :) Thanks, Zhong > > kernel/cpuset.c:787: warning: 'generate_sched_domains' defined but not used > > Introduced by commit e0e80a02e5701c8790bd348ab

[RFC PATCH v2]nohz: protect smp_processor_id() in tick_nohz_task_switch()

2013-04-27 Thread Li Zhong
avoid the above complaint. Signed-off-by: Li Zhong --- kernel/time/tick-sched.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index da53c8f..1c9f53b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick

Re: [RFC PATCH v2 cpuset] Don't pass offlined cpus to partition_sched_domains()

2013-04-12 Thread Li Zhong
On Thu, 2013-04-11 at 16:57 +0800, Li Zefan wrote: > On 2013/4/9 17:59, Li Zhong wrote: > > Hi Zefan, > > > > I did some test today, enabling cpuset and online/offline the cpus. It > > caused NULL address dereferencing in get_group(). After adding some > > de

[RFC PATCH nohz] return NOTIFY_BAD in cpu down call back to stop offlining the cpu

2013-05-17 Thread Li Zhong
(), then the cpu would be taken down with part of the DOWN_PREPARE notifier callbacks called, and something bad could happen after that. Signed-off-by: Li Zhong --- kernel/time/tick-sched.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time

[RFC PATCH v2 2/6] powerpc: Exception hooks for context tracking subsystem

2013-03-29 Thread Li Zhong
for userspace RCU extended QS commit 6ba3c97a38803883c2eee489505796cb0a727122 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 28 + arch/powerpc/kernel/exceptions-64s.S|4 +- arch/powerpc/kernel/traps.c | 83

[RFC PATCH v2 1/6] powerpc: Syscall hooks for context tracking subsystem

2013-03-29 Thread Li Zhong
. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong Acked-by: Frederic Weisbecker --- arch/powerpc/include/asm/thread_info.h |7 +-- arch/powerpc

[RFC PATCH v2 3/6] powerpc: Exit user context on notify resume

2013-03-29 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong --- arch/powerpc/kernel/signal.c |5 + 1 file changed, 5 insertions

[RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-03-29 Thread Li Zhong
exception exit it is able for this patch to replace the implementation in arch code with the generic code in above commits. Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 29 --- arch/powerpc/kernel/exceptions-64s.S|4 +-- arch/powerpc/kernel

[RFC PATCH v2 5/6] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-03-29 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288 100644 --- a/arch

[RFC PATCH v2 4/6] powerpc: Use the new schedule_user API on userspace preemption

2013-03-29 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong --- arch/powerpc/include/asm/context_tracking.h | 11 +++ arch/powerpc/kernel/entry_64.S |3 ++- 2

[RFC PATCH v2 0/6] powerpc: Support context tracking for Power pSeries

2013-03-29 Thread Li Zhong
rch/common code merging. And it might also make future changes easier. Thanks, Zhong Li Zhong (6): powerpc: Syscall hooks for context tracking subsystem powerpc: Exception hooks for context tracking subsystem powerpc: Exit user context on notify resume powerpc: Use the new schedule_u

Re: [PATCH SLAB 1/2 v3] duplicate the cache name in SLUB's saved_alias list, SLAB, and SLOB

2012-07-09 Thread Li Zhong
On Mon, 2012-07-09 at 09:01 -0500, Christoph Lameter wrote: > > I was pointed by Glauber to the slab common code patches. I need some > > more time to read the patches. Now I think the slab/slot changes in this > > v3 are not needed, and can be ignored. > > That may take some kernel cycles. You ha

Re: [PATCH RESEND] Fix a dead loop in async_synchronize_full()

2012-07-11 Thread Li Zhong
On Wed, 2012-07-11 at 15:42 -0700, Andrew Morton wrote: > On Mon, 09 Jul 2012 15:04:25 +0800 > Li Zhong wrote: > > > This patch tries to fix a dead loop in async_synchronize_full(), which > > could be seen when preemption is disabled on a single cpu ma

Re: [PATCH RESEND] Fix a dead loop in async_synchronize_full()

2012-07-12 Thread Li Zhong
On Wed, 2012-07-11 at 15:50 -0700, Dan Williams wrote: > On Wed, Jul 11, 2012 at 3:42 PM, Andrew Morton > wrote: > > The patch is fairly wordwrapped - please fix up your email client. > > > > More seriously, it does not apply to linux-next due to some fairly > > significant changes which have been

Re: [RFC PATCH 2/5] powerpc: Exception hooks for context tracking subsystem

2013-02-16 Thread Li Zhong
On Sun, 2013-02-10 at 15:10 +0100, Frederic Weisbecker wrote: > 2013/2/1 Li Zhong : > > This is the exception hooks for context tracking subsystem, including > > data access, program check, single step, instruction breakpoint, machine > > check, > > alignment, fp

Re: 3.7-rc7: BUG: MAX_STACK_TRACE_ENTRIES too low!

2013-01-14 Thread Li Zhong
On Sat, 2013-01-12 at 12:43 -0800, Christian Kujau wrote: > On Wed, 28 Nov 2012 at 16:41, Li Zhong wrote: > > On Tue, 2012-11-27 at 19:22 -0800, Christian Kujau wrote: > > > On Tue, 27 Nov 2012 at 19:06, Christian Kujau wrote: > > > > the same thing[0] happened again

[PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-27 Thread Li Zhong
PE_FS type only. Signed-off-by: Li Zhong --- drivers/scsi/scsi_error.c |8 +--- include/scsi/scsi_cmnd.h | 12 ++-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index de2337f..4001559 100644 --- a/dr

Re: [PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-28 Thread Li Zhong
On Thu, 2012-09-27 at 13:43 -0400, Martin K. Petersen wrote: > >>>>> "Li" == Li Zhong writes: > > > @@ -845,8 +844,11 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, > > unsigned char *cmnd, > > > > scsi_eh_restore_cmn

[PATCH v2 scsi] Short the path length of scsi_cmd_to_driver()

2012-09-28 Thread Li Zhong
fixes a bug where you get different behaviors from REQ_TYPE_BLOCK_PC commands when a driver is and isn't attached. v2: mirror code != REQ_TYPE_BLOCK_PC in scsi.c, rather than == REQ_TYPE_FS Signed-off-by: Li Zhong --- drivers/scsi/scsi_error.c |8 +--- include/scsi/scsi_cmnd

Re: [PATCH] Fix a dead loop in async_synchronize_full()

2012-07-08 Thread Li Zhong
On Thu, 2012-07-05 at 20:51 -0700, Christian Kujau wrote: > On Mon, 2 Jul 2012 at 14:04, Li Zhong wrote: > > This patch tries to fix a dead loop in async_synchronize_full(), which > > could be seen when preemption is disabled on a single cpu machine. > > This helps in

Re: [PATCH] Fix a dead loop in async_synchronize_full()

2012-07-08 Thread Li Zhong
On Fri, 2012-07-06 at 17:12 +0800, Cong Wang wrote: > On Mon, Jul 2, 2012 at 2:04 PM, Li Zhong wrote: > > void async_synchronize_full(void) > > { > > - do { > > - async_synchronize_cookie(next_cookie); > > - } while (!list_empty(&a

Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used

2012-07-08 Thread Li Zhong
On Fri, 2012-07-06 at 14:13 +0400, Glauber Costa wrote: > On 07/05/2012 01:29 PM, Li Zhong wrote: > > On Thu, 2012-07-05 at 12:23 +0400, Glauber Costa wrote: > >> On 07/05/2012 05:41 AM, Li Zhong wrote: > >>> On Wed, 2012-07-04 at 16:40 +0400, Glauber Costa wrote: >

Re: [PATCH SLAB 1/2 v3] duplicate the cache name in SLUB's saved_alias list, SLAB, and SLOB

2012-07-08 Thread Li Zhong
On Fri, 2012-07-06 at 08:56 -0500, Christoph Lameter wrote: > I thought I posted this a couple of days ago. Would this not fix things > without having to change all the allocators? I was pointed by Glauber to the slab common code patches. I need some more time to read the patches. Now I think the

[PATCH RESEND] Fix a dead loop in async_synchronize_full()

2012-07-09 Thread Li Zhong
Currently, async_synchronize_cookie_domain() expects a non-NULL running list ( if NULL, there would be NULL pointer dereference ), so maybe a NULL pointer could be used as an indication for the functions to synchronize all works in all domains. Reported-by: Paul E. McKenney Signed-off-by: Li Zhong Tested-by: Paul

Re: [PATCH 17/33] sched: Update clock of nohz busiest rq before balancing

2013-01-08 Thread Li Zhong
evand > Cc: Gilad Ben Yossef > Cc: Hakan Akkan > Cc: Ingo Molnar > Cc: Li Zhong > Cc: Namhyung Kim > Cc: Paul E. McKenney > Cc: Paul Gortmaker > Cc: Peter Zijlstra > Cc: Steven Rostedt > Cc: Thomas Gleixner > [ Forward port conflicts ] > Signed-off-

[PATCH RESEND] Fix a dead loop in async_synchronize_full()

2012-07-16 Thread Li Zhong
ted-by: Paul E. McKenney Signed-off-by: Li Zhong Tested-by: Paul E. McKenney Tested-by: Christian Kujau --- kernel/async.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/async.c b/kernel/async.c index bd0c168..32d8dc9 100644 --- a/kernel/async.c

Re: lockdep: strange %s#5 lock name

2014-02-12 Thread Li Zhong
On Tue, 2014-02-11 at 10:27 -0500, Tejun Heo wrote: > On Tue, Feb 11, 2014 at 12:00:36PM +0100, Peter Zijlstra wrote: > > > Looks good to me. Can you please post the patch with SOB? > > > > --- > > Subject: workqueue: Fix workqueue lockdep name > > > > Tommi noticed a 'funny' lock class name: "%

[RFC PATCH] memory driver: make phys_index/end_phys_index reflect the start/end section number

2014-04-02 Thread Li Zhong
example looks like: # cat phys_index end_phys_index 0320 0327 Signed-off-by: Li Zhong --- drivers/base/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index bece691..b10f2fa 100644 --- a/drivers/base/memory.c

Re: [RFC PATCH] memory driver: make phys_index/end_phys_index reflect the start/end section number

2014-04-02 Thread Li Zhong
On Wed, 2014-04-02 at 09:09 -0700, Dave Hansen wrote: > On 04/02/2014 01:56 AM, Li Zhong wrote: > > I noticed the phys_index and end_phys_index under > > /sys/devices/system/memory/memoryXXX/ have the same value, e.g. > > (for the test machine, one memory block ha

Re: [RFC PATCH] memory driver: make phys_index/end_phys_index reflect the start/end section number

2014-04-02 Thread Li Zhong
On Thu, 2014-04-03 at 09:37 +0800, Zhang Yanfei wrote: > Add ccing > > On 04/02/2014 04:56 PM, Li Zhong wrote: > > I noticed the phys_index and end_phys_index under > > /sys/devices/system/memory/memoryXXX/ have the same value, e.g. > > (for the test machine, one

  1   2   >