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

2013-05-29 Thread Frederic Weisbecker
On Mon, May 13, 2013 at 04:03:13PM +0800, Li Zhong wrote:
 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
   patch, I listed the corresponding patch for x86.
  
  So that's yet another pile of bloat on all syscall entry/exit and
  exception entry/exit. What is it used for ? (I haven't followed on
  x86_64 side).
 
 To my understanding, it is used to enable RCU user extended quiescent
 state, so RCU on that cpu doesn't need scheduler ticks. And together
 with some other code(already in 3.10), we are able to remove the ticks
 in some cases (e.g. only 1 task running on the cpu, with some other
 limitations).
 
 Maybe Paul, or Frederic could give some better descriptions. 

That's pretty much it. It helps RCU and cputime accounting infrastructure
to know when we enter/exit userspace. This way we can:

* Consider the CPU as idle from an RCU point of view when we run in userspace,
so RCU won't need the tick to stay alive.

* Account cputime (utime/stime/...) without using the tick. Ok powerpc already
has CONFIG_VIRT_CPU_ACCOUNTING_NATIVE but making it working with full dynticks
would require some tweaks.

All in one this is to support full dynticks.

Thanks.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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

2013-05-29 Thread Frederic Weisbecker
On Mon, May 13, 2013 at 06:59:23PM +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 together
  with some other code(already in 3.10), we are able to remove the ticks
  in some cases (e.g. only 1 task running on the cpu, with some other
  limitations).
 
 Ok, sounds interesting. Once you fix the little cosmetic issue, I don't
 see any reason not to merge them as it's basically wiring up an existing
 feature (in that regard the patches are pretty straightforward) and I
 assume the overhead is only there when you enable it.

Yeah when CONFIG_RCU_USER_QS=n and CONFIG_VIRT_CPU_ACCOUNTING_GEN=n this
should be zero overhead. And those configs are only needed for full dynticks.

Thanks.

 
 Cheers,
 Ben.
 
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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
  patch, I listed the corresponding patch for x86.
 
 So that's yet another pile of bloat on all syscall entry/exit and
 exception entry/exit. What is it used for ? (I haven't followed on
 x86_64 side).

To my understanding, it is used to enable RCU user extended quiescent
state, so RCU on that cpu doesn't need scheduler ticks. And together
with some other code(already in 3.10), we are able to remove the ticks
in some cases (e.g. only 1 task running on the cpu, with some other
limitations).

Maybe Paul, or Frederic could give some better descriptions. 

Thanks, Zhong

 
 Cheers,
 Ben.
 
  v3:
  
  This version is mainly a rebasing, against 3.10-rc1, also as the common 
  code 
  to handle the 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 notify resume
powerpc: Use the new schedule_user API on userspace preemption
powerpc: select HAVE_CONTEXT_TRACKING for pSeries
  
   arch/powerpc/include/asm/context_tracking.h |   10 +++
   arch/powerpc/include/asm/thread_info.h  |7 ++-
   arch/powerpc/kernel/entry_64.S  |3 +-
   arch/powerpc/kernel/ptrace.c|5 ++
   arch/powerpc/kernel/signal.c|5 ++
   arch/powerpc/kernel/traps.c |   91 
  ---
   arch/powerpc/mm/fault.c |   16 -
   arch/powerpc/mm/hash_utils_64.c |   38 ---
   arch/powerpc/platforms/pseries/Kconfig  |1 +
   9 files changed, 140 insertions(+), 36 deletions(-)
   create mode 100644 arch/powerpc/include/asm/context_tracking.h
  
 
 




___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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

2013-05-13 Thread Benjamin Herrenschmidt
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 together
 with some other code(already in 3.10), we are able to remove the ticks
 in some cases (e.g. only 1 task running on the cpu, with some other
 limitations).

Ok, sounds interesting. Once you fix the little cosmetic issue, I don't
see any reason not to merge them as it's basically wiring up an existing
feature (in that regard the patches are pretty straightforward) and I
assume the overhead is only there when you enable it.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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 together
  with some other code(already in 3.10), we are able to remove the ticks
  in some cases (e.g. only 1 task running on the cpu, with some other
  limitations).
 
 Ok, sounds interesting. Once you fix the little cosmetic issue, I don't
 see any reason not to merge them as it's basically wiring up an existing
 feature (in that regard the patches are pretty straightforward) and I
 assume the overhead is only there when you enable it.

Thanks for your support, Ben.

Yes, there should be no overhead if not enabled. 

Thanks, Zhong

 
 Cheers,
 Ben.
 
 


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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

2013-05-12 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.

v3:

This version is mainly a rebasing, against 3.10-rc1, also as the common code 
to handle the 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 notify resume
  powerpc: Use the new schedule_user API on userspace preemption
  powerpc: select HAVE_CONTEXT_TRACKING for pSeries

 arch/powerpc/include/asm/context_tracking.h |   10 +++
 arch/powerpc/include/asm/thread_info.h  |7 ++-
 arch/powerpc/kernel/entry_64.S  |3 +-
 arch/powerpc/kernel/ptrace.c|5 ++
 arch/powerpc/kernel/signal.c|5 ++
 arch/powerpc/kernel/traps.c |   91 ---
 arch/powerpc/mm/fault.c |   16 -
 arch/powerpc/mm/hash_utils_64.c |   38 ---
 arch/powerpc/platforms/pseries/Kconfig  |1 +
 9 files changed, 140 insertions(+), 36 deletions(-)
 create mode 100644 arch/powerpc/include/asm/context_tracking.h

-- 
1.7.9.5

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


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

2013-05-12 Thread Benjamin Herrenschmidt
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
 patch, I listed the corresponding patch for x86.

So that's yet another pile of bloat on all syscall entry/exit and
exception entry/exit. What is it used for ? (I haven't followed on
x86_64 side).

Cheers,
Ben.

 v3:
 
 This version is mainly a rebasing, against 3.10-rc1, also as the common code 
 to handle the 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 notify resume
   powerpc: Use the new schedule_user API on userspace preemption
   powerpc: select HAVE_CONTEXT_TRACKING for pSeries
 
  arch/powerpc/include/asm/context_tracking.h |   10 +++
  arch/powerpc/include/asm/thread_info.h  |7 ++-
  arch/powerpc/kernel/entry_64.S  |3 +-
  arch/powerpc/kernel/ptrace.c|5 ++
  arch/powerpc/kernel/signal.c|5 ++
  arch/powerpc/kernel/traps.c |   91 
 ---
  arch/powerpc/mm/fault.c |   16 -
  arch/powerpc/mm/hash_utils_64.c |   38 ---
  arch/powerpc/platforms/pseries/Kconfig  |1 +
  9 files changed, 140 insertions(+), 36 deletions(-)
  create mode 100644 arch/powerpc/include/asm/context_tracking.h
 


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev