Re: [PATCH] x86, sched: Fix the AMD CPPC maximum perf on some specific generations

2021-04-20 Thread Huang Rui
On Tue, Apr 20, 2021 at 04:22:31PM +0800, Borislav Petkov wrote: > On Tue, Apr 20, 2021 at 04:09:43PM +0800, Huang Rui wrote: > > Some AMD Ryzen generations has different calculation method on maximum > > perf. 255 is not for all asics, some specific generations used 166 as >

[PATCH] x86, sched: Fix the AMD CPPC maximum perf on some specific generations

2021-04-20 Thread Huang Rui
e for AMD systems") Fixes: 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover boost frequencies") Reported-by: Jason Bagavatsingham Tested-by: Jason Bagavatsingham Signed-off-by: Huang Rui Cc: Alex Deucher Cc: Nathan Fontenot Cc: Rafael J. Wysocki Cc: Bo

Re: [PATCH 2/2] drm/ttm: optimize the pool shrinker a bit v2

2021-04-15 Thread Huang Rui
ood for me as well. Acked-by: Huang Rui > --- > drivers/gpu/drm/ttm/ttm_pool.c | 44 +- > 1 file changed, 22 insertions(+), 22 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c > index cb38b1a17b09..955

Re: your mail

2021-04-07 Thread Huang Rui
On Wed, Apr 07, 2021 at 09:27:46AM +0800, songqiang wrote: Please add the description in the commit message and subject. Thanks, Ray > Signed-off-by: songqiang > --- > drivers/gpu/drm/ttm/ttm_page_alloc.c | 18 ++ > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --g

Re: [PATCH 0/3] iommu/amd: Fix booting with amd_iommu=off

2021-03-17 Thread Huang Rui
IOMMU is > disabled > iommu/amd: Keep track of amd_iommu_irq_remap state Series are Acked-by: Huang Rui > > drivers/iommu/amd/init.c | 36 > 1 file changed, 20 insertions(+), 16 deletions(-) > > -- > 2.30.2 >

Re: [PATCH] iommu/amd: Fix iommu remap panic while amd_iommu is set to disable

2021-03-17 Thread Huang Rui
On Tue, Mar 16, 2021 at 11:00:26PM +0800, Joerg Roedel wrote: > On Tue, Mar 16, 2021 at 09:36:02PM +0800, Huang Rui wrote: > > Thanks for the comments. Could you please elaborate this? > > > > Do you mean while amd_iommu=off, we won't prepare the IVRS, and even >

Re: [PATCH] iommu/amd: Fix iommu remap panic while amd_iommu is set to disable

2021-03-16 Thread Huang Rui
On Tue, Mar 16, 2021 at 09:16:34PM +0800, Joerg Roedel wrote: > Hi Huang, > > On Thu, Mar 11, 2021 at 10:28:07PM +0800, Huang Rui wrote: > > diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c > > index f0adbc48fd17..a08e885403b7 100644 > > --- a/drivers/

Re: [PATCH V2] drm: amd: pm: Mundane typo fixes in the file amdgpu_pm.c

2021-03-14 Thread Huang Rui
On Mon, Mar 15, 2021 at 11:21:36AM +0800, Bhaskar Chowdhury wrote: > > s/"an minimum"/"a minimum"/ > s/"an maxmum"/"a maximum"/ > > Signed-off-by: Bhaskar Chowdhury Reviewed-by: Huang Rui > --- > Changes from V1: > Randy&#

[PATCH] iommu/amd: Fix iommu remap panic while amd_iommu is set to disable

2021-03-11 Thread Huang Rui
u Signed-off-by: Huang Rui Cc: Joerg Roedel Cc: Suravee Suthikulpanit Cc: Alex Deucher Cc: sta...@vger.kernel.org --- drivers/iommu/amd/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index f0adbc48fd17..a08e88540

Re: [PATCH][next] drm/amdgpu: Fix masking binary not operator on two mask operations

2021-01-24 Thread Huang Rui
wise operator") > Fixes: 3c9a7b7d6e75 ("drm/amdgpu: update mmhub mgcg&ls for mmhub_v2_3") > Signed-off-by: Colin Ian King Thanks. Reviewed-by: Huang Rui > --- > drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

Re: linux-next: build warning after merge of the amdgpu tree

2021-01-18 Thread Huang Rui
On Mon, Jan 18, 2021 at 02:52:18PM +0800, Stephen Rothwell wrote: > Hi Ray, > > On Mon, 18 Jan 2021 05:56:20 + "Huang, Ray" wrote: > > > > [AMD Public Use] > > > > Thanks Setphen. Please check attached V2 patch. > > (If you can share the config file to me, I can do the test in my side) > >

Re: linux-next: build failure after merge of the amdgpu tree

2021-01-14 Thread Huang Rui
On Fri, Jan 15, 2021 at 01:35:05PM +0800, Stephen Rothwell wrote: > Hi all, > > After merging the amdgpu tree, today's linux-next build (powerpc > allyesconfig) failed like this: > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: In function > 'vangogh_get_smu_metrics_data': > drive

Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 10:21:26AM +0800, Huang Rui wrote: > On Wed, Jan 13, 2021 at 10:13:02AM +0800, Alex Deucher wrote: > > On Tue, Jan 12, 2021 at 8:19 PM Huang Rui wrote: > > > > > > On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote: > > &

Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 10:13:02AM +0800, Alex Deucher wrote: > On Tue, Jan 12, 2021 at 8:19 PM Huang Rui wrote: > > > > On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote: > > > kernel test robot throws below warnings -> > > > > > >

Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote: > kernel test robot throws below warnings -> > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6: > warning: no previous prototype for 'vangogh_clk_dpm_is_enabled' > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdg

Re: 5.11-rc1 TTM list corruption

2021-01-05 Thread Huang Rui
On Tue, Jan 05, 2021 at 07:43:51PM +0800, Borislav Petkov wrote: > On Tue, Jan 05, 2021 at 07:08:52PM +0800, Huang Rui wrote: > > Ah, this asic is a bit old and still use radeon driver. So we didn't > > reproduce it on amdgpu driver. I don't have such the old asic in

Re: 5.11-rc1 TTM list corruption

2021-01-05 Thread Huang Rui
On Tue, Jan 05, 2021 at 06:31:38PM +0800, Borislav Petkov wrote: > Hi, > > On Tue, Jan 05, 2021 at 12:12:13PM +0800, Huang Rui wrote: > > I am reproducing this issue as well, are you using a Raven board? > > I have no clue what Raven is. The workstation I trig

Re: 5.11-rc1 TTM list corruption

2021-01-04 Thread Huang Rui
On Mon, Jan 04, 2021 at 06:58:02PM +0800, Borislav Petkov wrote: > On Fri, Jan 01, 2021 at 03:34:28PM +0100, Christian K?nig wrote: > > Going to double check the code, but can you reproduce this issue > > reliable? > > Lemme find a test box which can trigger it too - the splat happened > on my wor

Re: [PATCH] PCI: Mark AMD Raven iGPU ATS as broken

2020-11-23 Thread Huang Rui
orkaround > as narrow as possible. Yes, besides the comments from Alex and Felix, may we get your firmware version (SMC firmware which is from SBIOS) and device id? > >>>| [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, > >>> signaled seq=1, emitted seq=3

Re: [PATCH v2 -next] drm/amdkfd: Fix -Wunused-const-variable warning

2020-09-10 Thread Huang Rui
kfd_device_info raven_device_info = { > ^~~~~~~~~ > > As Huang Rui suggested, Raven already has the fallback path, > so it should be out of IOMMU v2 flag. > > Suggested-by: Huang Rui > Signed-off-by: YueHaibing Acked-by: Huang Rui

Re: [PATCH -next] drm/amdkfd: Fix -Wunused-const-variable warning

2020-09-10 Thread Huang Rui
On Thu, Sep 10, 2020 at 10:55:32AM +0800, YueHaibing wrote: > If KFD_SUPPORT_IOMMU_V2 is not set, gcc warns: > > drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device.c:121:37: warning: > ‘raven_device_info’ defined but not used [-Wunused-const-variable=] > static const struct kfd_device_info raven_de

Re: [PATCH] drm/amdgpu/powerplay: Fix missing break in switch statement

2019-03-03 Thread Huang Rui
; Fixes: 34a564eaf528 ("drm/amd/powerplay: implement fw image related smum > interface for Polaris.") > Cc: sta...@vger.kernel.org > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Huang Rui > --- > drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 + >

Re: radeon 0000:1d:00.0: GPU lockup (current fence id 0x00000000010da43f last fence id 0x00000000010da52d on ring 0)

2018-06-06 Thread Huang Rui
On Tue, Jun 05, 2018 at 04:44:04PM +0200, Borislav Petkov wrote: > Hi guys, > > X just froze here ontop of 4.17-rc7+ tip/master (kernel is from last > week) with the splat at the end. > > Box is a x470 chipset with Ryzen 2700X. > > GPU gets detected as > > [7.440971] [drm] radeon kernel mod

Re: [PATCH] drm/radeon: change function signature to pass full range

2018-04-13 Thread Huang Rui
always > false due to limited range of data type [-Wtype-limits] >if (num > ATOM_MAX_HW_I2C_READ) { >^ > > Signed-off-by: Mathieu Malaterre Reviewed-by: Huang Rui > --- > drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- > 1 file changed, 1 insertion(+

Re: [PATCH V2] drm/amdgpu: limit DMA size to PAGE_SIZE for scatter-gather buffers

2018-04-10 Thread Huang Rui
On Tue, Apr 10, 2018 at 04:59:55PM -0400, Sinan Kaya wrote: > Code is expecing to observe the same number of buffers returned from > dma_map_sg() function compared to sg_alloc_table_from_pages(). This > doesn't hold true universally especially for systems with IOMMU. > > IOMMU driver tries to comb

Re: perf/x86/amd/power missing pmu::module initialisation

2017-11-07 Thread Huang Rui
On Tue, Nov 07, 2017 at 08:50:52PM +0800, Huang Rui wrote: > Hi Mark, > > On Fri, Nov 03, 2017 at 11:33:56AM +, Mark Rutland wrote: > > Hi, > > > > As a heads-up, I believe that arch/x86/events/amd/power.c is currently > > missing initialisation of pmu::modul

Re: perf/x86/amd/power missing pmu::module initialisation

2017-11-07 Thread Huang Rui
Hi Mark, On Fri, Nov 03, 2017 at 11:33:56AM +, Mark Rutland wrote: > Hi, > > As a heads-up, I believe that arch/x86/events/amd/power.c is currently > missing initialisation of pmu::module, which could result in problems > when the module is unloaded. > > We've just spotted a similar problem

Re: [PATCH 65/66] hwmon: (fam15h_power) use permission-specific DEVICE_ATTR variants

2016-12-22 Thread Huang Rui
> x_show << ro.x_show; > @@ > > if not (x^"_show" = x_show) then Coccilib.include_match false > > @@ > declarer name DEVICE_ATTR_RO; > identifier ro.x,ro.x_show; > @@ > > - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); > + DEVICE_A

Re: [PATCH] drm/amd/powerplay/smumgr: mark symbols static where possible

2016-09-19 Thread Huang Rui
Hi Baoyou, On Mon, Sep 19, 2016 at 03:28:39PM +0800, Baoyou Xie wrote: > We get a few warnings when building kernel with W=1: > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:146:5: warning: > no previous prototype for 'tonga_program_jump_on_start' [-Wmissing-prototypes] > drivers/

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Huang Rui
are only used in the file in which they are > declared and don't need a declaration, but can be made static. > So this patch marks these functions with 'static'. > > Signed-off-by: Baoyou Xie Thanks. Acked-by: Huang Rui

Re: perf: fuzzer crashes immediately on AMD system

2016-08-22 Thread Huang Rui
Hi Peter, Vince On Fri, Aug 19, 2016 at 12:01:30PM +0200, Peter Zijlstra wrote: > On Thu, Aug 18, 2016 at 10:46:31AM -0400, Vince Weaver wrote: > > On Thu, 18 Aug 2016, Vince Weaver wrote: > > > > > Tried the perf_fuzzer on my A10 fam15h/model13h system with 4.8-rc2 and it > > > falls over more o

Re: [REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-07-19 Thread Huang Rui
On Tue, Jul 19, 2016 at 02:22:36PM -0400, Vince Weaver wrote: > On Fri, 17 Jun 2016, Huang Rui wrote: > > > On Thu, Jun 16, 2016 at 06:47:00PM +0200, Borislav Petkov wrote: > > > On Thu, Jun 16, 2016 at 01:38:14PM +0800, Huang Rui wrote: > > > > I was told t

Re: [patch] events/amd/power add support for fam16h model30h

2016-06-17 Thread Huang Rui
On Thu, Jun 16, 2016 at 11:12:18PM +0200, Borislav Petkov wrote: > On Thu, Jun 16, 2016 at 05:00:04PM -0400, Vince Weaver wrote: > > > > According to the BKDG the AMD Family16h Model30h "Jaguar Mullins" > > also supports the accumulated power interface. I've tested on > > hardware I have and with

Re: [REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-06-17 Thread Huang Rui
On Thu, Jun 16, 2016 at 04:44:20PM -0400, Vince Weaver wrote: > On Thu, 16 Jun 2016, Huang Rui wrote: > > > > 1. In theory this should also work on an amd fam16h model 30h > > > processor too, correct? The current code limits things to fam15h > > > ev

Re: [REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-06-17 Thread Huang Rui
On Thu, Jun 16, 2016 at 06:47:00PM +0200, Borislav Petkov wrote: > On Thu, Jun 16, 2016 at 01:38:14PM +0800, Huang Rui wrote: > > I was told this feature would be supported on fam15h 60h, 70h and > > later processors before. Just checked the fam16h model 30h BKDG, yes, > &

Re: [REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-06-15 Thread Huang Rui
Hi Vince, Thanks for asking. On Wed, Jun 15, 2016 at 09:13:59PM -0400, Vince Weaver wrote: > > three questions about this functionality: > > 1. In theory this should also work on an amd fam16h model 30h > processor too, correct? The current code limits things to fam15h > even though t

Re: [REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-06-15 Thread Huang Rui
On Thu, Jun 16, 2016 at 01:38:13PM +0800, Huang Rui wrote: > On Wed, Jun 15, 2016 at 09:13:59PM -0400, Vince Weaver wrote: > > > > 2. Unless I'm misunderstanding things, the code seems to be accumulating > > Power. (see chunk below) Power is an instantaneous meas

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-06 Thread Huang Rui
to Linus next week unless I get an objection. > Guenter, I already verified on AMD CZ(family 15h, model 60h) and model 70h processors. Acked-and-tested-by: Huang Rui

Re: [PATCH v6 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-04-06 Thread Huang Rui
On Wed, Apr 06, 2016 at 08:30:25AM -0700, Guenter Roeck wrote: > On Wed, Apr 06, 2016 at 03:44:11PM +0800, Huang Rui wrote: > > > > +static void do_read_registers_on_cu(void *_data) > > +{ > > + struct fam15h_power_data *data = _data; > > + int cpu, cu; >

[PATCH v6 3/6] hwmon: (fam15h_power) Add ptsc counter value for accumulated power

2016-04-06 Thread Huang Rui
PTSC is the performance timestamp counter value in a cpu core and the cores in one compute unit have the fixed frequency. So it picks up the performance timestamp counter value of the first core per compute unit to measure the interval for average power per compute unit. Signed-off-by: Huang Rui

[PATCH v6 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-04-06 Thread Huang Rui
. Suggested-by: Borislav Petkov Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 72 +++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 4f695d8..4edbaf0 100644 --- a

[PATCH v6 5/6] hwmon: (fam15h_power) Add documentation for TDP and accumulated power algorithm

2016-04-06 Thread Huang Rui
This patch adds the description to explain the TDP reporting mechanism and accumulated power algorithm. Signed-off-by: Huang Rui Cc: Borislav Petkov --- Documentation/hwmon/fam15h_power | 65 +++- drivers/hwmon/fam15h_power.c | 2 +- 2 files changed, 65

[PATCH v6 4/6] hwmon: (fam15h_power) Introduce a cpu accumulated power reporting algorithm

2016-04-06 Thread Huang Rui
processor power consumption in 10 millisecond. The unit of the result is uWatt. Suggested-by: Guenter Roeck Signed-off-by: Huang Rui Cc: Borislav Petkov --- drivers/hwmon/fam15h_power.c | 128 +-- 1 file changed, 124 insertions(+), 4 deletions(-) diff --git a

[PATCH v6 6/6] hwmon: (fam15h_power) Add platform check function

2016-04-06 Thread Huang Rui
This patch adds a platform check function to make code more readable. Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 7d9d697..eb97a92 100644

[PATCH v6 0/6] hwmon: (fam15h_power) Introduce an accumulated power reporting algorithm

2016-04-06 Thread Huang Rui
er1: 19.58 mW (avg = 2.55 mW, interval = 0.01 s) (crit = 15.00 W) ... These patches are rebased on v4.6-rc2. Thanks, Rui Huang Rui (6): hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence hwmon: (fam15h_power) Add compute unit accumulated power hwmon: (f

[PATCH v6 1/6] hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence

2016-04-06 Thread Huang Rui
nction `fam15h_power_probe': >> fam15h_power.c:(.text+0x26e3a3): undefined reference to >> `amd_get_cores_per_cu' fam15h_power.c:(.text+0x26e41e): undefined reference to `amd_get_cores_per_cu' Reported-by: build test robot Acked-by: Borislav Petkov Signed-off-by: Huang Rui --- dri

[tip:perf/core] perf/x86/msr: Add AMD PTSC (Performance Time-Stamp Counter) support

2016-03-31 Thread tip-bot for Huang Rui
Commit-ID: 8a22426184774d7ced9c1d3aa4d95d34101fb3be Gitweb: http://git.kernel.org/tip/8a22426184774d7ced9c1d3aa4d95d34101fb3be Author: Huang Rui AuthorDate: Fri, 29 Jan 2016 16:29:56 +0800 Committer: Ingo Molnar CommitDate: Thu, 31 Mar 2016 10:30:39 +0200 perf/x86/msr: Add AMD PTSC

[tip:perf/core] perf/x86/msr: Add AMD IRPERF (Instructions Retired) performance counter

2016-03-31 Thread tip-bot for Huang Rui
Commit-ID: aaf248848db503927644d28e239bc399ed45959f Gitweb: http://git.kernel.org/tip/aaf248848db503927644d28e239bc399ed45959f Author: Huang Rui AuthorDate: Fri, 29 Jan 2016 16:29:57 +0800 Committer: Ingo Molnar CommitDate: Thu, 31 Mar 2016 10:30:39 +0200 perf/x86/msr: Add AMD IRPERF

[tip:x86/urgent] x86/cpu: Add advanced power management bits

2016-03-29 Thread tip-bot for Huang Rui
Commit-ID: 34a4cceb78e48c75d1b48b25352a3f3b2cc2b2da Gitweb: http://git.kernel.org/tip/34a4cceb78e48c75d1b48b25352a3f3b2cc2b2da Author: Huang Rui AuthorDate: Fri, 25 Mar 2016 10:08:40 +0800 Committer: Thomas Gleixner CommitDate: Tue, 29 Mar 2016 11:12:11 +0200 x86/cpu: Add advanced

Re: [PATCH v5 4/6] hwmon: (fam15h_power) Introduce a cpu accumulated power reporting algorithm

2016-03-28 Thread Huang Rui
On Mon, Mar 28, 2016 at 11:33:27AM +0200, Borislav Petkov wrote: > On Mon, Mar 28, 2016 at 01:32:14PM +0800, Huang Rui wrote: > > > > return 0; > > @@ -330,6 +446,9 @@ static int fam15h_power_init_data(struct pci_dev *f4, > > > > data->max_cu_a

Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-28 Thread Huang Rui
On Mon, Mar 28, 2016 at 11:29:52AM +0200, Borislav Petkov wrote: > On Mon, Mar 28, 2016 at 01:32:12PM +0800, Huang Rui wrote: > > + > > + get_online_cpus(); > > + this_cpu = get_cpu(); > > What now? > > get_online_cpus() i

[PATCH v5 5/6] hwmon: (fam15h_power) Add documentation for TDP and accumulated power algorithm

2016-03-27 Thread Huang Rui
This patch adds the description to explain the TDP reporting mechanism and accumulated power algorithm. Signed-off-by: Huang Rui Cc: Borislav Petkov --- Documentation/hwmon/fam15h_power | 57 +++- drivers/hwmon/fam15h_power.c | 2 +- 2 files changed, 57

[PATCH v5 6/6] hwmon: (fam15h_power) Add platform check function

2016-03-27 Thread Huang Rui
This patch adds a platform check function to make code more readable. Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index c1cad26..622c646 100644

[PATCH v5 4/6] hwmon: (fam15h_power) Introduce a cpu accumulated power reporting algorithm

2016-03-27 Thread Huang Rui
processor power consumption in 10 millisecond. The unit of the result is uWatt. Suggested-by: Guenter Roeck Signed-off-by: Huang Rui Cc: Borislav Petkov --- drivers/hwmon/fam15h_power.c | 119 +++ 1 file changed, 119 insertions(+) diff --git a/drivers/hwmon

[PATCH v5 0/6] hwmon: (fam15h_power) Introduce an accumulated power reporting algorithm

2016-03-27 Thread Huang Rui
e: ray@hr-ub:~/tip$ sensors fam15h_power-pci-00c4 Adapter: PCI adapter power1: 19.58 mW (avg = 2.55 mW, interval = 0.01 s) (crit = 15.00 W) ... These patches are rebased on v4.6-rc1. Thanks, Rui Huang Rui (6): hwmon: (fam15h_power) Add CPU_SUP_AMD as the depen

[PATCH v5 1/6] hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence

2016-03-27 Thread Huang Rui
nction `fam15h_power_probe': >> fam15h_power.c:(.text+0x26e3a3): undefined reference to >> `amd_get_cores_per_cu' fam15h_power.c:(.text+0x26e41e): undefined reference to `amd_get_cores_per_cu' Reported-by: build test robot Signed-off-by: Huang Rui --- drivers/hwmon/Kconfig | 2 +-

[PATCH v5 3/6] hwmon: (fam15h_power) Add ptsc counter value for accumulated power

2016-03-27 Thread Huang Rui
PTSC is the performance timestamp counter value in a cpu core and the cores in one compute unit have the fixed frequency. So it picks up the performance timestamp counter value of the first core per compute unit to measure the interval for average power per compute unit. Signed-off-by: Huang Rui

[PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-27 Thread Huang Rui
. Suggested-by: Borislav Petkov Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 65 +++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 4f695d8..ccbc944 100644 --- a

[tip:perf/urgent] perf/x86: Move events_sysfs_show() outside CPU_SUP_INTEL

2016-03-25 Thread tip-bot for Huang Rui
Commit-ID: a49ac9f83b31e41c8311d64bd2b3f97a23dcb38d Gitweb: http://git.kernel.org/tip/a49ac9f83b31e41c8311d64bd2b3f97a23dcb38d Author: Huang Rui AuthorDate: Fri, 25 Mar 2016 11:18:25 +0800 Committer: Ingo Molnar CommitDate: Fri, 25 Mar 2016 09:46:53 +0100 perf/x86: Move

[REDO PATCH] x86/perf: Move events_sysfs_show() outside CPU_SUP_INTEL

2016-03-24 Thread Huang Rui
NT_ATTR_STR' EVENT_ATTR_STR(power-pkg, power_pkg, "event=0x01"); ^ Reported-by: Randy Dunlap Reported-by: build test robot Signed-off-by: Huang Rui Cc: Stephen Rothwell Cc: a...@kernel.org --- Hi Peter, Ingo, Randy, According to the comments of below thread, I rebased thi

Re: linux-next: Tree for Mar 24 (events/amd/power)

2016-03-24 Thread Huang Rui
On Thu, Mar 24, 2016 at 10:05:03AM -0700, Randy Dunlap wrote: > On 03/23/16 19:09, Stephen Rothwell wrote: > > Hi all, > > > > Please do not add any v4.7 related material to your linux-next included > > trees until after v4.6-rc1 is released. > > > > Changes since 20160323: > > > > on i386: >

[PATCH] x86/cpu: add some advanced power management bits

2016-03-24 Thread Huang Rui
Bit 11 of CPUID 8000_0007 edx is processor feedback interface. Bit 12 of CPUID 8000_0007 edx is accumulated power. So this patch fixes the output of cpuinfo, and add some new names to make it more meaningful. Reported-by: Borislav Petkov Signed-off-by: Huang Rui --- arch/x86/kernel/cpu

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-22 Thread Huang Rui
lstra (Intel) I tested this patch both on fam15h and fam16h platforms, x86_max_cores can report correct compute unit numbers. And /sys/devices/system/cpu/cpuX/topology/thread_siblings_list /sys/devices/system/cpu/cpuX/topology/core_siblings_list are also right. Thanks. Tested-by: Huang

Re: [PATCH 0/2] perf/x86/msr: Add some new AMD performance event counters

2016-03-21 Thread Huang Rui
On Fri, Jan 29, 2016 at 04:29:55PM +0800, Huang Rui wrote: > Hi all, > > This serials of patches add two event counters that are PTSC > (performance time-stamp counter) and IRperf (instructions retired > count) for AMD new processors. They are incicated by > CPUID.8000_0001H

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-21 Thread Huang Rui
On Mon, Mar 21, 2016 at 09:23:41AM +0100, Borislav Petkov wrote: > On Mon, Mar 21, 2016 at 11:07:46AM +0800, Huang Rui wrote: > > OK, we will find some fam15h, fam16h platforms to verify it. Please > > wait for my feedback. > > > > But I am confused with c->x86_max_c

[tip:perf/urgent] x86/cpufeature, perf/x86: Add AMD Accumulated Power Mechanism feature flag

2016-03-21 Thread tip-bot for Huang Rui
Commit-ID: 01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c Gitweb: http://git.kernel.org/tip/01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c Author: Huang Rui AuthorDate: Thu, 14 Jan 2016 10:50:06 +0800 Committer: Ingo Molnar CommitDate: Mon, 21 Mar 2016 09:35:29 +0100 x86/cpufeature, perf/x86: Add

[tip:perf/urgent] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-21 Thread tip-bot for Huang Rui
Commit-ID: c7ab62bfbe0e27ef452d19d88b083f01e99f13a7 Gitweb: http://git.kernel.org/tip/c7ab62bfbe0e27ef452d19d88b083f01e99f13a7 Author: Huang Rui AuthorDate: Wed, 9 Mar 2016 13:45:06 +0800 Committer: Ingo Molnar CommitDate: Mon, 21 Mar 2016 09:37:15 +0100 perf/x86/amd/power: Add AMD

[tip:perf/urgent] perf/x86/amd: Move nodes_per_socket into bsp_init_amd()

2016-03-21 Thread tip-bot for Huang Rui
Commit-ID: 8dfeae0d73bf803be1a533e147b3b0ea69375596 Gitweb: http://git.kernel.org/tip/8dfeae0d73bf803be1a533e147b3b0ea69375596 Author: Huang Rui AuthorDate: Thu, 14 Jan 2016 10:50:04 +0800 Committer: Ingo Molnar CommitDate: Mon, 21 Mar 2016 09:08:22 +0100 perf/x86/amd: Move

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-21 Thread Huang Rui
On Mon, Mar 21, 2016 at 09:21:29AM +0100, Peter Zijlstra wrote: > On Mon, Mar 21, 2016 at 11:07:46AM +0800, Huang Rui wrote: > > > > The issue is that Linux assumes: > > > > > > > > nr_logical_cpus = nr_cores * nr_siblings > > > > >

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-21 Thread Huang Rui
On Mon, Mar 21, 2016 at 09:26:43AM +0100, Borislav Petkov wrote: > On Mon, Mar 21, 2016 at 11:46:19AM +0800, Huang Rui wrote: > > I quickly applied this patch on tip/master with on a fam15h machine. > > The issue is still existed, only one core can be detected. > > Huh, wh

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-20 Thread Huang Rui
On Mon, Mar 21, 2016 at 11:07:44AM +0800, Huang Rui wrote: > On Fri, Mar 18, 2016 at 05:41:01PM +0100, Borislav Petkov wrote: > > On Fri, Mar 18, 2016 at 04:03:47PM +0100, Peter Zijlstra wrote: > > > It turns out AMD gets x86_max_cores wrong when there are compute > > &

Re: [PATCH 2/3] x86/topology: Fix AMD core count

2016-03-20 Thread Huang Rui
On Fri, Mar 18, 2016 at 05:41:01PM +0100, Borislav Petkov wrote: > On Fri, Mar 18, 2016 at 04:03:47PM +0100, Peter Zijlstra wrote: > > It turns out AMD gets x86_max_cores wrong when there are compute > > units. > > > > The issue is that Linux assumes: > > > > nr_logical_cpus = nr_cores * nr_s

Re: [PATCH v4 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-12 Thread Huang Rui
On Fri, Mar 11, 2016 at 07:33:55PM -0800, Guenter Roeck wrote: > On 03/10/2016 06:17 PM, Huang Rui wrote: > >This patch adds a member in fam15h_power_data which specifies the > >compute unit accumulated power. It adds do_read_registers_on_cu to do > >all the read to all MSRs

[PATCH v4 5/6] hwmon: (fam15h_power) Add documentation for TDP and accumulated power algorithm

2016-03-10 Thread Huang Rui
This patch adds the description to explain the TDP reporting mechanism and accumulated power algorithm. Signed-off-by: Huang Rui Cc: Borislav Petkov --- Documentation/hwmon/fam15h_power | 57 +++- drivers/hwmon/fam15h_power.c | 2 +- 2 files changed, 57

[PATCH v4 6/6] hwmon: (fam15h_power) Add platform check function

2016-03-10 Thread Huang Rui
This patch adds a platform check function to make code more readable. Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 35800cd..a0bea56 100644

[PATCH v4 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-10 Thread Huang Rui
. Suggested-by: Borislav Petkov Signed-off-by: Huang Rui --- drivers/hwmon/fam15h_power.c | 61 +++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 4f695d8..c5e2297 100644 --- a

[PATCH v4 4/6] hwmon: (fam15h_power) Introduce a cpu accumulated power reporting algorithm

2016-03-10 Thread Huang Rui
processor power consumption in 10 millisecond. The unit of the result is uWatt. Suggested-by: Guenter Roeck Signed-off-by: Huang Rui Cc: Borislav Petkov --- drivers/hwmon/fam15h_power.c | 115 +++ 1 file changed, 115 insertions(+) diff --git a/drivers/hwmon

[PATCH v4 3/6] hwmon: (fam15h_power) Add ptsc counter value for accumulated power

2016-03-10 Thread Huang Rui
PTSC is the performance timestamp counter value in a cpu core and the cores in one compute unit have the fixed frequency. So it picks up the performance timestamp counter value of the first core per compute unit to measure the interval for average power per compute unit. Signed-off-by: Huang Rui

[PATCH v4 1/6] hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence

2016-03-10 Thread Huang Rui
nction `fam15h_power_probe': >> fam15h_power.c:(.text+0x26e3a3): undefined reference to >> `amd_get_cores_per_cu' fam15h_power.c:(.text+0x26e41e): undefined reference to `amd_get_cores_per_cu' Reported-by: build test robot Signed-off-by: Huang Rui --- drivers/hwmon/Kconfig | 2 +-

[PATCH v4 0/6] hwmon: (fam15h_power) Introduce an accumulated power reporting algorithm

2016-03-10 Thread Huang Rui
power1: 19.58 mW (avg = 2.55 mW, interval = 0.01 s) (crit = 15.00 W) ... These patches are rebased on groeck/hwmon-next. Thanks, Rui Huang Rui (6): hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence hwmon: (fam15h_power) Add compute unit accumulated power hwmon

[REDO PATCH v7] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-08 Thread Huang Rui
5 seconds time elapsed Suggested-by: Peter Zijlstra Suggested-by: Ingo Molnar Suggested-by: Borislav Petkov Reviewed-by: Thomas Gleixner Signed-off-by: Huang Rui Cc: Guenter Roeck --- Hi Boris, I already redo this patch based on tip/master, it depends on some previous patches you applied before

[PATCH v7 0/2] perf/x86/power: Introduce AMD accumlated power reporting mechanism

2016-03-06 Thread Huang Rui
le CPU_DOWN_FAILED case. - Remove unnecessary tmp variable. - Re-write the initialization of for_each_online_cpu(cpu) loop. - Move __register_cpu_notifier after perf_pmu_register. Thanks, Rui Huang Rui (2): perf/x86: Export events_sysfs_show() perf/x86/amd/power: Add AMD accumulated power repor

[PATCH v7 1/2] perf/x86: Export events_sysfs_show()

2016-03-06 Thread Huang Rui
This interface will be used in modular perf drivers. Signed-off-by: Huang Rui --- arch/x86/kernel/cpu/perf_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 1b443db..47f673c 100644 --- a/arch/x86/kernel/cpu

[PATCH v7 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-06 Thread Huang Rui
5 seconds time elapsed Suggested-by: Peter Zijlstra Suggested-by: Ingo Molnar Suggested-by: Borislav Petkov Signed-off-by: Huang Rui Cc: Guenter Roeck --- arch/x86/Kconfig | 9 + arch/x86/kernel/cpu/Makefile | 1 + arch/

Re: [PATCH v6 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-03 Thread Huang Rui
On Thu, Mar 03, 2016 at 06:57:53PM +0100, Thomas Gleixner wrote: > On Fri, 4 Mar 2016, Huang Rui wrote: > > On Thu, Mar 03, 2016 at 04:26:46PM +0100, Thomas Gleixner wrote: > > > Why? You do a full for_each_online_cpu(i) loop after that, which does > > > ex

Re: [PATCH v6 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-03 Thread Huang Rui
On Thu, Mar 03, 2016 at 04:26:46PM +0100, Thomas Gleixner wrote: > On Thu, 3 Mar 2016, Huang Rui wrote: > > On Thu, Mar 03, 2016 at 09:50:11AM +0100, Thomas Gleixner wrote: > > > On Thu, 3 Mar 2016, Huang Rui wrote: > > > And of course if CPU_DOWN_PREPARE fails and

Re: [PATCH v6 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-03 Thread Huang Rui
On Thu, Mar 03, 2016 at 09:50:11AM +0100, Thomas Gleixner wrote: > On Thu, 3 Mar 2016, Huang Rui wrote: > > + > > +static void power_cpu_init(int cpu) > > +{ > > + /* > > +* 1) If any CPU is set at cpu_mask in the same compute unit, do > > +* not

[PATCH v6 1/2] perf/x86: Export events_sysfs_show()

2016-03-03 Thread Huang Rui
This interface will be used in modular perf drivers. Signed-off-by: Huang Rui --- arch/x86/kernel/cpu/perf_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 1b443db..47f673c 100644 --- a/arch/x86/kernel/cpu

[PATCH v6 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-03 Thread Huang Rui
5 seconds time elapsed Suggested-by: Peter Zijlstra Suggested-by: Ingo Molnar Suggested-by: Borislav Petkov Signed-off-by: Huang Rui Cc: Guenter Roeck --- Hi Thomas, Thanks to suggest the updates for power_cpu_init(), but there are some minor issues with below codes. target = cpumask_any_and(&a

[PATCH v6 0/2] perf/x86/power: Introduce AMD accumlated power reporting mechanism

2016-03-03 Thread Huang Rui
pu_exit - Use smp_num_siblings instead of cores_per_cu variable. - Make this driver as a module. - Add a patch to export events_sysfs_show. Thanks, Rui Huang Rui (2): perf/x86: Export events_sysfs_show() perf/x86/amd/power: Add AMD accumulated power reporting mechanism arch/x86/Kconfig

Re: [PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-03-01 Thread Huang Rui
On Tue, Mar 01, 2016 at 02:58:39PM +0100, Borislav Petkov wrote: > On Mon, Feb 29, 2016 at 12:30:47PM +0100, Thomas Gleixner wrote: > > On Tue, 1 Mar 2016, Huang Rui wrote: > > > On Fri, Feb 26, 2016 at 11:18:28AM +0100, Thomas Gleixner wrote: > > > > > +static i

Re: [PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-02-29 Thread Huang Rui
Hi Thomas, Thank you to your comments. :-) On Fri, Feb 26, 2016 at 11:18:28AM +0100, Thomas Gleixner wrote: > On Fri, 26 Feb 2016, Huang Rui wrote: > > > + > > +static DEFINE_PER_CPU(struct power_pmu_masks *, amd_power_pmu); > > This is complete overkill, re

Re: [PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-02-28 Thread Huang Rui
On Fri, Feb 26, 2016 at 11:29:52AM +0100, Borislav Petkov wrote: > On Fri, Feb 26, 2016 at 11:18:28AM +0100, Thomas Gleixner wrote: > > On Fri, 26 Feb 2016, Huang Rui wrote: > > > +/* Event code: LSB 8 bits, passed in attr->config any other bit is > > &g

[PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-02-26 Thread Huang Rui
5 seconds time elapsed Suggested-by: Peter Zijlstra Suggested-by: Ingo Molnar Suggested-by: Borislav Petkov Signed-off-by: Huang Rui Cc: Guenter Roeck --- Hi, This series of patches introduces the perf implementation of accumulated power reporting algorithm. It will calculate the average power con

[PATCH 2/2] perf/x86/msr: Add AMD instructions retired performance counter

2016-01-29 Thread Huang Rui
AMD Zeppelin (Family 17h, Model 00h) introduces an instructions retired performance counter which indicated by CPUID.8000_0008H:EBX[1]. And dedicated Instructions Retired register (MSR 0xC000_000E9) increments on once for every instruction retired. Signed-off-by: Huang Rui --- arch/x86/include

[PATCH 0/2] perf/x86/msr: Add some new AMD performance event counters

2016-01-29 Thread Huang Rui
Hi all, This serials of patches add two event counters that are PTSC (performance time-stamp counter) and IRperf (instructions retired count) for AMD new processors. They are incicated by CPUID.8000_0001H:ECX[27] and CPUID.8000_0008H:EBX[1] separately. Thanks, Rui Huang Rui (2): perf/x86/msr

[PATCH 1/2] perf/x86/msr: Add AMD performance time-stamp counter support

2016-01-29 Thread Huang Rui
an interface into MSR PMU to get the PTSC counter value. Signed-off-by: Huang Rui --- arch/x86/include/asm/cpufeature.h| 1 + arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/perf_event_msr.c | 8 3 files changed, 10 insertions(+) diff --git a/arch/x86/include/asm

Re: [PATCH v4] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-01-29 Thread Huang Rui
On Thu, Jan 28, 2016 at 04:28:48PM +0100, Peter Zijlstra wrote: > On Thu, Jan 28, 2016 at 10:03:15AM +0100, Borislav Petkov wrote: > > > + > > +struct power_pmu { > > + raw_spinlock_t lock; > > Now that the list is gone, what does this thing protect? > Protect the event count value b

Re: [PATCH v4] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-01-28 Thread Huang Rui
On Thu, Jan 28, 2016 at 10:03:15AM +0100, Borislav Petkov wrote: > On Thu, Jan 28, 2016 at 02:38:51PM +0800, Huang Rui wrote: > > Introduce an AMD accumlated power reporting mechanism for Carrizo > > (Family 15h, Model 60h) processor that should be used to calculate the > > a

[PATCH v4] perf/x86/amd/power: Add AMD accumulated power reporting mechanism

2016-01-27 Thread Huang Rui
el.org/r/20150831160622.ga29...@nazgul.tnic Suggested-by: Peter Zijlstra Suggested-by: Ingo Molnar Suggested-by: Borislav Petkov Signed-off-by: Huang Rui Cc: Guenter Roeck --- Hi, This series of patches introduces the perf implementation of accumulated power reporting algorithm. It will calc

  1   2   3   4   >