Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c41bb9c4
Commit
c41bb9c4
authored
Apr 11, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Apr 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] stop using page->list in the hugetlbpage implementations
Switch them over to page.lru
parent
62e52945
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
31 deletions
+29
-31
arch/i386/mm/hugetlbpage.c
arch/i386/mm/hugetlbpage.c
+7
-7
arch/ia64/mm/hugetlbpage.c
arch/ia64/mm/hugetlbpage.c
+7
-7
arch/ppc64/mm/hugetlbpage.c
arch/ppc64/mm/hugetlbpage.c
+4
-4
arch/sh/mm/hugetlbpage.c
arch/sh/mm/hugetlbpage.c
+4
-6
arch/sparc64/mm/hugetlbpage.c
arch/sparc64/mm/hugetlbpage.c
+7
-7
No files found.
arch/i386/mm/hugetlbpage.c
View file @
c41bb9c4
...
...
@@ -29,7 +29,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
{
list_add
(
&
page
->
l
ist
,
list_add
(
&
page
->
l
ru
,
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
...
...
@@ -44,8 +44,8 @@ static struct page *dequeue_huge_page(void)
break
;
}
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
list_del
(
&
page
->
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ru
);
}
return
page
;
}
...
...
@@ -280,7 +280,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
...
...
@@ -409,19 +409,19 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
map
=
NULL
;
if
(
++
count
==
0
)
break
;
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
map
=
page
;
}
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
count
++
;
...
...
arch/ia64/mm/hugetlbpage.c
View file @
c41bb9c4
...
...
@@ -32,7 +32,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
{
list_add
(
&
page
->
l
ist
,
list_add
(
&
page
->
l
ru
,
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
...
...
@@ -48,8 +48,8 @@ static struct page *dequeue_huge_page(void)
}
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
list_del
(
&
page
->
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ru
);
}
return
page
;
}
...
...
@@ -248,7 +248,7 @@ void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
...
...
@@ -449,19 +449,19 @@ int try_to_free_low(int count)
spin_lock
(
&
htlbpage_lock
);
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
map
=
NULL
;
if
(
++
count
==
0
)
break
;
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
map
=
page
;
}
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
count
++
;
...
...
arch/ppc64/mm/hugetlbpage.c
View file @
c41bb9c4
...
...
@@ -40,7 +40,7 @@ static struct list_head hugepage_freelists[MAX_NUMNODES];
static
void
enqueue_huge_page
(
struct
page
*
page
)
{
list_add
(
&
page
->
l
ist
,
list_add
(
&
page
->
l
ru
,
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
...
...
@@ -63,8 +63,8 @@ static struct page *dequeue_huge_page(void)
}
if
(
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
list_del
(
&
page
->
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ru
);
}
if
(
largepage_roundrobin
)
...
...
@@ -452,7 +452,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
...
...
arch/sh/mm/hugetlbpage.c
View file @
c41bb9c4
...
...
@@ -33,7 +33,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
{
list_add
(
&
page
->
l
ist
,
list_add
(
&
page
->
l
ru
,
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
...
...
@@ -51,7 +51,7 @@ static struct page *dequeue_huge_page(void)
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
list
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
return
page
;
}
...
...
@@ -254,8 +254,6 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
list
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
htlbpagemem
++
;
...
...
@@ -388,7 +386,7 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
map
=
NULL
;
...
...
@@ -400,7 +398,7 @@ static int try_to_free_low(int count)
map
=
page
;
}
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
count
++
;
...
...
arch/sparc64/mm/hugetlbpage.c
View file @
c41bb9c4
...
...
@@ -29,7 +29,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
{
list_add
(
&
page
->
l
ist
,
list_add
(
&
page
->
l
ru
,
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
...
...
@@ -46,8 +46,8 @@ static struct page *dequeue_huge_page(void)
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
list_del
(
&
page
->
l
ist
);
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ru
);
}
return
page
;
}
...
...
@@ -250,7 +250,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
...
...
@@ -384,19 +384,19 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
map
=
NULL
;
if
(
++
count
==
0
)
break
;
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
map
=
page
;
}
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
htlbpagemem
--
;
count
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment