Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753830Ab2HUHHQ (ORCPT ); Tue, 21 Aug 2012 03:07:16 -0400 Received: from casper.infradead.org ([85.118.1.10]:37880 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753318Ab2HUHHM convert rfc822-to-8bit (ORCPT ); Tue, 21 Aug 2012 03:07:12 -0400 Message-ID: <1345532820.23018.81.camel@twins> Subject: Re: [RFC PATCH 1/1] fair.c: Add/Export find_idlest_perfer_cpu API From: Peter Zijlstra To: Shirley Ma Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, "Michael S. Tsirkin" , netdev@vger.kernel.org, sri@us.ibm.com, vivek@us.ibm.com Date: Tue, 21 Aug 2012 09:07:00 +0200 In-Reply-To: <1345501041.6378.10.camel@oc3660625478.ibm.com> References: <1345232770.16533.234.camel@oc3660625478.ibm.com> <1345464035.23018.38.camel@twins> <1345501041.6378.10.camel@oc3660625478.ibm.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2270 Lines: 55 On Mon, 2012-08-20 at 15:17 -0700, Shirley Ma wrote: > On Mon, 2012-08-20 at 14:00 +0200, Peter Zijlstra wrote: > > On Fri, 2012-08-17 at 12:46 -0700, Shirley Ma wrote: > > > Add/Export a new API for per-cpu thread model networking device > > driver > > > to choose a preferred idlest cpu within allowed cpumask. > > > > > > The receiving CPUs of a networking device are not under cgroup > > controls. > > > Normally the receiving work will be scheduled on the cpu on which > > the > > > interrupts are received. When such a networking device uses per-cpu > > > thread model, the cpu which is chose to process the packets might > > not be > > > part of cgroup cpusets without using such an API here. > > > > > > On NUMA system, by using the preferred cpumask from the same NUMA > > node > > > would help to reduce expensive cross memory access to/from the other > > > NUMA node. > > > > > > KVM per-cpu vhost will be the first one to use this API. Any other > > > device driver which uses per-cpu thread model and has cgroup cpuset > > > control will use this API later. > > > > How often will this be called and how do you obtain the cpumasks > > provided to the function? > > It depends. It might be called pretty often if the user keeps changing > cgroups control cpuset. It might be less called if the cgroups control > cpuset is stable, and the host scheduler always schedules the work on > the same NUMA node. This just doesn't make any sense, you're scanning for the least loaded cpu, this is unrelated to a change in cpuset. So tying the scan frequency to changes in configuration is just broken. > The preferred cpumasks are obtained from local numa node. So why pass it as argument at all? Also, who says the current node is the right one? It might just be running there temporarily. > The allowed > cpumasks are obtained from caller's task allowed cpumasks (cgroups > control cpuset). task->cpus_allowed != cpusets.. Also, since you're using task->cpus_allowed, pass a task_struct *, not a cpumask. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/