Re: [PATCH v2] mailbox: Hi3660: Fixup mailbox state machine malfunction issue

2018-12-06 Thread leo . yan
ed-off-by: Kevin Wangtao Thanks for sending out this patch, Kevin. I tested this patch at my side with two cases (one is dhry2 for performance testing for every OPPs, and another is stress test two clusters frequency change concurrently), both of them can pass after applied this patch. Reviewed-and-t

Re: [PATCH v1 5/5] perf cs-etm: Track exception number

2018-12-05 Thread leo . yan
t; is > > > recorded here isn't used anywhere? > > > > The exception number will be used to set branch flag patch [1]. > > Right, I realised that when I started reviewing that set. The rule of > thumb here is to introduce code in the same patchset it is used so > that we avoid adding needless code to the kernel. Will move this patch into sample flag series. Thanks, Leo Yan

Re: [PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-12-05 Thread leo . yan
> > Absolutely. Make sure to get to the bottom of the story with Mike > and/or Robert before sending your next patchset. Sure, will sync with Mike/Rob. Thanks, Leo Yan

Re: [PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-12-05 Thread leo . yan
On Wed, Dec 05, 2018 at 10:40:07AM -0700, Mathieu Poirier wrote: [...] > > > > static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( > > > > const void *context, > > > > const ocsd_trc_index_t indx __maybe_unused, > > > > @@

Re: [PATCH v2 2/2] perf cs-etm: Add support sample flags

2018-12-04 Thread leo . yan
work on CPU-wide trace scenarios. Because you're > > getting there ahead of me you'll need to fix the declaration of struct > > cs_etm_queue but that's easy. > > I've been thinking further about this and manipulating the etmq packet > and prev_packet from the cs-etm-decoder.c won't work because all we > have at that time is the decoder's packet queue. My goal is to > manipulate the flags in only one place - either in cs-etm.c or > cs-etm-decoder.c but not in both. It might be worth trying to do the > implementation in cs-etm.c since there is already a lot of packet flow > intelligence happening there. Agree. cs-etm.c has more context info than cs-etm-decoder.c, will try to refactor in single place in cs-etm.c. [...] Thanks, Leo Yan

Re: [PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 03:26:17PM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 01:07:55PM +0800, Leo Yan wrote: > > The perf sample data contains flags to indicate the hardware trace data > > is belonging to which type branch instruction, thus this can be used t

Re: [PATCH v1 5/5] perf cs-etm: Track exception number

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 01:47:49PM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 12:59:43PM +0800, Leo Yan wrote: > > When an exception packet comes, it contains the info for exception > > number; the exception number indicates the exception types, so from it

Re: [PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 11:27:59AM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 12:59:41PM +0800, Leo Yan wrote: > > As described in OpenCSD (CoreSight decoder lib), in the decoding stream > > it includes one trace element with type OCSD_GEN_TRC_ELEM_NO_SYNC; the > &

Re: [PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-12-04 Thread leo . yan
t is if we wouldn't be better off splitting cs_etm__flush() > in order to reduce the complexity of the main decoding loop. That is rename > cs_etm__flush() to something like cs_etm__trace_on() and spin off a new > cs_etm__end_block(). > > It does introduce a little bit of code duplication but I think we'd win in > terms > of readability and flexibility. Sorry for long delay, Mathieu. Agree with the idea of splitting cs_etm__flush() into two functions. Will spin patch for new version. Thanks, Leo Yan > > } > > > > return err; > > -- > > 2.7.4 > >

Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size'

2018-12-04 Thread leo . yan
used [-Wunused-but-set-variable] > > It never used since introduction in commit > 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component") > > Signed-off-by: YueHaibing FWIW, Tested-by: Leo Yan > --- > drivers/hwtracing/coresight/coresigh

Re: [PATCH] coresight: cpu-debug: Support for CA73 CPUs

2018-12-03 Thread leo . yan
On Mon, Dec 03, 2018 at 10:34:07AM -0700, Mathieu Poirier wrote: > On Thu, 29 Nov 2018 at 18:22, Leo Yan wrote: > > > > This patch is to add the AMBA device ID for CA73 CPU, so that CPU debug > > module can be initialized successfully when a SoC contain CA73 CPUs. > &

Re: [PATCH] perf evsel: Correct clock unit to nanosecond

2018-12-02 Thread leo . yan
On Fri, Nov 30, 2018 at 12:25:21PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Nov 30, 2018 at 10:21:40PM +0800, leo@linaro.org escreveu: > > On Fri, Nov 30, 2018 at 11:21:54AM +0100, Jiri Olsa wrote: > > > On Fri, Nov 30, 2018 at 06:06:05PM +0800, Leo Yan wrote: &g

Re: [PATCH] perf evsel: Correct clock unit to nanosecond

2018-11-30 Thread leo . yan
On Fri, Nov 30, 2018 at 11:21:54AM +0100, Jiri Olsa wrote: > On Fri, Nov 30, 2018 at 06:06:05PM +0800, Leo Yan wrote: > > Since commit 0aa802a79469 ("perf stat: Get rid of extra clock display > > function"), the cpu and task clock unit has been changed from > >

[PATCH] perf evsel: Correct clock unit to nanosecond

2018-11-30 Thread Leo Yan
,msec,task-clock,3003643300,100.00,1.000,CPUs utilized Now: # perf stat -e cpu-clock,task-clock -C 0 -x, sleep 3 3003501460,nsec,cpu-clock,3003501660,100.00,1.000,CPUs utilized 3003499500,nsec,task-clock,3003499500,100.00,1.000,CPUs utilized Cc: Daniel Thompson Signed-off-by: Leo Yan ---

[PATCH] coresight: cpu-debug: Support for CA73 CPUs

2018-11-29 Thread Leo Yan
This patch is to add the AMBA device ID for CA73 CPU, so that CPU debug module can be initialized successfully when a SoC contain CA73 CPUs. This patch has been verified on 96boards Hikey960. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 1 file changed

Re: [PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-11-17 Thread leo . yan
t is if we wouldn't be better off splitting cs_etm__flush() > in order to reduce the complexity of the main decoding loop. That is rename > cs_etm__flush() to something like cs_etm__trace_on() and spin off a new > cs_etm__end_block(). > > It does introduce a little bit of code duplication but I think we'd win in > terms > of readability and flexibility. Thanks for reviewing, Mathieu. I agree with your suggestion to split cs_etm__flush() into two functions, will spin this patch with the suggestion in next series for reviewing. Thanks, Leo Yan

[PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-11-10 Thread Leo Yan
PU trap, data and instruction prefetch abort, alignment abort; usually these exceptions are synchronous for CPU, so set them as "bci" type. Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Cc: Al Grant Cc: Andi Kleen Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Signed-off-b

[PATCH v2 0/2] perf cs-etm: Add support for sample flags

2018-11-10 Thread Leo Yan
.uk/lurker/message/2018.045938.782b378b.en.html Leo Yan (2): perf cs-etm: Set branch instruction flags in packet perf cs-etm: Add support sample flags tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 168 tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 +

[PATCH v2 2/2] perf cs-etm: Add support sample flags

2018-11-10 Thread Leo Yan
So set flag PERF_IP_FLAG_TRACE_START to TRACE_OFF packet if one, this flag isn't used by TRACE_OFF packet but used to indicate trace restarting when generate sample. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 43 +-- 1 file changed, 41 inse

[PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-11-10 Thread Leo Yan
s to add new argument 'new_packet' for cs_etm__flush(), we can pass 'true' for this argument if there have a new packet, otherwise it will pass 'false' for the purpose of only flushing branch stack entries and avoid to generate sample for stale packet. Signed-off-by: Leo Yan --- tools/pe

[PATCH v1 5/5] perf cs-etm: Track exception number

2018-11-10 Thread Leo Yan
can be used by exception return packet. If detect there have discontinuous trace with TRACE_ON or TRACE_OFF packet, the exception number is set to invalid value. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 67 ++--- 1 file changed, 59

[PATCH v1 4/5] perf cs-etm: Generate branch sample for exception packet

2018-11-10 Thread Leo Yan
'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 26 +-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 ++-- tools/perf/util/cs-etm.c

[PATCH v1 1/5] perf cs-etm: Correct packets swapping in cs_etm__flush()

2018-11-10 Thread Leo Yan
this can fix the wrong program flow dumping issue. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 48ad217..fe18d7b 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/

[PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-11-10 Thread Leo Yan
() it also needs to generate samples if TRACE_OFF packet is followed by one sequential instructions packet. This patch also converts the address to 0 for TRACE_OFF packet, this is same with TRACE_ON packet as well. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10

[PATCH v1 0/5] perf cs-etm: Correct packets handling

2018-11-10 Thread Leo Yan
/scm/linux/kernel/git/acme/linux.git/log/?h=perf/core [2] http://archive.armlinux.org.uk/lurker/message/20181109.091126.9d69489d.en.html Leo Yan (5): perf cs-etm: Correct packets swapping in cs_etm__flush() perf cs-etm: Avoid stale branch samples when flush packet perf cs-etm: Support for NO_S

Re: [PATCH v4] perf: Support for Arm A32/T32 instruction sets in CoreSight trace

2018-11-08 Thread leo . yan
nsntructions. Tested-by: Leo Yan

Re: Question: perf dso support for /proc/kallsyms

2018-11-08 Thread leo . yan
can simply run 'uname' program so it can produce kernel and user space trace data, if I use 'perf script -k vmlinux' then I can see perf generate samples for kernel related traces, but if use 'perf script' then only can see samples for user space. Thanks, Leo Yan [1] https://git.kernel.org/pu

Re: Question: perf dso support for /proc/kallsyms

2018-11-06 Thread leo . yan
On Fri, Nov 02, 2018 at 10:55:16AM +0800, Leo Yan wrote: > Hi all, > > Now I found that if use the command 'perf script' for Arm CoreSight trace > data, it fails to parse kernel symbols if we don't specify kernel vmlinux > file. So when we don't specify kernel symbol files

Re: [PATCH 3/3] coresight: etm3x: Release CLAIM tag when operated from perf

2018-11-06 Thread leo . yan
cked(drvdata->base); > + Just remind, this isn't consistent with the sequency in function etm_disable_hw(), which has the reversed sequence between etm_set_pwrdwn() and coresight_disclaim_device_unlocked(). Not sure which one sequence is more suitable, at the first glance, accessing register after p

Re: Question: perf dso support for /proc/kallsyms

2018-11-02 Thread leo . yan
ing kernel pointer values and this will bother much for cross platforms usage (e.g. 'perf record' on Arm platform and 'perf script' on x86 platform). At my side, I executed all commands on Arm Juno board and simply to say the kallsyms support is broken in perf. Thanks, Leo Yan

Re: Question: perf dso support for /proc/kallsyms

2018-11-02 Thread leo . yan
uld has higher priority than /proc/kallsyms, by default the perf tool should use kallsyms file under ~/.debug folder. I also tried to manually specify the kallsyms file with the command "perf script --kallsyms ./kallsyms", for both cases perf fails to parse symbols for any kernel address. Thanks, Leo Yan

Re: Question: perf dso support for /proc/kallsyms

2018-11-02 Thread leo . yan
; Does it all work if you run perf record as sudo? Or if you do > >sudo sysctl kernel.kptr_restrict=0 > > before you run perf record? Yes, tested this on Juno board with Debian rootFS and logined in with 'root' user. I suspected the pointer permission issue so checked with below co

Question: perf dso support for /proc/kallsyms

2018-11-01 Thread leo . yan
he offset sanity. */ if (offset > dso->data.file_size) return -1; if (offset + size < offset) return -1; return cached_read(dso, machine, offset, data, size); } Thanks, Leo Yan

[tip:perf/urgent] perf cs-etm: Correct CPU mode for samples

2018-10-31 Thread tip-bot for Leo Yan
Commit-ID: d6c9c05fe1eb4b213b183d8a1e79416256dc833a Gitweb: https://git.kernel.org/tip/d6c9c05fe1eb4b213b183d8a1e79416256dc833a Author: Leo Yan AuthorDate: Tue, 30 Oct 2018 15:18:28 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 31 Oct 2018 09:57:50 -0300 perf cs-etm

Re: [PATCH] perf cs-etm: Correct CPU mode for samples

2018-10-30 Thread leo . yan
Hi Arnaldo, On Tue, Oct 30, 2018 at 11:32:26AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Oct 30, 2018 at 03:18:28PM +0800, Leo Yan escreveu: > > Since commit 9042f5e3539e ("perf tools: Stop fallbacking to kallsyms > > for vdso symbols lookup"), the kernel address

[PATCH] perf cs-etm: Correct CPU mode for samples

2018-10-30 Thread Leo Yan
in cs_etm__mem_access() for a minor polishing. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 3b37d66..73430b7 100644 --- a/tools/

[PATCH v1 1/4] perf cs-etm: Generate branch sample for exception packet

2018-10-28 Thread Leo Yan
'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 26 +-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 10 - tools/perf/util/cs-etm.c

[PATCH v1 0/4] perf cs-etm: Add support for sample flags

2018-10-28 Thread Leo Yan
instruction sets in CoreSight trace' also is prerequisite to support A32/T32 ISAs. The patches can be applied on the acme core branch [1] and tested on Juno board with below commands for A64 and A32/T32 building: # perf script -F,-time,+flags,+ip,+sym,+addr -k vmlinux Leo Yan (4): perf cs-etm

[PATCH v1 4/4] perf cs-etm: Add support sample flags

2018-10-28 Thread Leo Yan
packet is exception packet or exception return packet, also update the previous packet for exception specific flags. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs

[PATCH v1 3/4] perf cs-etm: Set branch instruction flags in packet

2018-10-28 Thread Leo Yan
PU trap, data and instruction prefetch abort, alignment abort; usually these exceptions are synchronous for CPU, so set them as "bci" type. Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Cc: Al Grant Cc: Andi Kleen Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Signed-off-b

[PATCH v1 2/4] perf cs-etm: Track exception number

2018-10-28 Thread Leo Yan
can be used by exception return packet. If detect there have discontinuous trace with TRACE_ON packet, the exception number is set to invalid value. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 51 ++--- 1 file changed, 45 insertions(+), 6

[PATCH] coresight: tmc: Fix bad register address for CLAIM

2018-10-18 Thread Leo Yan
eac46db9e5 ]--- This patch is to fix this bug by using 'drvdata->base' as the register base address for CLAIM related operation. Fixes: 4d3ebd3658d8 ("coreisght: tmc: Claim device before use") Cc: Suzuki Poulose Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Signed-off-by: Leo Yan

Re: [PATCH v6 3/5] tools, perf, script: Add --call-trace and --call-ret-trace

2018-10-02 Thread leo . yan
olve > > symbols [1]; these two issues are only related with CoreSight decoder > > and it's no matter with this patch, so I didn't mention in my previous > > replying. > > Could I take that as a Tested-by? I.e. you actually applied the patches, > run it and saw that it wor

Re: [PATCH v6 3/5] tools, perf, script: Add --call-trace and --call-ret-trace

2018-09-29 Thread leo . yan
in my previous replying. I need a bit more time to work out more formal CoreSight fixing patches and will send for reviewing (also will include one patch to clarifying Arm Coresight support in doc as suggested). Thanks, Leo Yan [1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/builtin-script.c?h=perf/core#n1128

Re: [PATCH v6 3/5] tools, perf, script: Add --call-trace and --call-ret-trace

2018-09-28 Thread leo . yan
are tracing (e.g. Arm CoreSight) can enable these features as well. This patch is to document only for intel_pt, later if we enable this feature on Arm platform we need to change the doc; alternatively we can use more general description for these two options at the first place. How about you thin

Re: [PATCH 02/11] dts: hisilicon: Update coresight bindings for hardware ports

2018-09-12 Thread leo . yan
}; > }; > }; > @@ -319,10 +334,12 @@ > > cpu = <>; > > - port { > + out-ports { > + port { > etm4_out: en

Re: [PATCH 04/11] dts: qcom: Update coresight bindings for hardware ports

2018-09-12 Thread leo . yan
is valid, this means the DT binding doc also gives wrong example for tpiu node [1]. I tested this patch with upper changing to 'in-ports', etm with perf mode can work well on DB410c board. [...] Thanks, Leo Yan [1] https://git.linaro.org/kernel/coresight.git/tree/Documentation/devicetree/bindings/arm/coresight.txt?h=next#n135

[PATCH] coresight: tmc: Refactor loops in etb dump

2018-09-05 Thread Leo Yan
lso reduces indentation and we can use 'break' to replace 'goto' tag. Cc: Mathieu Poirier Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c

Re: [PATCH] cpuidle: menu: Retain tick when shallow state is selected

2018-08-22 Thread leo . yan
On Wed, Aug 22, 2018 at 08:02:00PM +0800, Leo Yan wrote: [...] > > + if (!tick_nohz_tick_stopped()) { > > + /* > > +* If the state selected so far is shallow, > > +* waking

Re: [PATCH] cpuidle: menu: Retain tick when shallow state is selected

2018-08-22 Thread leo . yan
> > Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with > stopped tick) > Reported-by: Leo Yan > Signed-off-by: Rafael J. Wysocki > --- > > Commit 5ef499cd571c (cpuidle: menu: Handle stopped tick more aggressively) is > in linux-next only at this point.

Re: [PATCH] sched: idle: Avoid retaining the tick when it has been stopped

2018-08-18 Thread leo . yan
take place when the tick was being restarted), so it should > rather be avoided IMO. I expect the idle governor doesn't introduce many restarting tick operations, the reason is if there have a close timer event than idle governor can trust it to wake up CPU so in this case the idle governor will not restart tick; if the the timer event is long delta and the shallow state selection is caused by factors (e.g. typical pattern), then we need restart tick to avoid powernightmares, for this case we can restart tick only once at the beginning for the typical pattern interrupt events; after the typical pattern interrupt doesn't continue then we can rely on the tick to rescue the idle state to deep one. Thanks, Leo Yan

Re: AArch64 boot failure on Hikey960 on latest master after "arm64: insn: Don't fallback on nosync path for general insn patching"

2018-08-15 Thread leo . yan
0.207739] notify_cpu_starting+0x68/0xa0 > [0.207742] secondary_start_kernel+0xe8/0x160 >From this part log, it's quite likely related with CPU4 (CA73) with arch timer workaround ERRATUM_858921, before I reported another similiar lockup issue: https://lkml.org/lkml/2017/7/24/346. Thanks, Leo Yan

Re: [PATCH v5] cpuidle: menu: Handle stopped tick more aggressively

2018-08-14 Thread leo . yan
tion, make it always indicate that the tick should be stopped > if it has been stopped already for consistency. > > Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with > stopped tick) > Reported-by: Leo Yan > Signed-off-by: Rafael J. Wysocki > --- > ->

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-13 Thread leo . yan
g in 'menu' idle governor' [2], the testing result supports the idle duration improvement, which shared in the cover letter. Please help review and let me know if it's doable or not. Thanks for the suggestion. Thanks, Leo Yan [1] https://lkml.org/lkml/2018/8/12/84 [2] https://lkml.org/lkml/2018/8/12/82

[PATCH v1 2/5] cpuidle: menu: Record tick delta value in struct menu_device

2018-08-12 Thread Leo Yan
metric for consideration. To achieve these purposes, this patch adds a new item 'tick_delta_us' in struct menu_device to record tick delta value. This patch also is a preparation for optimization stopping tick in sequential patches. Signed-off-by: Leo Yan --- drivers/cpuidle/governors/menu.c

[PATCH v1 4/5] cpuidle: menu: Don't stay in shallow state for a long time

2018-08-12 Thread Leo Yan
t stop the tick for this case so can avoid powernightmares issue. Signed-off-by: Leo Yan --- drivers/cpuidle/governors/menu.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 4f02207..566c65c

[PATCH v1 3/5] cpuidle: menu: Provide menu_decide_stopping_tick()

2018-08-12 Thread Leo Yan
for the idle state calibration and thus save one indent level in the loop. Signed-off-by: Leo Yan --- drivers/cpuidle/governors/menu.c | 76 ++-- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle

[PATCH v1 0/5] Improvement stopping tick decision making in 'menu' idle governor

2018-08-12 Thread Leo Yan
patch 'cpuidle: menu: Handle stopped tick more aggressively' [1] to avoid select unexpected shallow state after tick has been stopped. [1] https://lkml.org/lkml/2018/8/10/259 Leo Yan (5): cpuidle: menu: Clean up variables usage in menu_select() cpuidle: menu: Record tick delta value in struct

[PATCH v1 5/5] cpuidle: menu: Change to compare prediction with tick delta

2018-08-12 Thread Leo Yan
lta value and it's a accurate estimation for tick event coming. This patch changes to compare prediction with tick delta rather than comparing with the static tick interval. Signed-off-by: Leo Yan --- drivers/cpuidle/governors/menu.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) d

[PATCH v1 1/5] cpuidle: menu: Clean up variables usage in menu_select()

2018-08-12 Thread Leo Yan
r tick boundary for choosing idle state; we purely use 'expected_interval' to record the expected interval value, which is mainly for interval interrupt estimation. Signed-off-by: Leo Yan --- drivers/cpuidle/governors/menu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-12 Thread leo . yan
On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 11:03 AM wrote: > > > > On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > > > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > > > On F

Re: [PATCH v3] cpuidle: menu: Handle stopped tick more aggressively

2018-08-12 Thread leo . yan
l cause the selected idle states > to always match the known CPU wakeup time. > > Also make it always indicate that the tick should be stopped in > that case for consistency. > > Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with > stopped tick) > Re

Re: [PATCH v2] cpuidle: menu: Handle stopped tick more aggressively

2018-08-12 Thread leo . yan
gt; > > > > The only effect of it would be setting stop_tick to false, but why > > > would that matter? > > > > Please consider below situation, not sure if this case is existed or > > not: > > > > step1: first time: enter one idle state with stopping tick; > > step2: second time: select POLLING state and tick_nohz_tick_stopped() > > is true; > > > > So in step2, it cannot set stop_tick to false with below sentence. > > > > > > > unsigned int delta_next_us = ktime_to_us(delta_next); > > > > > > > > > > *stop_tick = false; > > But setting *stop_tick has no effect as far as the current code is > concerned (up to the bug fixed by the other patch). Yeah. > Also the POLLING state can only be selected if there are no other > states matching delta_next available in that case which means that > there will be a timer to break the polling loop soon enough (and BTW > the polling has a built-in timeout too), so I don't really see a > problem here. Ah, now I understand the logic and I misunderstand the POLLING mode before; now agree with this. Sorry for noise. Thanks, Leo Yan

Re: [PATCH v2] cpuidle: menu: Handle stopped tick more aggressively

2018-08-10 Thread leo . yan
> > duration to be equal to the time till the closest timer event if > > > the tick is not running which will cause the selected idle states > > > to always match the known CPU wakeup time. > > > > > > Also make it always indicate that the

Re: [PATCH v2] cpuidle: menu: Handle stopped tick more aggressively

2018-08-10 Thread leo . yan
equal to the time till the closest timer event if > the tick is not running which will cause the selected idle states > to always match the known CPU wakeup time. > > Also make it always indicate that the tick should be stopped in > that case for consistency. > > Fixes: 87c9fe6ee495 (cpuid

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > > >> On Thu, Aug 9, 2

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > [cut] > > >> And th

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > The criteria for keeping tick running is the prediction duration is less > > than TICK_USEC, > > Yes, because if the predicted idle duration is less t

Re: [PATCH] sched: idle: Avoid retaining the tick when it has been stopped

2018-08-10 Thread leo . yan
e their own policy for how to use the tick in idle loop. This patch seems mixes two things and finally it's possible to couple the implementation between idle loop and 'menu' governor for sched tick usage. I still think my patch to restart the tick is valid :) Thanks, Leo Yan > Fixes: 554c

Re: [PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-09 Thread leo . yan
On Thu, Aug 09, 2018 at 11:31:46PM +0200, Rafael J . Wysocki wrote: [...] > > >> And I really would prefer to avoid restarting the tick here, because > > >> it is overhead and quite likely unnecessary. > > > > > > I understand the logic when read the code, actually I did some experiments > > >

[RESEND PATCH v1 2/2] cpuidle: menu: Dismiss tick impaction on correction factors

2018-08-09 Thread Leo Yan
d tick. This patch is to check if it's a tick wakeup, it takes the CPU can stay in the idle state for enough time so it gives high compensation for the measured' interval, this can avoid tick impaction on the correction factor array. Cc: Daniel Lezcano Cc: Vincent Guittot Signed-off-by: L

[RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-09 Thread Leo Yan
we also need consider from the perspective of deepest idle state 'target_residency'. Finally, 'stop_tick_point' is coming from the minimum value within the deepest idle state 'target_residency' and TICK_USEC. Cc: Daniel Lezcano Cc: Vincent Guittot Signed-off-by: Leo Yan --- drivers/cpui

[RESEND PATCH v1 0/2] Optimization CPU idle state impacted by tick

2018-08-09 Thread Leo Yan
%1.785221 6.974483 81.083312 0.548050 5.319929 83.551747 -1.237171 -1.654554 +2.468435 40%1.403247 6.474203 80.577176 0.467686 6.366482 81.983384 -0.935561 -0.107721 +1.406208 Leo Yan (2): cpuidle: menu: Correct the criteria for stopping tick cpuidle: menu: Dismiss tick

Re: [PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-09 Thread leo . yan
long period. > > Fair enough, but in that case the governor will want the tick to be > stopped, because expected_interval is TICK_USEC then, so I'm not sure > how the patch helps? Correct, I might introduce confusion at here and I mentioned in another email I have one prerequisite patch [1]: "cpuidle: menu: Correct the criteria for stopping tick", if without this dependency patch, the idle governor will always stop the tick even it selects one shallow state. Sorry when I sent patchs with [1], I didn't send to linux-pm mailing list, do you want me to send these patches to linux-pm? [...] Thanks, Leo Yan [1] https://lkml.org/lkml/2018/8/7/407

Re: [PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-09 Thread leo . yan
On Thu, Aug 09, 2018 at 05:42:30PM +0200, Rafael J. Wysocki wrote: [...] > >> This issue can be easily reproduce with the case on Arm Hikey board: use > >> CPU0 to send IPI to CPU7, CPU7 receives the IPI and in the callback > >> function it start a hrtimer with 4ms, so the 4ms timer delta value

Re: [PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-09 Thread leo . yan
On Thu, Aug 09, 2018 at 12:45:49PM +0200, Peter Zijlstra wrote: > On Thu, Aug 09, 2018 at 01:47:27PM +0800, Leo Yan wrote: > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > > index 1a3e9bd..802286e 100644 > > --- a/kernel/sched/idle.c > > +++ b/kernel/sched/id

Re: [PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-09 Thread leo . yan
On Thu, Aug 09, 2018 at 01:47:27PM +0800, Leo Yan wrote: > The idle loop stops tick by respecting the decision from cpuidle > framework, if the condition 'need_resched()' is false without any task > scheduling, the CPU keeps running in the loop in do_idle() and it has no >

[PATCH] sched: idle: Reenable sched tick for cpuidle request

2018-08-08 Thread Leo Yan
278 +0.036 +0.000 +5.278 71.894 8.013 0.059 1.509 0.026 8.002 -0.384 -7.987 +7.942 All 1.976 8.068 59.179 1.737 0.372 72.539 -0.239 -7.695 +13.360 Cc: Daniel Lezcano Cc: Vincent Guittot Signed-off-by: Leo Yan --- kernel/sched/idle.c | 12 ++-- 1 file changed,

Re: [PATCH v1 0/2] Optimization CPU idle state impacted by tick

2018-08-07 Thread leo . yan
On Tue, Aug 07, 2018 at 10:27:02PM +0800, Leo Yan wrote: > After Rafael's patch series 'sched/cpuidle: Idle loop rework' has been > merged in mainline kernel, it perfectly resolved the Powernightmares > issue [1] with not stopping the tick during the idle loop; we verified > this

[PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-07 Thread Leo Yan
we also need consider from the perspective of deepest idle state 'target_residency'. Finally, 'stop_tick_point' is coming from the minimum value within the deepest idle state 'target_residency' and TICK_USEC. Cc: Daniel Lezcano Cc: Vincent Guittot Signed-off-by: Leo Yan --- drivers/cpui

[PATCH v1 0/2] Optimization CPU idle state impacted by tick

2018-08-07 Thread Leo Yan
%1.785221 6.974483 81.083312 0.548050 5.319929 83.551747 -1.237171 -1.654554 +2.468435 40%1.403247 6.474203 80.577176 0.467686 6.366482 81.983384 -0.935561 -0.107721 +1.406208 Leo Yan (2): cpuidle: menu: Correct the criteria for stopping tick cpuidle: menu: Dismiss tick

[PATCH v1 2/2] cpuidle: menu: Dismiss tick impaction on correction factors

2018-08-07 Thread Leo Yan
d tick. This patch is to check if it's a tick wakeup, it takes the CPU can stay in the idle state for enough time so it gives high compensation for the measured' interval, this can avoid tick impaction on the correction factor array. Cc: Daniel Lezcano Cc: Vincent Guittot Signed-off-by: L

[tip:perf/core] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet

2018-08-02 Thread tip-bot for Leo Yan
Commit-ID: d603b4e9f9c3181f2dacb989bba60081b99befe4 Gitweb: https://git.kernel.org/tip/d603b4e9f9c3181f2dacb989bba60081b99befe4 Author: Leo Yan AuthorDate: Wed, 11 Jul 2018 15:45:44 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 11:22:11 -0300 perf cs-etm

[tip:perf/core] perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet

2018-08-02 Thread tip-bot for Leo Yan
Commit-ID: 14a85b1eca348e00a9f209b522f94ec3ead94acb Gitweb: https://git.kernel.org/tip/14a85b1eca348e00a9f209b522f94ec3ead94acb Author: Leo Yan AuthorDate: Wed, 11 Jul 2018 15:45:45 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 11:22:50 -0300 perf cs-etm

[tip:perf/core] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet

2018-08-02 Thread tip-bot for Leo Yan
Commit-ID: 6035b6804bdfd662c8ee6226dc90f3764060ec73 Gitweb: https://git.kernel.org/tip/6035b6804bdfd662c8ee6226dc90f3764060ec73 Author: Leo Yan AuthorDate: Wed, 11 Jul 2018 15:45:43 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 10:58:29 -0300 perf cs-etm

[tip:perf/core] perf cs-etm: Fix start tracing packet handling

2018-08-02 Thread tip-bot for Leo Yan
Commit-ID: 3eb3e07bcfee0670d7142f839c76f33f3d265793 Gitweb: https://git.kernel.org/tip/3eb3e07bcfee0670d7142f839c76f33f3d265793 Author: Leo Yan AuthorDate: Wed, 11 Jul 2018 15:45:42 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 10:57:56 -0300 perf cs-etm: Fix

Re: [PATCH v2 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-31 Thread leo . yan
On Tue, Jul 31, 2018 at 11:24:45AM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Jul 23, 2018 at 09:35:07AM +0800, leo@linaro.org escreveu: > > Hi Arnaldo, > > > > On Wed, Jul 11, 2018 at 03:45:39PM +0800, Leo Yan wrote: > > > > Just want to con

[tip:perf/core] perf cs-etm: Bail out immediately for instruction sample failure

2018-07-25 Thread tip-bot for Leo Yan
Commit-ID: 6cd4ac6a02c9bc6560faf567ac013902ab9cd039 Gitweb: https://git.kernel.org/tip/6cd4ac6a02c9bc6560faf567ac013902ab9cd039 Author: Leo Yan AuthorDate: Mon, 18 Jun 2018 13:09:55 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Jul 2018 14:48:32 -0300 perf cs-etm: Bail

[tip:perf/core] perf cs-etm: Introduce invalid address macro

2018-07-25 Thread tip-bot for Leo Yan
Commit-ID: 6abf0f451087176caf0f9ad0cc2a79bcc5ebb443 Gitweb: https://git.kernel.org/tip/6abf0f451087176caf0f9ad0cc2a79bcc5ebb443 Author: Leo Yan AuthorDate: Mon, 18 Jun 2018 13:09:54 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Jul 2018 14:48:22 -0300 perf cs-etm

Re: [PATCH v2 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-22 Thread leo . yan
Hi Arnaldo, On Wed, Jul 11, 2018 at 03:45:39PM +0800, Leo Yan wrote: Just want to confirm, I saw the first two patches in this serise have been merged into perf/core branch [1], but the last 4 patches are missed. Could I know if you have trouble when you apply them? Or anything need me

[PATCH v2 4/6] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
athieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index ae7c9c88..976db84 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@

[PATCH v2 2/6] perf cs-etm: Bail out immediately for instruction sample failure

2018-07-11 Thread Leo Yan
If the instruction sample failure has happened, it isn't necessary to execute to the end of the function cs_etm__flush(). This commit is to bail out immediately and return the error code. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 3 +++ 1 file changed

[PATCH v2 6/6] perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index d3b7942..2ae6402 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c

[PATCH v2 3/6] perf cs-etm: Fix start tracing packet handling

2018-07-11 Thread Leo Yan
empty, so this can record the start tracing packet into 'etmq->prev_packet'. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util/cs-etm.c| 19 ++- 2 files changed, 19 inserti

[PATCH v2 1/6] perf cs-etm: Introduce invalid address macro

2018-07-11 Thread Leo Yan
This patch introduces invalid address macro and uses it to replace dummy value '0xdeadbeefdeadbeefUL'. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools

[PATCH v2 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
packet. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 976db84..d3b7942 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c

[PATCH v2 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-11 Thread Leo Yan
l/git/acme/linux.git Changes from v1: * Rebased on Linus mainline kernel 4.18-rc4; * Added Mathieu 'reviewed' tags in patches. Leo Yan (6): perf cs-etm: Introduce invalid address macro perf cs-etm: Bail out immediately for instruction sample failure perf cs-etm: Fix start tracing packet handling p

Re: [PATCH] arm64: hikey960: update idle-states

2018-07-08 Thread leo . yan
.111ms ? > > Actually the French notation is ',' for decimal :) > > English and French are inverted. > > For example one million is noted: > > French : 1.000.000 (or 1 000 000) > English : 1,000,000 > > And one milli is noted: > > French : 0,001 > English

Re: [PATCH] arm64: hikey960: update idle-states

2018-07-08 Thread leo . yan
gt; - to be shorter than old cluster residency time and longer than new > residency time od cluster off C-state Should s/od/of/ ? Except these two minor typos, the patch is very good improvement. Reviewed-by: Leo Yan > - to prevent any sync with tick (4ms) when running tests that can add &

Re: [PATCH v1 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-01 Thread leo . yan
Hi Arnaldo, On Tue, Jun 19, 2018 at 03:19:43PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jun 19, 2018 at 11:46:02AM -0600, Mathieu Poirier escreveu: > > On Sun, 17 Jun 2018 at 23:10, Leo Yan wrote: > > > > > > Due the current code is missing to handle

  1   2   3   4   5   6   7   8   9   >