Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume Tucker
linux
Commits
c05cf5c3
Commit
c05cf5c3
authored
Mar 7, 2019
by
Guillaume Tucker
Browse files
Options
Downloads
Patches
Plain Diff
WIP potential fix from Mike Rapoport <rppt@linux.ibm.com>
parent
4f0b547b
Branches
beaglebone-black-next-20190304-debug
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mm/shuffle.c
+7
-3
7 additions, 3 deletions
mm/shuffle.c
with
7 additions
and
3 deletions
mm/shuffle.c
+
7
−
3
View file @
c05cf5c3
...
@@ -58,7 +58,8 @@ module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400);
...
@@ -58,7 +58,8 @@ module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400);
* For two pages to be swapped in the shuffle, they must be free (on a
* For two pages to be swapped in the shuffle, they must be free (on a
* 'free_area' lru), have the same order, and have the same migratetype.
* 'free_area' lru), have the same order, and have the same migratetype.
*/
*/
static
struct
page
*
__meminit
shuffle_valid_page
(
unsigned
long
pfn
,
int
order
)
static
struct
page
*
__meminit
shuffle_valid_page
(
unsigned
long
pfn
,
int
order
,
struct
zone
*
z
)
{
{
struct
page
*
page
;
struct
page
*
page
;
...
@@ -80,6 +81,9 @@ static struct page * __meminit shuffle_valid_page(unsigned long pfn, int order)
...
@@ -80,6 +81,9 @@ static struct page * __meminit shuffle_valid_page(unsigned long pfn, int order)
if
(
!
PageBuddy
(
page
))
if
(
!
PageBuddy
(
page
))
return
NULL
;
return
NULL
;
if
(
!
memmap_valid_within
(
pfn
,
page
,
z
))
return
NULL
;
/*
/*
* ...is the page on the same list as the page we will
* ...is the page on the same list as the page we will
* shuffle it with?
* shuffle it with?
...
@@ -123,7 +127,7 @@ void __meminit __shuffle_zone(struct zone *z)
...
@@ -123,7 +127,7 @@ void __meminit __shuffle_zone(struct zone *z)
* page_j randomly selected in the span @zone_start_pfn to
* page_j randomly selected in the span @zone_start_pfn to
* @spanned_pages.
* @spanned_pages.
*/
*/
page_i
=
shuffle_valid_page
(
i
,
order
);
page_i
=
shuffle_valid_page
(
i
,
order
,
z
);
if
(
!
page_i
)
if
(
!
page_i
)
continue
;
continue
;
...
@@ -137,7 +141,7 @@ void __meminit __shuffle_zone(struct zone *z)
...
@@ -137,7 +141,7 @@ void __meminit __shuffle_zone(struct zone *z)
j
=
z
->
zone_start_pfn
+
j
=
z
->
zone_start_pfn
+
ALIGN_DOWN
(
get_random_long
()
%
z
->
spanned_pages
,
ALIGN_DOWN
(
get_random_long
()
%
z
->
spanned_pages
,
order_pages
);
order_pages
);
page_j
=
shuffle_valid_page
(
j
,
order
);
page_j
=
shuffle_valid_page
(
j
,
order
,
z
);
if
(
page_j
&&
page_j
!=
page_i
)
if
(
page_j
&&
page_j
!=
page_i
)
break
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment