Skip to content

Commit 52bf84a

Browse files
Rik van Rielingomolnar
authored andcommitted
sched/numa, mm: Remove p->numa_migrate_deferred
Excessive migration of pages can hurt the performance of workloads that span multiple NUMA nodes. However, it turns out that the p->numa_migrate_deferred knob is a really big hammer, which does reduce migration rates, but does not actually help performance. Now that the second stage of the automatic numa balancing code has stabilized, it is time to replace the simplistic migration deferral code with something smarter. Signed-off-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mgorman@suse.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Chegu Vinod <chegu_vinod@hp.com> Link: http://lkml.kernel.org/r/1390860228-21539-2-git-send-email-riel@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent a57beec commit 52bf84a

5 files changed

Lines changed: 1 addition & 70 deletions

File tree

‎Documentation/sysctl/kernel.txt‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ feature should be disabled. Otherwise, if the system overhead from the
386386
feature is too high then the rate the kernel samples for NUMA hinting
387387
faults may be controlled by the numa_balancing_scan_period_min_ms,
388388
numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
389-
numa_balancing_scan_size_mb, numa_balancing_settle_count sysctls and
390-
numa_balancing_migrate_deferred.
389+
numa_balancing_scan_size_mb, and numa_balancing_settle_count sysctls.
391390

392391
==============================================================
393392

@@ -428,13 +427,6 @@ rate for each task.
428427
numa_balancing_scan_size_mb is how many megabytes worth of pages are
429428
scanned for a given scan.
430429

431-
numa_balancing_migrate_deferred is how many page migrations get skipped
432-
unconditionally, after a page migration is skipped because a page is shared
433-
with other tasks. This reduces page migration overhead, and determines
434-
how much stronger the "move task near its memory" policy scheduler becomes,
435-
versus the "move memory near its task" memory management policy, for workloads
436-
with shared memory.
437-
438430
==============================================================
439431

440432
osrelease, ostype & version:

‎include/linux/sched.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,6 @@ struct task_struct {
14571457
unsigned int numa_scan_period;
14581458
unsigned int numa_scan_period_max;
14591459
int numa_preferred_nid;
1460-
int numa_migrate_deferred;
14611460
unsigned long numa_migrate_retry;
14621461
u64 node_stamp; /* migration stamp */
14631462
struct callback_head numa_work;

‎kernel/sched/fair.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -819,14 +819,6 @@ unsigned int sysctl_numa_balancing_scan_size = 256;
819819
/* Scan @scan_size MB every @scan_period after an initial @scan_delay in ms */
820820
unsigned int sysctl_numa_balancing_scan_delay = 1000;
821821

822-
/*
823-
* After skipping a page migration on a shared page, skip N more numa page
824-
* migrations unconditionally. This reduces the number of NUMA migrations
825-
* in shared memory workloads, and has the effect of pulling tasks towards
826-
* where their memory lives, over pulling the memory towards the task.
827-
*/
828-
unsigned int sysctl_numa_balancing_migrate_deferred = 16;
829-
830822
static unsigned int task_nr_scan_windows(struct task_struct *p)
831823
{
832824
unsigned long rss = 0;

‎kernel/sysctl.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,6 @@ static struct ctl_table kern_table[] = {
384384
.mode = 0644,
385385
.proc_handler = proc_dointvec,
386386
},
387-
{
388-
.procname = "numa_balancing_migrate_deferred",
389-
.data = &sysctl_numa_balancing_migrate_deferred,
390-
.maxlen = sizeof(unsigned int),
391-
.mode = 0644,
392-
.proc_handler = proc_dointvec,
393-
},
394387
#endif /* CONFIG_NUMA_BALANCING */
395388
#endif /* CONFIG_SCHED_DEBUG */
396389
{

‎mm/mempolicy.c‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,35 +2304,6 @@ static void sp_free(struct sp_node *n)
23042304
kmem_cache_free(sn_cache, n);
23052305
}
23062306

2307-
#ifdef CONFIG_NUMA_BALANCING
2308-
static bool numa_migrate_deferred(struct task_struct *p, int last_cpupid)
2309-
{
2310-
/* Never defer a private fault */
2311-
if (cpupid_match_pid(p, last_cpupid))
2312-
return false;
2313-
2314-
if (p->numa_migrate_deferred) {
2315-
p->numa_migrate_deferred--;
2316-
return true;
2317-
}
2318-
return false;
2319-
}
2320-
2321-
static inline void defer_numa_migrate(struct task_struct *p)
2322-
{
2323-
p->numa_migrate_deferred = sysctl_numa_balancing_migrate_deferred;
2324-
}
2325-
#else
2326-
static inline bool numa_migrate_deferred(struct task_struct *p, int last_cpupid)
2327-
{
2328-
return false;
2329-
}
2330-
2331-
static inline void defer_numa_migrate(struct task_struct *p)
2332-
{
2333-
}
2334-
#endif /* CONFIG_NUMA_BALANCING */
2335-
23362307
/**
23372308
* mpol_misplaced - check whether current page node is valid in policy
23382309
*
@@ -2435,24 +2406,8 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
24352406
*/
24362407
last_cpupid = page_cpupid_xchg_last(page, this_cpupid);
24372408
if (!cpupid_pid_unset(last_cpupid) && cpupid_to_nid(last_cpupid) != thisnid) {
2438-
2439-
/* See sysctl_numa_balancing_migrate_deferred comment */
2440-
if (!cpupid_match_pid(current, last_cpupid))
2441-
defer_numa_migrate(current);
2442-
24432409
goto out;
24442410
}
2445-
2446-
/*
2447-
* The quadratic filter above reduces extraneous migration
2448-
* of shared pages somewhat. This code reduces it even more,
2449-
* reducing the overhead of page migrations of shared pages.
2450-
* This makes workloads with shared pages rely more on
2451-
* "move task near its memory", and less on "move memory
2452-
* towards its task", which is exactly what we want.
2453-
*/
2454-
if (numa_migrate_deferred(current, last_cpupid))
2455-
goto out;
24562411
}
24572412

24582413
if (curnid != polnid)

0 commit comments

Comments
 (0)