Re: [PATCH 3/4] s390/mm: Add __context_unsafe() attribute to gmap helper functions

[email protected] Mon, 03 Aug 2026 17:33:29 +0000
Newsgroups org.kernel.vger.linux-s390
Message-ID <[email protected]>
> Disable context analysis for various gmap helper functions to get rid
> of a few warnings:
>=20
> arch/s390/mm/gmap_helpers.c:80:1: warning: spinlock 'ptl' is not held on =
every path through here
> arch/s390/mm/gmap_helpers.c:116:2: warning: releasing spinlock 'ptl' that=
 was not held
> arch/s390/mm/gmap_helpers.c:186:2: warning: releasing spinlock 'ptl' that=
 was not held
>=20
> Use __context_unsafe() to give a short comment why for function context
> analysis is disabled.
>=20
> try_get_locked_pte() is disabled since it may return a nonull value
> regardless if it returns with a lock held or not.
>=20
> This cannot be reflected with the context analysis attributes. It is
> however possible to workaround this e.g. by adding a another `contended`
> function parameter, however this would lead to the next problem:
> pte_unmap_unlock() is a macro and therefore doesn't come with the
> required context analysis attribute to address this.
>=20
> For that reason also disable context analysis for
> gmap_helper_zap_one_page() and gmap_helper_try_set_pte_unused()
> until this has been addressed.
>=20
> Signed-off-by: Heiko Carstens <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260803172144.8270=
[email protected]?part=3D3