diff options
author | Gerald Schaefer <gerald.schaefer@linux.ibm.com> | 2025-07-29 13:16:19 +0200 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2025-07-31 18:59:26 +0200 |
commit | 10dd5a0009898ba35eafeb6087e5c83b84742ff1 (patch) | |
tree | 4e2abb67325def3ea7edddcddc7bb088fad74522 /rust/helpers | |
parent | ccb0aa03d046ff84492396d2e90b408fa5b24a00 (diff) |
s390/mm: Enable THP_SWAP and THP_MIGRATION
After hugetlbfs PTE_MARKER support for s390 introduced region-third and
segment table swap entries, it is now possible to also enable THP_SWAP
and THP_MIGRATION for s390.
s390 has different layout for PTE and region / segment table entries
(RSTE). This is also true for swap entries, and their swap type and offset
encoding. For hugetlbfs PTE_MARKER support, s390 has internal
__swp_type_rste() and __swp_offset_rste() helpers to correctly handle RSTE
swap entries.
But common swap code does not know about this difference, and only uses
__swp_type(), __swp_offset() and __swp_entry() helpers for conversion
between arch-dependent and arch-independent representation of swp_entry_t
for all pagetable levels. On s390, those helpers only work for PTE swap
entries.
Therefore, implement __pmd_to_swp_entry() to build a fake PTE swap entry
and return the arch-dependent representation of that. Correspondingly,
implement __swp_entry_to_pmd() to convert that into a proper PMD swap
entry again. With this, the arch-dependent swp_entry_t representation will
always look like a PTE swap entry in common code.
This is somewhat similar to fake PTEs in hugetlbfs code for s390, but only
requires conversion of the swap type and offset, and not all the possible
PTE bits.
For PMD swap entry SOFT_DIRTY handling, use the same helpers as for normal
PMDs. Similar to PTEs, the SOFT_DIRTY bit location is the same for swap
and normal entries.
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions