Skip to content

Commit b286997

Browse files
Thomas RichterVasily Gorbik
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Richter <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent a13e8bd commit b286997

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ static void paicrypt_start(struct perf_event *event, int flags)
322322
if (!event->hw.last_tag) {
323323
event->hw.last_tag = 1;
324324
sum = paicrypt_getall(event); /* Get current value */
325-
local64_set(&event->count, 0);
326325
local64_set(&event->hw.prev_count, sum);
327326
}
328327
}

arch/s390/kernel/perf_pai_ext.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ static void paiext_start(struct perf_event *event, int flags)
326326
event->hw.last_tag = 1;
327327
sum = paiext_getall(event); /* Get current value */
328328
local64_set(&event->hw.prev_count, sum);
329-
local64_set(&event->count, 0);
330329
}
331330

332331
static int paiext_add(struct perf_event *event, int flags)

0 commit comments

Comments
 (0)