Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5954712ybp; Tue, 8 Oct 2019 10:42:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+8sig73zW32/tApBBCRBR9a+6NKGB48VrNUWbQXYXbOiIeGNJosHEm5QYRUHf+gxE0O/Z X-Received: by 2002:a17:906:32c2:: with SMTP id k2mr29409848ejk.140.1570556530267; Tue, 08 Oct 2019 10:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570556530; cv=none; d=google.com; s=arc-20160816; b=fETf/b5EHG5jbLgaQWCKikvp2B5KwFQsnhLg2DIqS2uNfGedNz1Sw3ftXC4O41qeXA hWVpStaS/kmHP6+0HS0aRkQ/WueeRIp28VDsH2GiOS300eF9NAWdrdFtL4K33otM6PaQ 1K+Taj/4zaGBaHmZTX2UAewoLfyhtDVx8XpZVNVZzUJWO48hIFouq8P4arusNoN+bOZJ 8y9nlaEVFww/+/xOKY9xUZYjor6u66hjCwCely9T0hxXgmoShzJQo9oj1L40pO7eqdhB kZbLxM+eYG3CiTAWYOYcVuHi0IWLATtIoK3k1Y2SSkwJg1LZ30VdiPyw0kDuTa5dujXY j4eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7mN2uRVrNBa851TOjCoSypqhGYuGGBF+I76EoO/K6j0=; b=p23Ab7CZmR9lUIIuAor2wgvRuuFJEkoHXYZvZAB8ikLYKk4Bpb1eIIyhn1hnMzjBX0 lWgQ3Koyaa4aOmWJFvMr0CBAkHOJJmnSuujdMvmJruSV70JSbyeeyPZoELNBiHOVDqpR XDxWNZ+6u2HjhK4VJHb7Ie7PzRY0yeylJUD3/ULajL+iNdbsJEV9CsJvMlPUmtmfGjo0 zsgSMSF8yUPXGGxevsxE2xmygUK4l4G2hUGxpKN4mxQzd6TLYrTXssdfKnk2BeiK76wy 9iZB3T7Cpj+t6l82OsxzQFQCACwAzCggctn1ifxP7PEKgybsInJDYG5DoH2zSo17jvVb /ZFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=r+DgLo7b; 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 g21si10788669edg.339.2019.10.08.10.41.47; Tue, 08 Oct 2019 10:42:10 -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=merlin.20170209 header.b=r+DgLo7b; 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 S1727363AbfJHRjb (ORCPT + 99 others); Tue, 8 Oct 2019 13:39:31 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42784 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfJHRja (ORCPT ); Tue, 8 Oct 2019 13:39:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7mN2uRVrNBa851TOjCoSypqhGYuGGBF+I76EoO/K6j0=; b=r+DgLo7b05l0q8vi7/Yh3VmUs Xe/4iS4aWYQrnjn3ytyVHx4sCzKzxn2849Nxnq47Iq1n892BH0eBR0IoafLt7XNgA+k8zduxvtbWw +qy5bUZHE4UALRknq/VElO2sCQNjq77U8P/vFCQrMgYyuFKTEt/Um9wx/EW2/N3O48KFg4rrxNi9P pF5vHI/0KY0lWDTO3cu3/6uPOHxh10wAe3unO2T7FiCtGzI7pcBdEeagCDGPi/+DAFd98U40CvCF5 3kPjXXzTpSDKkr6KlFgSL7zX7XF1gK7ENVnnrZOdymcN3XJhh9LcDZ8VKpdib+w7pRYAuTKJCO1+M drr0gbkNg==; Received: from [31.161.223.134] (helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHtS6-0004Aj-VY; Tue, 08 Oct 2019 17:39:18 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D56789802E0; Tue, 8 Oct 2019 19:39:10 +0200 (CEST) Date: Tue, 8 Oct 2019 19:39:10 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Valentin Schneider , linux-kernel , Ingo Molnar , Phil Auld , Srikar Dronamraju , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Hillf Danton Subject: Re: [PATCH v3 04/10] sched/fair: rework load_balance Message-ID: <20191008173910.GB22902@worktop.programming.kicks-ass.net> References: <1568878421-12301-1-git-send-email-vincent.guittot@linaro.org> <1568878421-12301-5-git-send-email-vincent.guittot@linaro.org> <31cac0c1-98e4-c70e-e156-51a70813beff@arm.com> <20191008141642.GQ2294@hirez.programming.kicks-ass.net> <20191008153002.GA21999@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008153002.GA21999@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 05:30:02PM +0200, Vincent Guittot wrote: > This is how I plan to get ride of the problem: > + if (busiest->group_weight == 1 || sds->prefer_sibling) { > + unsigned int nr_diff = busiest->sum_h_nr_running; > + /* > + * When prefer sibling, evenly spread running tasks on > + * groups. > + */ > + env->migration_type = migrate_task; > + lsub_positive(&nr_diff, local->sum_h_nr_running); > + env->imbalance = nr_diff >> 1; > + return; > + } I'm thinking the max_t(long, 0, ...); variant reads a lot simpler and really _should_ work given that -fno-strict-overflow / -fwrapv mandates 2s complement.