[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1386657875-icl2pjx6-mutt-n-horiguchi@ah.jp.nec.com>
Date: Tue, 10 Dec 2013 01:44:35 -0500
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Wanpeng Li <liwanp@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...hat.com>, Rik van Riel <riel@...hat.com>,
Mel Gorman <mgorman@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 09/12] sched/numa: fix task scan rate adjustment
Hi Wanpeng,
On Sun, Dec 08, 2013 at 02:14:50PM +0800, Wanpeng Li wrote:
> commit 04bb2f947 (sched/numa: Adjust scan rate in task_numa_placement) calculate
> period_slot which should be used as base value of scan rate increase if remote
> access dominate. However, current codes forget to use it, this patch fix it.
>
> Signed-off-by: Wanpeng Li <liwanp@...ux.vnet.ibm.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 7073c76..b077f1b3 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1358,7 +1358,7 @@ static void update_task_scan_period(struct task_struct *p,
> */
> period_slot = DIV_ROUND_UP(diff, NUMA_PERIOD_SLOTS);
> ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + shared));
> - diff = (diff * ratio) / NUMA_PERIOD_SLOTS;
> + diff = (period_slot * ratio) / NUMA_PERIOD_SLOTS;
> }
>
> p->numa_scan_period = clamp(p->numa_scan_period + diff,
It seems to me that the original code is correct, because the mathematical
meaning of this hunk is clear:
diff = (diff calculated by local-remote ratio) * (private-shared ratio)
If you use period_slot here, diff always becomes less then 1/10 finally by
the second ratio multiplication (because we divide by NUMA_PERIOD_SLOTS twice),
and I don't see the justification.
And if my idea is correct, we don't have to recalculate period_slot when
we multiply private-shared ratio. So we can remove that line.
Thanks,
Naoya Horiguchi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists