Received: by 10.192.165.148 with SMTP id m20csp4813313imm; Tue, 24 Apr 2018 08:48:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx488BLs/PwZ6ZkHySxGSq1ss739eSBocKyVnncxcYubA7V5If5gjBH1wUqvNfKhPvgmWPaId X-Received: by 10.101.68.129 with SMTP id l1mr20837493pgq.239.1524584899333; Tue, 24 Apr 2018 08:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524584899; cv=none; d=google.com; s=arc-20160816; b=qgfSh95N3zv3qBzbDU07ZItEy1fChewB5x4TK+JFyPdw94HH2/XT3XqRsmUJEQWZiE 55+KFItfGs+SjDXXAL5EotDBt5Dr3J9CUpHzuKHXTr7kkqT3srSwp69KVTnLNeguj9yK ilRjQfB9iW8QYm3T6/H8g6I+omry6N3qGGbZisEGypJcNj0Pb+/wC7hrHTpUtwm+6SqQ nk9J3DOoLbPsjTxTmcIy8DiGNHvHTbealq0L7fy7XE+mKI1RzKb22pEmngCPp+OuXVLk EMIDoQbM/IGseR9Eki8RBnfzdCOpJTWkjFwMrg8GjfovRy1ljYIotRT+hmV0mIM0rSC7 EyXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Xp/o8M4h0JxJKDMLc5ksmUrjtaR8EiKchwNxjnf7fG4=; b=Jb+7Fb7fpXPR+D3I42e2olx4WocyPmDpPBO0i1tn/d/HEopVN1+wPefbpGNb6T2fic j8MxvcUE+fvt/kPVdITIUgO2IMz/wug/fm5eRLDaPH4HhHLmZa2vhTLRwLA7Cdr+wzIE /btjlas+F7eT43ERjPdXqmWXD5B25dqhko7huLfz89lzgHzQXv08rv3b+S+RNv7zki31 z2SnNDegozYhQM0KbwQgCd3HLzyACAOA7J6qhqOIoBvb8WB9G75HF/3ddUpqD6iBaXBv YjQIwQapvetbS1R+blN8FwoQyVC61B3nRphKX7qpt4CUnTupwuZI6T3fuz7tIvfYoMKF 3nTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUpLzhI7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc11-v6si13533282plb.43.2018.04.24.08.48.04; Tue, 24 Apr 2018 08:48:19 -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=pass header.i=@gmail.com header.s=20161025 header.b=MUpLzhI7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751933AbeDXPqL (ORCPT + 99 others); Tue, 24 Apr 2018 11:46:11 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:39090 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeDXPqJ (ORCPT ); Tue, 24 Apr 2018 11:46:09 -0400 Received: by mail-wm0-f44.google.com with SMTP id b21so1680165wme.4 for ; Tue, 24 Apr 2018 08:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Xp/o8M4h0JxJKDMLc5ksmUrjtaR8EiKchwNxjnf7fG4=; b=MUpLzhI7zhFq+RsXzGUl73tEQaoC2vgg9Aywm1G6T/ndIiZG2lv0vYeejnupzd6BPp apeB019t8Hp4PAamPDE5F5cd5TgphE6Z/y9eXvCg5CU8XE8iSUwoW2S0m4UIUiL0TQph 7EVTbFMDxYrDDl9ruaUYpOKc+R+NFPrw8zrNhALxJUJ2/TKUQivqvTbmS8otzJXkw7pe QwAmjQDuBzoK7zDDR4IbwDNjUNDXrZLdWXk9uliqD6Z4nPk+BcYhq8hFg8bcPk0LMgTs vAIWwtTXb2wABBnEHJm82GQHvpKyw1xUlbiQMARar2WhclC6/B3Go+WhMxSyTA9o8SlL ByrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Xp/o8M4h0JxJKDMLc5ksmUrjtaR8EiKchwNxjnf7fG4=; b=o1EN7EIctZVIg+UNvMyIC4KwlljzWTLNk+dkEShTkhs9frZwg8E/bow+hhTWHzoYFV qUgcwe1ZjL6X/RtiUazL5IH09lMexsN/gZSVlY1Cf/K8pFH5Y6n8N7wvF103sRDWHIik 1mHCfy04DCPmCK4g3BW+ilSZpEOVOlzInl6yaTTn0/UoXVQlkhNhDuwdivLfrV43d/S3 a0asjX+BZ1soEUQjKQs5lFYjJJgZ6PezL4GkQWRtWw2/u2GxBmXxvVgs84kqts1m6fbY cFvhv73M/JmOQcoe2lLO5UUCiIB29rNo9YQwZv8vGXXBxSG6Cf8Sq6wlFPv5TFfOVLqd bQFA== X-Gm-Message-State: ALQs6tBgd1KMHD7KpvzIxjRoJgifDcianVX6O+IiT3CR2C4s9hX6FUS5 zJNKqh0hWiY5JrRepBDpxb54DTCg/i4gcq1SRZw= X-Received: by 10.80.212.195 with SMTP id e3mr34884570edj.127.1524584768749; Tue, 24 Apr 2018 08:46:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.145.91 with HTTP; Tue, 24 Apr 2018 08:46:08 -0700 (PDT) In-Reply-To: <20180424123523.GF4064@hirez.programming.kicks-ass.net> References: <8a34a16da90b9f83ffe60316a074a5e4d05b59b0.1524479666.git.viresh.kumar@linaro.org> <434fa179-7c8f-8a01-a07a-4527521a04c7@arm.com> <20180424104304.GE4064@hirez.programming.kicks-ass.net> <0985e709-0d71-2c08-20a9-7bfb618fb5f2@arm.com> <20180424123523.GF4064@hirez.programming.kicks-ass.net> From: Joel Fernandes Date: Tue, 24 Apr 2018 08:46:08 -0700 Message-ID: Subject: Re: [PATCH] sched/fair: Rearrange select_task_rq_fair() to optimize it To: Peter Zijlstra Cc: Valentin Schneider , Viresh Kumar , Ingo Molnar , Vincent Guittot , Daniel Lezcano , Linux Kernel Mailing List , Quentin Perret , c@hirez.programming.kicks-ass.net, Joel Fernandes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 5:35 AM, Peter Zijlstra wrote: > On Tue, Apr 24, 2018 at 12:19:07PM +0100, Valentin Schneider wrote: >> On 24/04/18 11:43, Peter Zijlstra wrote: >> > On Tue, Apr 24, 2018 at 11:02:26AM +0100, Valentin Schneider wrote: >> >> I'd argue making things easier to read is a non-negligible part as well. >> > >> > Right, so I don't object to either of these (I think); but it would be >> > good to see this in combination with that proposed EAS change. >> > >> >> True, I would've said the call to find_energy_efficient_cpu() ([1]) could >> simply be added to the if (sd) {} case, but... > > I think the proposal was to put it before the for_each_domain() loop > entirely, however... > >> > I think you (valentin) wanted to side-step the entire domain loop in >> > that case or something. >> > >> >> ...this would change more things. Admittedly I've been sort of out of the loop >> (no pun intended) lately, but this doesn't ring a bell. That might have been >> the other frenchie (Quentin) :) > > It does indeed appear I confused the two of you, it was Quentin playing > with that. > > In any case, if there not going to be conflicts here, this all looks > good. Both Viresh's and Valentin's patch looks lovely to me too. I couldn't spot anything wrong with them either. One suggestion I was thinking off is can we add better comments to this code (atleast label fast path vs slow path) ? Also, annotate the conditions for the fast/slow path with likely/unlikely since fast path is the common case? so like: if (unlikely(sd)) { /* Fast path, common case */ ... } else if (...) { /* Slow path */ } thanks, - Joel