-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helper functions for for_each_online_pgdat/for_each_zone look too big to be inlined. Speed of these helper macro itself is not very important. (inner loops are tend to do more work than this) This patch make helper function to be out-of-lined. inline out-of-line .text 005c0680 005bf6a0 005c0680 - 005bf6a0 = FE0 = 4Kbytes. Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* linux/mm/mmzone.c | ||
* | ||
* management codes for pgdats and zones. | ||
*/ | ||
|
||
|
||
#include <linux/config.h> | ||
#include <linux/stddef.h> | ||
#include <linux/mmzone.h> | ||
#include <linux/module.h> | ||
|
||
struct pglist_data *first_online_pgdat(void) | ||
{ | ||
return NODE_DATA(first_online_node); | ||
} | ||
|
||
EXPORT_SYMBOL(first_online_pgdat); | ||
|
||
struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) | ||
{ | ||
int nid = next_online_node(pgdat->node_id); | ||
|
||
if (nid == MAX_NUMNODES) | ||
return NULL; | ||
return NODE_DATA(nid); | ||
} | ||
EXPORT_SYMBOL(next_online_pgdat); | ||
|
||
|
||
/* | ||
* next_zone - helper magic for for_each_zone() | ||
*/ | ||
struct zone *next_zone(struct zone *zone) | ||
{ | ||
pg_data_t *pgdat = zone->zone_pgdat; | ||
|
||
if (zone < pgdat->node_zones + MAX_NR_ZONES - 1) | ||
zone++; | ||
else { | ||
pgdat = next_online_pgdat(pgdat); | ||
if (pgdat) | ||
zone = pgdat->node_zones; | ||
else | ||
zone = NULL; | ||
} | ||
return zone; | ||
} | ||
EXPORT_SYMBOL(next_zone); | ||
|