* [PATCH V2 06/15] s390/perf: Remove driver-specific throttle support
[not found] <20250514151401.2547932-1-kan.liang@linux.intel.com>
@ 2025-05-14 15:13 ` kan.liang
2025-05-15 13:15 ` Thomas Richter
0 siblings, 1 reply; 3+ messages in thread
From: kan.liang @ 2025-05-14 15:13 UTC (permalink / raw)
To: peterz, mingo, namhyung, irogers, mark.rutland, linux-kernel,
linux-perf-users
Cc: eranian, ctshao, tmricht, Kan Liang, linux-s390
From: Kan Liang <kan.liang@linux.intel.com>
The throttle support has been added in the generic code. Remove
the driver-specific throttle support.
Besides the throttle, perf_event_overflow may return true because of
event_limit. It already does an inatomic event disable. The pmu->stop
is not required either.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
---
arch/s390/kernel/perf_cpum_cf.c | 2 --
arch/s390/kernel/perf_cpum_sf.c | 5 +----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index e657fad7e376..6a262e198e35 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -980,8 +980,6 @@ static int cfdiag_push_sample(struct perf_event *event,
}
overflow = perf_event_overflow(event, &data, ®s);
- if (overflow)
- event->pmu->stop(event, 0);
perf_event_update_userpage(event);
return overflow;
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index ad22799d8a7d..91469401f2c9 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -1072,10 +1072,7 @@ static int perf_push_sample(struct perf_event *event,
overflow = 0;
if (perf_event_exclude(event, ®s, sde_regs))
goto out;
- if (perf_event_overflow(event, &data, ®s)) {
- overflow = 1;
- event->pmu->stop(event, 0);
- }
+ overflow = perf_event_overflow(event, &data, ®s);
perf_event_update_userpage(event);
out:
return overflow;
--
2.38.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH V2 06/15] s390/perf: Remove driver-specific throttle support
2025-05-14 15:13 ` [PATCH V2 06/15] s390/perf: Remove driver-specific throttle support kan.liang
@ 2025-05-15 13:15 ` Thomas Richter
2025-05-15 13:56 ` Liang, Kan
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Richter @ 2025-05-15 13:15 UTC (permalink / raw)
To: kan.liang, peterz, mingo, namhyung, irogers, mark.rutland,
linux-kernel, linux-perf-users
Cc: eranian, ctshao, linux-s390
On 5/14/25 17:13, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> The throttle support has been added in the generic code. Remove
> the driver-specific throttle support.
>
> Besides the throttle, perf_event_overflow may return true because of
> event_limit. It already does an inatomic event disable. The pmu->stop
> is not required either.
>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Cc: Thomas Richter <tmricht@linux.ibm.com>
> Cc: linux-s390@vger.kernel.org
> ---
> arch/s390/kernel/perf_cpum_cf.c | 2 --
> arch/s390/kernel/perf_cpum_sf.c | 5 +----
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
> index e657fad7e376..6a262e198e35 100644
> --- a/arch/s390/kernel/perf_cpum_cf.c
> +++ b/arch/s390/kernel/perf_cpum_cf.c
> @@ -980,8 +980,6 @@ static int cfdiag_push_sample(struct perf_event *event,
> }
>
> overflow = perf_event_overflow(event, &data, ®s);
> - if (overflow)
> - event->pmu->stop(event, 0);
>
> perf_event_update_userpage(event);
> return overflow;
> diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
> index ad22799d8a7d..91469401f2c9 100644
> --- a/arch/s390/kernel/perf_cpum_sf.c
> +++ b/arch/s390/kernel/perf_cpum_sf.c
> @@ -1072,10 +1072,7 @@ static int perf_push_sample(struct perf_event *event,
> overflow = 0;
> if (perf_event_exclude(event, ®s, sde_regs))
> goto out;
> - if (perf_event_overflow(event, &data, ®s)) {
> - overflow = 1;
> - event->pmu->stop(event, 0);
> - }
> + overflow = perf_event_overflow(event, &data, ®s);
> perf_event_update_userpage(event);
> out:
> return overflow;
I have installed patch 1 and 6 on top of the linux-next kernel today.
The results look good, much better than before, but I still do not
get both counter values in sync on each iteration all the time.
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V2 06/15] s390/perf: Remove driver-specific throttle support
2025-05-15 13:15 ` Thomas Richter
@ 2025-05-15 13:56 ` Liang, Kan
0 siblings, 0 replies; 3+ messages in thread
From: Liang, Kan @ 2025-05-15 13:56 UTC (permalink / raw)
To: Thomas Richter, peterz, mingo, namhyung, irogers, mark.rutland,
linux-kernel, linux-perf-users
Cc: eranian, ctshao, linux-s390
On 2025-05-15 9:15 a.m., Thomas Richter wrote:
> On 5/14/25 17:13, kan.liang@linux.intel.com wrote:
>> From: Kan Liang <kan.liang@linux.intel.com>
>>
>> The throttle support has been added in the generic code. Remove
>> the driver-specific throttle support.
>>
>> Besides the throttle, perf_event_overflow may return true because of
>> event_limit. It already does an inatomic event disable. The pmu->stop
>> is not required either.
>>
>> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
>> Cc: Thomas Richter <tmricht@linux.ibm.com>
>> Cc: linux-s390@vger.kernel.org
>> ---
>> arch/s390/kernel/perf_cpum_cf.c | 2 --
>> arch/s390/kernel/perf_cpum_sf.c | 5 +----
>> 2 files changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
>> index e657fad7e376..6a262e198e35 100644
>> --- a/arch/s390/kernel/perf_cpum_cf.c
>> +++ b/arch/s390/kernel/perf_cpum_cf.c
>> @@ -980,8 +980,6 @@ static int cfdiag_push_sample(struct perf_event *event,
>> }
>>
>> overflow = perf_event_overflow(event, &data, ®s);
>> - if (overflow)
>> - event->pmu->stop(event, 0);
>>
>> perf_event_update_userpage(event);
>> return overflow;
>> diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
>> index ad22799d8a7d..91469401f2c9 100644
>> --- a/arch/s390/kernel/perf_cpum_sf.c
>> +++ b/arch/s390/kernel/perf_cpum_sf.c
>> @@ -1072,10 +1072,7 @@ static int perf_push_sample(struct perf_event *event,
>> overflow = 0;
>> if (perf_event_exclude(event, ®s, sde_regs))
>> goto out;
>> - if (perf_event_overflow(event, &data, ®s)) {
>> - overflow = 1;
>> - event->pmu->stop(event, 0);
>> - }
>> + overflow = perf_event_overflow(event, &data, ®s);
>> perf_event_update_userpage(event);
>> out:
>> return overflow;
>
> I have installed patch 1 and 6 on top of the linux-next kernel today.
> The results look good, much better than before, but I still do not
> get both counter values in sync on each iteration all the time.
>
For Intel platforms, there is a global control register which can
disable/enable all counters simultaneously. It's invoked in the
pmu_enable/disable pair. It guarantees that the group start/stop/read in
sync.
If there is no such synchronize mechanism in the hardware, the events in
a group usually start/stop one by one. There may be a small gap between
each event.
I'm not familiar with the s390. I guess it may be the cause that you
didn't get both counter values in sync.
Without hardware's help, the patch set cannot completely fix the gap
between counters, but should be able to minimize it.
> Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Thanks!Kan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-15 13:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250514151401.2547932-1-kan.liang@linux.intel.com>
2025-05-14 15:13 ` [PATCH V2 06/15] s390/perf: Remove driver-specific throttle support kan.liang
2025-05-15 13:15 ` Thomas Richter
2025-05-15 13:56 ` Liang, Kan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox