Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4141730pxb; Tue, 10 Nov 2020 08:54:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVRhkZKTW4+3WbDqYAeSWizE0ekza5wuUXKm7MSK/h3ETP+8nUFs5FOfE+FKsZ6nXAQlKJ X-Received: by 2002:a05:6402:144f:: with SMTP id d15mr241657edx.300.1605027279695; Tue, 10 Nov 2020 08:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605027279; cv=none; d=google.com; s=arc-20160816; b=sduv6s+KP6xivl401OAMOIqLFY+85i6wluQcABSDLCrYAuz3zhRJWFKkRa36ilZVXm 1DKOudTrK+38KZFb8GsRl/9ZyX/eUbOOGz7C/bO6b+NaSfZg1ghIQzS8Z5C4RnKibLXN stIvlCgGqdpfigtEDa7cLwnDn5tcMBx4LEPQ1TEiL+e5UEjwcqIn2WcCirIBRhnlWPFO OfE+qXjm7XV8PaHWgNQ+Ek586Ym7cn7/5vgXj9Jah8ABLMpdh8oFhrMBGn8xny2vwwam yTdRQ0ZKhBEaUDmC9GHVEpkLv0RJW8o7/mk0/dXLOf3GMR4CKpQfdca+VfoE1g5cZMZh qhNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yuIbCOnKKp1cU5nUzMJ2su+aXHIyfLl8hCU3icRFERo=; b=n6/5Pirz8XNEUm824OpRXOkPaVP9WhirnmC4OCL5uSf8p8gAlD2NR0ZDFnVI6oFtWV caFW8hL/CwIhCbHDqX8OHoWOJGp0B+0I/CaS3FRyTjRgUFxkOulMsN3ojawShzm2ksaA 8OmqSRanCkqqKv6sHAtW/jzp/MbrvDGca+UFSeO0dvdbYZwAYC6g5mx8ddm1YBzr4ucu 7RfdVkIszvyMAMjbAr0GcGCZdr88oT6S7xEJDkbXf8owubLF3whgLYbRoYG9nrDhb29x OIrOuy5NZ2DSCttMyFXofzWidHSvaW+e+FAhZOcN8b+c44VSDQtXDYukMJ2AAw87BqdM PSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=adRDsVj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si8365188edc.413.2020.11.10.08.54.16; Tue, 10 Nov 2020 08:54:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=adRDsVj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbgKJQub (ORCPT + 99 others); Tue, 10 Nov 2020 11:50:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726152AbgKJQub (ORCPT ); Tue, 10 Nov 2020 11:50:31 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CE2C0613CF for ; Tue, 10 Nov 2020 08:50:31 -0800 (PST) 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; bh=yuIbCOnKKp1cU5nUzMJ2su+aXHIyfLl8hCU3icRFERo=; b=adRDsVj1nKuaKshLjR93xHtIHB HVFao2u5t8QH/2chVzoM9LVxYRrhniiGE9Eq0M+feBXN37+SYvLy3nRwOdTML6JovKUj7PMV2pzr9 bszc+F/nwGjv/Bx8LxMs3t7eqErLKUcHi/yk7C/ovA1PER0r2zf4ynlSs7W2SaCtpjYKszF/DDpvf MVYLjsgV5UPeLgW+f1FljCqO8AtOLi1Mu9FCGobnReCEQpnNFOwKuEf99HvDUmHJVpgnmnOtBW6qE 8ny1xuvzoPlFllJy3e7M5sQuLWv4Zo/gIpGkjK6qWWbEqDyDZ7vFAFgPowb7jEeLRXoaaeuTxgDen MYvxv7xA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcWqX-0007vC-Ld; Tue, 10 Nov 2020 16:50:17 +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 5A57F301324; Tue, 10 Nov 2020 17:50:15 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 23B8729A56BE4; Tue, 10 Nov 2020 17:50:15 +0100 (CET) Date: Tue, 10 Nov 2020 17:50:15 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, valentin.schneider@arm.com, morten.rasmussen@arm.com, ouwen210@hotmail.com Subject: Re: [PATCH v3] sched/fair: prefer prev cpu in asymmetric wakeup path Message-ID: <20201110165015.GM2594@hirez.programming.kicks-ass.net> References: <20201029161824.26389-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201029161824.26389-1-vincent.guittot@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29, 2020 at 05:18:24PM +0100, Vincent Guittot wrote: > During fast wakeup path, scheduler always check whether local or prev cpus > are good candidates for the task before looking for other cpus in the > domain. With > commit b7a331615d25 ("sched/fair: Add asymmetric CPU capacity wakeup scan") > the heterogenous system gains a dedicated path but doesn't try to reuse > prev cpu whenever possible. If the previous cpu is idle and belong to the > LLC domain, we should check it 1st before looking for another cpu because > it stays one of the best candidate and this also stabilizes task placement > on the system. > > This change aligns asymmetric path behavior with symmetric one and reduces > cases where the task migrates across all cpus of the sd_asym_cpucapacity > domains at wakeup. > > This change does not impact normal EAS mode but only the overloaded case or > when EAS is not used. > > - On hikey960 with performance governor (EAS disable) > > ./perf bench sched pipe -T -l 50000 > mainline w/ patch > # migrations 999364 0 > ops/sec 149313(+/-0.28%) 182587(+/- 0.40) +22% > > - On hikey with performance governor > > ./perf bench sched pipe -T -l 50000 > mainline w/ patch > # migrations 0 0 > ops/sec 47721(+/-0.76%) 47899(+/- 0.56) +0.4% > > According to test on hikey, the patch doesn't impact symmetric system > compared to current implementation (only tested on arm64) > > Also read the uclamped value of task's utilization at most twice instead > instead each time we compare task's utilization with cpu's capacity. > > Fixes: b7a331615d25 ("sched/fair: Add asymmetric CPU capacity wakeup scan") > Reviewed-by: Valentin Schneider > Signed-off-by: Vincent Guittot > --- Thanks!