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
nexedi
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
Show 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;
...
@@ -29,7 +29,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
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
]);
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
}
...
@@ -44,8 +44,8 @@ static struct page *dequeue_huge_page(void)
...
@@ -44,8 +44,8 @@ static struct page *dequeue_huge_page(void)
break
;
break
;
}
}
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
}
return
page
;
return
page
;
}
}
...
@@ -280,7 +280,7 @@ static void free_huge_page(struct page *page)
...
@@ -280,7 +280,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
enqueue_huge_page
(
page
);
...
@@ -409,19 +409,19 @@ static int try_to_free_low(int count)
...
@@ -409,19 +409,19 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
map
=
NULL
;
map
=
NULL
;
if
(
++
count
==
0
)
if
(
++
count
==
0
)
break
;
break
;
}
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
if
(
!
PageHighMem
(
page
))
map
=
page
;
map
=
page
;
}
}
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
count
++
;
count
++
;
...
...
arch/ia64/mm/hugetlbpage.c
View file @
c41bb9c4
...
@@ -32,7 +32,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
...
@@ -32,7 +32,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
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
]);
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
}
...
@@ -48,8 +48,8 @@ static struct page *dequeue_huge_page(void)
...
@@ -48,8 +48,8 @@ static struct page *dequeue_huge_page(void)
}
}
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
}
return
page
;
return
page
;
}
}
...
@@ -248,7 +248,7 @@ void free_huge_page(struct page *page)
...
@@ -248,7 +248,7 @@ void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
enqueue_huge_page
(
page
);
...
@@ -449,19 +449,19 @@ int try_to_free_low(int count)
...
@@ -449,19 +449,19 @@ int try_to_free_low(int count)
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
map
=
NULL
;
map
=
NULL
;
if
(
++
count
==
0
)
if
(
++
count
==
0
)
break
;
break
;
}
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
if
(
!
PageHighMem
(
page
))
map
=
page
;
map
=
page
;
}
}
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
count
++
;
count
++
;
...
...
arch/ppc64/mm/hugetlbpage.c
View file @
c41bb9c4
...
@@ -40,7 +40,7 @@ static struct list_head hugepage_freelists[MAX_NUMNODES];
...
@@ -40,7 +40,7 @@ static struct list_head hugepage_freelists[MAX_NUMNODES];
static
void
enqueue_huge_page
(
struct
page
*
page
)
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
]);
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
}
...
@@ -63,8 +63,8 @@ static struct page *dequeue_huge_page(void)
...
@@ -63,8 +63,8 @@ static struct page *dequeue_huge_page(void)
}
}
if
(
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
if
(
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
}
if
(
largepage_roundrobin
)
if
(
largepage_roundrobin
)
...
@@ -452,7 +452,7 @@ static void free_huge_page(struct page *page)
...
@@ -452,7 +452,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
enqueue_huge_page
(
page
);
...
...
arch/sh/mm/hugetlbpage.c
View file @
c41bb9c4
...
@@ -33,7 +33,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
...
@@ -33,7 +33,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
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
]);
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
}
...
@@ -51,7 +51,7 @@ static struct page *dequeue_huge_page(void)
...
@@ -51,7 +51,7 @@ static struct page *dequeue_huge_page(void)
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
list
);
struct
page
,
list
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
}
return
page
;
return
page
;
}
}
...
@@ -254,8 +254,6 @@ static void free_huge_page(struct page *page)
...
@@ -254,8 +254,6 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
list
);
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
enqueue_huge_page
(
page
);
htlbpagemem
++
;
htlbpagemem
++
;
...
@@ -388,7 +386,7 @@ static int try_to_free_low(int count)
...
@@ -388,7 +386,7 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
map
=
NULL
;
map
=
NULL
;
...
@@ -400,7 +398,7 @@ static int try_to_free_low(int count)
...
@@ -400,7 +398,7 @@ static int try_to_free_low(int count)
map
=
page
;
map
=
page
;
}
}
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
count
++
;
count
++
;
...
...
arch/sparc64/mm/hugetlbpage.c
View file @
c41bb9c4
...
@@ -29,7 +29,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
...
@@ -29,7 +29,7 @@ static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
static
void
enqueue_huge_page
(
struct
page
*
page
)
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
]);
&
hugepage_freelists
[
page_zone
(
page
)
->
zone_pgdat
->
node_id
]);
}
}
...
@@ -46,8 +46,8 @@ static struct page *dequeue_huge_page(void)
...
@@ -46,8 +46,8 @@ static struct page *dequeue_huge_page(void)
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
if
(
nid
>=
0
&&
nid
<
MAX_NUMNODES
&&
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
!
list_empty
(
&
hugepage_freelists
[
nid
]))
{
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
page
=
list_entry
(
hugepage_freelists
[
nid
].
next
,
struct
page
,
l
ist
);
struct
page
,
l
ru
);
list_del
(
&
page
->
l
ist
);
list_del
(
&
page
->
l
ru
);
}
}
return
page
;
return
page
;
}
}
...
@@ -250,7 +250,7 @@ static void free_huge_page(struct page *page)
...
@@ -250,7 +250,7 @@ static void free_huge_page(struct page *page)
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page_count
(
page
));
BUG_ON
(
page
->
mapping
);
BUG_ON
(
page
->
mapping
);
INIT_LIST_HEAD
(
&
page
->
l
ist
);
INIT_LIST_HEAD
(
&
page
->
l
ru
);
spin_lock
(
&
htlbpage_lock
);
spin_lock
(
&
htlbpage_lock
);
enqueue_huge_page
(
page
);
enqueue_huge_page
(
page
);
...
@@ -384,19 +384,19 @@ static int try_to_free_low(int count)
...
@@ -384,19 +384,19 @@ static int try_to_free_low(int count)
/* all lowmem is on node 0 */
/* all lowmem is on node 0 */
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
list_for_each
(
p
,
&
hugepage_freelists
[
0
])
{
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
map
=
NULL
;
map
=
NULL
;
if
(
++
count
==
0
)
if
(
++
count
==
0
)
break
;
break
;
}
}
page
=
list_entry
(
p
,
struct
page
,
l
ist
);
page
=
list_entry
(
p
,
struct
page
,
l
ru
);
if
(
!
PageHighMem
(
page
))
if
(
!
PageHighMem
(
page
))
map
=
page
;
map
=
page
;
}
}
if
(
map
)
{
if
(
map
)
{
list_del
(
&
map
->
l
ist
);
list_del
(
&
map
->
l
ru
);
update_and_free_page
(
map
);
update_and_free_page
(
map
);
htlbpagemem
--
;
htlbpagemem
--
;
count
++
;
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