From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbbEROOU (ORCPT ); Mon, 18 May 2015 10:14:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbbEROOS (ORCPT ); Mon, 18 May 2015 10:14:18 -0400 Message-ID: <5559F38F.8010908@redhat.com> Date: Mon, 18 May 2015 10:13:35 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Peter Zijlstra , Srikar Dronamraju CC: mingo@kernel.org, dedekind1@gmail.com, linux-kernel@vger.kernel.org, mgorman@suse.de, rostedt@goodmis.org, juri.lelli@arm.com Subject: Re: [RFC][PATCH 4/4] sched, numa: Ignore pinned tasks References: <20150515154333.712161952@infradead.org> <20150515154833.726258767@infradead.org> <20150518130050.GA2934@linux.vnet.ibm.com> <1431954418.3322.3.camel@twins> In-Reply-To: <1431954418.3322.3.camel@twins> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/18/2015 09:06 AM, Peter Zijlstra wrote: > On Mon, 2015-05-18 at 18:30 +0530, Srikar Dronamraju wrote: >>> >>> static void account_numa_dequeue(struct rq *rq, struct task_struct *p) >>> { >>> + if (p->nr_cpus_allowed == 1) { >>> + rq->nr_pinned_running--; >>> + WARN_ON_ONCE(p->numa_preferred_nid != -1); >>> + } >>> rq->nr_numa_running -= (p->numa_preferred_nid != -1); >>> rq->nr_preferred_running -= (p->numa_preferred_nid == task_node(p)); >>> } >> >> >> Shouldnt we reset p->numa_preferred_nid when we are setting the allowed >> cpus in set_cpus_allowed_common()? >> >> Otherwise if an process is set a preferred node based on its numa faults >> but then is pinned to a different cpu, then we can see this warning.:w! > > We should never get preferred_nid set when nr_cpus_allowed == 1, see the > hunk that changes task_tick_numa. > > So we set preferred = -1 on pinning, do not partake in numa balancing > while this is so, therefore it should still be so when we dequeue, > right? It could be pinned after it has been running for a while, with taskset -c -p -- All rights reversed