[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140509100346.GS30445@twins.programming.kicks-ass.net>
Date: Fri, 9 May 2014 12:03:46 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: riel@...hat.com
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org, mgorman@...e.de,
chegu_vinod@...com
Subject: Re: [PATCH 2/4] sched,numa: weigh nearby nodes for task placement on
complex NUMA topologies
On Thu, May 08, 2014 at 01:23:29PM -0400, riel@...hat.com wrote:
> static inline unsigned long task_weight(struct task_struct *p, int nid)
> {
> - unsigned long total_faults;
> + unsigned long total_faults, score;
>
> if (!p->numa_faults_memory)
> return 0;
> @@ -940,15 +997,32 @@ static inline unsigned long task_weight(struct task_struct *p, int nid)
> if (!total_faults)
> return 0;
>
> - return 1000 * task_faults(p, nid) / total_faults;
> + score = 1000 * task_faults(p, nid);
> + score += nearby_nodes_score(p, nid, true);
> +
> + score /= total_faults;
> +
> + return score;
> }
So you add an O(nr_nodes) loop to task_weight(), but that in itself is
already called from O(nr_nodes) loops, yielding a total complexity of
O(nr_nodes^2).
This might be fine, but algorithmic complexity should very much be a
part of the changelog I think.
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists