s390/cpum_sf: Simplify release of SDBs and SDBTs
authorThomas Richter <tmricht@linux.ibm.com>
Tue, 19 Nov 2024 12:22:47 +0000 (13:22 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 21 Nov 2024 11:44:07 +0000 (12:44 +0100)
commit7bc1ee28f4d21fc1e2f3d09534baf86ce7f3ba5e
tree4e048fa20b2b5dab5d7a8d2d9fe44a7a425d6b37
parent9c7260b527f0f7c75a9c0fee297663d1acc40937
s390/cpum_sf: Simplify release of SDBs and SDBTs

Free_sampling_buffer() releases the Sampling Data Buffers (SDBs)
and Sampling Data Buffer Table (SDBTs) allocated at event
initialization. Both buffers are of PAGE_SIZE bytes. Each SDBT
consists of 512 entries. The first 511 entries point to SDBs
the last entry points to a successor SDBT. The last SDBT in
the list points to the origin of all SDBTs. SDBTs do not
contain holes, that is an entry always points to a SDB.
If less than 511 SDBs have been allocation, the last entry
points to the origin SDBT.

Simplify the release of the SDBs and SDBTs, walk along the
SDBT chain, release SDBs and SDBTs and stop when reaching
the origin again.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/perf_cpum_sf.c