Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338722
b: refs/heads/master
c: e5adfff
h: refs/heads/master
v: v3
  • Loading branch information
Kirill A. Shutemov authored and Linus Torvalds committed Dec 12, 2012
1 parent b1c6f81 commit 20e3d6d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19965460e31c73a934d2c19c152f876a75bdff3e
refs/heads/master: e5adfffc857788c8b7eca0e98cf1e26f1964b292
2 changes: 1 addition & 1 deletion trunk/include/linux/gfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)

static inline int gfp_zonelist(gfp_t flags)
{
if (NUMA_BUILD && unlikely(flags & __GFP_THISNODE))
if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
return 1;

return 0;
Expand Down
7 changes: 0 additions & 7 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,13 +687,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
/* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__)

/* This helps us to avoid #ifdef CONFIG_NUMA */
#ifdef CONFIG_NUMA
#define NUMA_BUILD 1
#else
#define NUMA_BUILD 0
#endif

/* This helps us avoid #ifdef CONFIG_COMPACTION */
#ifdef CONFIG_COMPACTION
#define COMPACTION_BUILD 1
Expand Down
18 changes: 10 additions & 8 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
*/
for_each_zone_zonelist_nodemask(zone, z, zonelist,
high_zoneidx, nodemask) {
if (NUMA_BUILD && zlc_active &&
if (IS_ENABLED(CONFIG_NUMA) && zlc_active &&
!zlc_zone_worth_trying(zonelist, z, allowednodes))
continue;
if ((alloc_flags & ALLOC_CPUSET) &&
Expand Down Expand Up @@ -1917,7 +1917,8 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
classzone_idx, alloc_flags))
goto try_this_zone;

if (NUMA_BUILD && !did_zlc_setup && nr_online_nodes > 1) {
if (IS_ENABLED(CONFIG_NUMA) &&
!did_zlc_setup && nr_online_nodes > 1) {
/*
* we do zlc_setup if there are multiple nodes
* and before considering the first zone allowed
Expand All @@ -1936,7 +1937,7 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
* As we may have just activated ZLC, check if the first
* eligible zone has failed zone_reclaim recently.
*/
if (NUMA_BUILD && zlc_active &&
if (IS_ENABLED(CONFIG_NUMA) && zlc_active &&
!zlc_zone_worth_trying(zonelist, z, allowednodes))
continue;

Expand All @@ -1962,11 +1963,11 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
if (page)
break;
this_zone_full:
if (NUMA_BUILD)
if (IS_ENABLED(CONFIG_NUMA))
zlc_mark_zone_full(zonelist, z);
}

if (unlikely(NUMA_BUILD && page == NULL && zlc_active)) {
if (unlikely(IS_ENABLED(CONFIG_NUMA) && page == NULL && zlc_active)) {
/* Disable zlc cache for second zonelist scan */
zlc_active = 0;
goto zonelist_scan;
Expand Down Expand Up @@ -2266,7 +2267,7 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
return NULL;

/* After successful reclaim, reconsider all zones for allocation */
if (NUMA_BUILD)
if (IS_ENABLED(CONFIG_NUMA))
zlc_clear_zones_full(zonelist);

retry:
Expand Down Expand Up @@ -2412,7 +2413,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
* allowed per node queues are empty and that nodes are
* over allocated.
*/
if (NUMA_BUILD && (gfp_mask & GFP_THISNODE) == GFP_THISNODE)
if (IS_ENABLED(CONFIG_NUMA) &&
(gfp_mask & GFP_THISNODE) == GFP_THISNODE)
goto nopage;

restart:
Expand Down Expand Up @@ -2819,7 +2821,7 @@ unsigned int nr_free_pagecache_pages(void)

static inline void show_node(struct zone *zone)
{
if (NUMA_BUILD)
if (IS_ENABLED(CONFIG_NUMA))
printk("Node %d ", zone_to_nid(zone));
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@ static void s_stop(struct seq_file *m, void *p)

static void show_numa_info(struct seq_file *m, struct vm_struct *v)
{
if (NUMA_BUILD) {
if (IS_ENABLED(CONFIG_NUMA)) {
unsigned int nr, *counters = m->private;

if (!counters)
Expand Down Expand Up @@ -2615,7 +2615,7 @@ static int vmalloc_open(struct inode *inode, struct file *file)
unsigned int *ptr = NULL;
int ret;

if (NUMA_BUILD) {
if (IS_ENABLED(CONFIG_NUMA)) {
ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL);
if (ptr == NULL)
return -ENOMEM;
Expand Down

0 comments on commit 20e3d6d

Please sign in to comment.