Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp4111687ybh; Tue, 17 Mar 2020 12:25:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsQE42ic0xOXF8StGwxVJNx3ZSThQufWFIwrGvGmzOYqoR3vK0GVm0fgy8ni9s6vFGJStA7 X-Received: by 2002:a05:6830:3090:: with SMTP id f16mr679746ots.211.1584473126984; Tue, 17 Mar 2020 12:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584473126; cv=none; d=google.com; s=arc-20160816; b=rY0Wf7yNNDqt52Ar6KglCHOcosheKR08RHthaMsTCOctK7bvrQZqYQB7+EysWVxeYY qAavQb0ZgMb9ZulHee3mxCNNSTJSaFrGQtmk57q98Jj8rynZeUz4NVrwTFM7sDMyeE0A hSmorXLO0bbJ6rFHc/y/+nUR7hUvrgtEZlsboFZQ0ByUeaGY8GlS5Bh1a94BL+d2hBAH yOexps4SaoSd7/rYbOCcAdwxntekzIVnyfDZIIZ/GOHkj/EmrQul019pog1TDixoh/0j MiV+jFC2GkrYH7ALuBgt6XGqdwNkQHolKu31EdHidpH4qUcjrU0GA3b/VoSFIU2Opwxx OfOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mAb+lK7uiT3ldfeyyLr+kiJibGSBEZhmuX8jrROVGvY=; b=lrJ+/SfPD7shzJTxZ/Y3qBUqpLgtpAyxHtEgpqu4kFUlOyQ+jxyqHUq9iyb0roITef cOa1WO9IucvJKJpoNd5iPSo4qD3AXhjKM+u1orVXgf4upA2uBCZt+/mxYJt5SB35dWQM CwQVWiJBNdkqF2BqjXAhwDpGIeugSnCxIxrPgNEJK9gEzKsy1NFDPzjlsi6vzdGA8kY/ 5Myp51oLEyOpB4oPv2xQxBxh3J6RsFuHcyd5MS8HmLbH5+RWf7jVtBzUwcm7l7v/suuc GAYpXbFdu/eSnyFRalxu2/KGbV1xJqIQ2EhIgza80AV0ViclCqxSQxGB0uWcgMuzyRji 03eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=PAbRC8Um; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q196si2204791oic.143.2020.03.17.12.25.13; Tue, 17 Mar 2020 12:25:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=PAbRC8Um; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbgCQTY1 (ORCPT + 99 others); Tue, 17 Mar 2020 15:24:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60182 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbgCQTY1 (ORCPT ); Tue, 17 Mar 2020 15:24:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mAb+lK7uiT3ldfeyyLr+kiJibGSBEZhmuX8jrROVGvY=; b=PAbRC8UmjK7Da14hi1EjiZgSxx OJRb1TNOFcCb3HMABHjCPKeA3tNzE65fqpxKqBfpRMZgbEAtyeOdEUN+lldTC9RLL0CRyv/FQlYkY sTUZV7l8ATDLVp7AONiHPY/pOfUEHfAAdD1MflfG/6rrOh7U1Z7X5MSGybuzH0jcGAXKIkyzGbmlB QT9AqrsOjzxsUIJFkgcgNWYBElbplhROrg+e2XL4t9HXeOjtdB53nyTTUiAly3t6dBYnRUx8/7mN2 OpzxuPZW7p0gldx7C4DHpql4wTFKFPeuHONP62ioXdZLtS4YNuGsJgf6aQ1j2x1/i4Pm13KQQ/CRT F5AfgwqQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEHop-0001Io-MK; Tue, 17 Mar 2020 19:24:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7ABBC30110E; Tue, 17 Mar 2020 20:24:01 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 36E85284D7DF3; Tue, 17 Mar 2020 20:24:01 +0100 (CET) Date: Tue, 17 Mar 2020 20:24:01 +0100 From: Peter Zijlstra To: Qais Yousef Cc: Josh Don , Ingo Molnar , Juri Lelli , Vincent Guittot , Li Zefan , Tejun Heo , Johannes Weiner , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Paul Turner Subject: Re: [PATCH v2] sched/cpuset: distribute tasks within affinity masks Message-ID: <20200317192401.GE20713@hirez.programming.kicks-ass.net> References: <20200311010113.136465-1-joshdon@google.com> <20200311140533.pclgecwhbpqzyrks@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311140533.pclgecwhbpqzyrks@e107158-lin.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2020 at 02:05:33PM +0000, Qais Yousef wrote: > On 03/10/20 18:01, Josh Don wrote: > > From: Paul Turner > > > > Currently, when updating the affinity of tasks via either cpusets.cpus, > > or, sched_setaffinity(); tasks not currently running within the newly > > specified mask will be arbitrarily assigned to the first CPU within the > > mask. > > > > This (particularly in the case that we are restricting masks) can > > result in many tasks being assigned to the first CPUs of their new > > masks. > > > > This: > > 1) Can induce scheduling delays while the load-balancer has a chance to > > spread them between their new CPUs. > > 2) Can antogonize a poor load-balancer behavior where it has a > > difficult time recognizing that a cross-socket imbalance has been > > forced by an affinity mask. > > > > This change adds a new cpumask interface to allow iterated calls to > > distribute within the intersection of the provided masks. > > > > The cases that this mainly affects are: > > - modifying cpuset.cpus > > - when tasks join a cpuset > > - when modifying a task's affinity via sched_setaffinity(2) > > > > Co-developed-by: Josh Don > > Signed-off-by: Josh Don > > Signed-off-by: Paul Turner > Anyway, for the API. > > Reviewed-by: Qais Yousef > Tested-by: Qais Yousef Thanks guys!