diff options
author | Thomas Richter <tmricht@linux.ibm.com> | 2023-10-11 12:09:30 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-10-25 15:08:29 +0200 |
commit | b286997e83dcf7b498329a66a8a22fc8a5bf50f0 (patch) | |
tree | eae547c74551b0b81d4166f2011bfa8c5fac44cd /arch/s390 | |
parent | s390/pai_crypto: use PERF_ATTACH_TASK define for per task detection (diff) | |
download | linux-b286997e83dcf7b498329a66a8a22fc8a5bf50f0.tar.xz linux-b286997e83dcf7b498329a66a8a22fc8a5bf50f0.zip |
s390/pai: initialize event count once at initialization
Event count value is initialized and set to zero in function
paicrypt_start(). This function is called once per CPU when an
event is started on that CPU. This leads to event count value
being set to zero as many times as there are online CPUs.
This is not necessary. The event count value is bound to the event
and it is sufficient to initialize the event counter once at
event creation time. This is done when the event structure
is dynamicly allocated with __GFP_ZERO flag. This sets
member count to zero.
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/perf_pai_crypto.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/perf_pai_ext.c | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c index 85d7398ac279..35940234da75 100644 --- a/arch/s390/kernel/perf_pai_crypto.c +++ b/arch/s390/kernel/perf_pai_crypto.c @@ -322,7 +322,6 @@ static void paicrypt_start(struct perf_event *event, int flags) if (!event->hw.last_tag) { event->hw.last_tag = 1; sum = paicrypt_getall(event); /* Get current value */ - local64_set(&event->count, 0); local64_set(&event->hw.prev_count, sum); } } diff --git a/arch/s390/kernel/perf_pai_ext.c b/arch/s390/kernel/perf_pai_ext.c index edceff2143b9..8ba0f1a3a39d 100644 --- a/arch/s390/kernel/perf_pai_ext.c +++ b/arch/s390/kernel/perf_pai_ext.c @@ -326,7 +326,6 @@ static void paiext_start(struct perf_event *event, int flags) event->hw.last_tag = 1; sum = paiext_getall(event); /* Get current value */ local64_set(&event->hw.prev_count, sum); - local64_set(&event->count, 0); } static int paiext_add(struct perf_event *event, int flags) |