Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp999308imu; Fri, 7 Dec 2018 12:22:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xt4Xzo4Fe4Wg5ALdJ3NLF/cOwMcbkmr8urueNCo65dfKgdfTs71GRSxevCdGRDURG47hOd X-Received: by 2002:a63:495b:: with SMTP id y27mr3199473pgk.32.1544214157137; Fri, 07 Dec 2018 12:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544214157; cv=none; d=google.com; s=arc-20160816; b=aqY/O8QgjkC27NTs1CkYtPZ4Ny0sWaENDmpc4J7dDDAab4bVZi5nQ8jojZEDTHC1ju AxDw+EzgSnwTohtEgPMkjMQwNB8QtoFCsYGR46NyVdcka/VwP2Ko5hGDBpgcs3YfTNlx FDg8tkyvlMo3o/9uySEIYUE+E3Vts0/ijQK9xLUJn+c+A5qdOxNyhl9V0rOoiULkJbQr tAnn3Svkn0ud4KMlvQhbsvCn537ZCV8WS16JGts52Ft4EAjPaa5OXA06Uz5FJLUQbwGY V70JTf6HCAO38XWtX9Kj5YFbhndF1X/kqr/K05VHGLyQi6K7FCyl7+46Y/OBAFqdi49n bAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=rOZEvd4yEKLfamYkwQTu92WOB5/XKQlla6sen5OsFjY=; b=KsmOZqmLJ6Yc9BFDSxr9qXj9tB+YY8qKcro9E+/pU4AYK+CCb2J3FjE/gEhJXNTllT ZUJ9qWz9Dmq2CQS6QGqGxtXQXjzpLrZ0k5qYZcgj82IofNC2dVlkZaSnFZ1iTsvHJ3uc i1nckvwEVpfnrlqV7P9knFEDZSlEKW4FuiAmbFbtMrJf0y8ITZxZBBrz+Rgia5v2ZJhi r00rk6Vc7kwhcjuSnRr8YtNOSTUtBXUHW9W658rJmrXS0T8aXMBStdZWwKjtD528yTg0 es98iQ3zYb5+TIzt5DEce+V2rSqW8jCNPdZN8ySn4SPKWcYH5Yu5RU8LBS6SqFBERY/L Uapg== ARC-Authentication-Results: i=1; mx.google.com; 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 j21si3594864pll.150.2018.12.07.12.22.21; Fri, 07 Dec 2018 12:22:37 -0800 (PST) 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; 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 S1726178AbeLGUVc (ORCPT + 99 others); Fri, 7 Dec 2018 15:21:32 -0500 Received: from foss.arm.com ([217.140.101.70]:53760 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbeLGUVc (ORCPT ); Fri, 7 Dec 2018 15:21:32 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 229E515AB; Fri, 7 Dec 2018 12:21:32 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B85B23F614; Fri, 7 Dec 2018 12:21:29 -0800 (PST) Subject: Re: [PATCH v4 08/10] sched/fair: Steal work from an overloaded CPU when CPU goes idle To: Steve Sistare , mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, quentin.perret@arm.com, linux-kernel@vger.kernel.org References: <1544131696-2888-1-git-send-email-steven.sistare@oracle.com> <1544131696-2888-9-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: Date: Fri, 7 Dec 2018 20:21:28 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1544131696-2888-9-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On 06/12/2018 21:28, Steve Sistare wrote: [...] > @@ -6778,20 +6791,22 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ > update_misfit_status(NULL, rq); > > /* > - * We must set idle_stamp _before_ calling idle_balance(), such that we > - * measure the duration of idle_balance() as idle time. > + * We must set idle_stamp _before_ calling try_steal() or > + * idle_balance(), such that we measure the duration as idle time. > */ > rq_idle_stamp_update(rq); > idle_balance() has a /* * Do not pull tasks towards !active CPUs... */ if (!cpu_active(this_cpu)) return 0; check which we probably want for stealing too, so we could hoist it up here to cover both idle_balance() and try_steal(). > new_tasks = idle_balance(rq, rf); > + if (new_tasks == 0) > + new_tasks = try_steal(rq, rf); > > if (new_tasks) > rq_idle_stamp_clear(rq); > > /* > - * Because idle_balance() releases (and re-acquires) rq->lock, it is > - * possible for any higher priority task to appear. In that case we > - * must re-start the pick_next_entity() loop. > + * Because try_steal() and idle_balance() release (and re-acquire) > + * rq->lock, it is possible for any higher priority task to appear. > + * In that case we must re-start the pick_next_entity() loop. > */ > if (new_tasks < 0) > return RETRY_TASK; [...]