From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD729C1975A for ; Tue, 17 Mar 2020 19:24:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B57E620738 for ; Tue, 17 Mar 2020 19:24:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PAbRC8Um" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbgCQTY1 (ORCPT ); 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!