Commit 2eb57dd2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Don't let processes be scheduled on CPU-less nodes (1/3)

From: Matthew Dobson <colpatch@us.ibm.com>

sched_best_cpu schedules processes on nodes based on node_nr_running.  For
CPU-less nodes, this is always 0, and thus sched_best_cpu tends to migrate
tasks to these nodes, which eventually get remigrated elsewhere.

This patch adds include/linux/topology.h, and modifies all includes of
asm/topology.h to linux/topology.h.  A subsequent patch in this series adds
helper functions to linux/topology.h to ensure processes are only migrated
to nodes with CPUs.

Test compiled and booted by Andrew Theurer (habanero@us.ibm.com) on both
x440 and ppc64.
parent 7347b0d7
......@@ -6,8 +6,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <asm/topology.h>
#include <linux/topology.h>
struct class cpu_class = {
......
......@@ -7,8 +7,7 @@
#include <linux/init.h>
#include <linux/memblk.h>
#include <linux/node.h>
#include <asm/topology.h>
#include <linux/topology.h>
static struct class memblk_class = {
......
......@@ -7,8 +7,7 @@
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/node.h>
#include <asm/topology.h>
#include <linux/topology.h>
static struct class node_class = {
......
......@@ -3,8 +3,8 @@
#include <linux/device.h>
#include <linux/cpu.h>
#include <linux/topology.h>
#include <asm/topology.h>
#include <asm/node.h>
struct i386_cpu {
......
......@@ -4,8 +4,8 @@
#include <linux/device.h>
#include <linux/mmzone.h>
#include <linux/memblk.h>
#include <linux/topology.h>
#include <asm/topology.h>
#include <asm/node.h>
struct i386_memblk {
......
......@@ -4,8 +4,7 @@
#include <linux/device.h>
#include <linux/mmzone.h>
#include <linux/node.h>
#include <asm/topology.h>
#include <linux/topology.h>
struct i386_node {
struct node node;
......
......@@ -255,7 +255,7 @@ static inline struct zone *next_zone(struct zone *zone)
#define MAX_NR_MEMBLKS 1
#endif /* CONFIG_NUMA */
#include <asm/topology.h>
#include <linux/topology.h>
/* Returns the number of the current Node. */
#define numa_node_id() (cpu_to_node(smp_processor_id()))
......
/*
* include/linux/topology.h
*
* Written by: Matthew Dobson, IBM Corporation
*
* Copyright (C) 2002, IBM Corp.
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <colpatch@us.ibm.com>
*/
#ifndef _LINUX_TOPOLOGY_H
#define _LINUX_TOPOLOGY_H
#include <asm/topology.h>
#endif /* _LINUX_TOPOLOGY_H */
......@@ -28,8 +28,7 @@
#include <linux/blkdev.h>
#include <linux/slab.h>
#include <linux/notifier.h>
#include <asm/topology.h>
#include <linux/topology.h>
DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS);
......
......@@ -28,10 +28,10 @@
#include <linux/pagevec.h>
#include <linux/backing-dev.h>
#include <linux/rmap-locking.h>
#include <linux/topology.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
#include <asm/topology.h>
#include <asm/div64.h>
#include <linux/swapops.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment