Skip to content

Commit

Permalink
selftests/mm: add platform independent in code comments
Browse files Browse the repository at this point in the history
The in code comments for the selftest were made on the basis of 128TB
switch, an architecture feature specific to PowerPc and x86 platforms. 
Keeping in mind the support added for arm64 platforms which implements a
256TB switch, a more generic explanation has been provided.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Chaitanya S Prakash <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Mark Rutland <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Chaitanya S Prakash authored and akpm00 committed Apr 18, 2023
1 parent bbe1687 commit c2af2a4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/testing/selftests/mm/va_high_addr_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#endif

/*
* >= 128TB is the hint addr value we used to select
* large address space.
* The hint addr value is used to allocate addresses
* beyond the high address switch boundary.
*/

#define ADDR_MARK_128TB (1UL << 47)
Expand Down Expand Up @@ -73,9 +73,10 @@ static struct testcase testcases[] = {
},
{
/*
* We should never allocate at the requested address or above it
* The len cross the 128TB boundary. Without MAP_FIXED
* we will always search in the lower address space.
* Unless MAP_FIXED is specified, allocation based on hint
* addr is never at requested address or above it, which is
* beyond high address switch boundary in this case. Instead,
* a suitable allocation is found in lower address space.
*/
.addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
.size = 2 * PAGE_SIZE,
Expand All @@ -85,8 +86,8 @@ static struct testcase testcases[] = {
},
{
/*
* Exact mapping at 128TB, the area is free we should get that
* even without MAP_FIXED.
* Exact mapping at high address switch boundary, should
* be obtained even without MAP_FIXED as area is free.
*/
.addr = ((void *)(ADDR_SWITCH_HINT)),
.size = PAGE_SIZE,
Expand Down

0 comments on commit c2af2a4

Please sign in to comment.