Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1118087imu; Fri, 7 Dec 2018 14:39:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/VuDiB2g6e1jerJfvzs6GUsaexXO5vl7zHK3x4xMfzGI0DLSZ4zyFXwKv2gp5O4ZKuadotm X-Received: by 2002:a62:14d1:: with SMTP id 200mr4062195pfu.103.1544222345829; Fri, 07 Dec 2018 14:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544222345; cv=none; d=google.com; s=arc-20160816; b=wEb5AtOryNQFR8YkH51gd6Toxc6HUS7glRTLVYlDxd0wBBR4qqYRXaf7vEkEulvl6i kP1zOvcpXHKk66hFztYi5O0hb36lYEee7EFIuk4kCvUWIp4ZADGMkW5c6APTF4MtoDiq 1bWB/zvCR/CSNtcNQlbOUmO+L3pgaqVIDkpbVTPyGIBnqMWUWbuUA7rkjwP20HJcqcSk yhSSdgVLFc201tkwXcg7XEyStrlOh94Af52TGHSOS4/KZadQalB4njH0mR7q53Lw2b6b Y9saVqUP2D63b0C8YDPmTxyZ0dZoyvPIHrqBaQJ5/wZg/l+Zk+FS8NMWSkSE/ExoQ89e YJTA== 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:organization:from:references:cc:to:subject :dkim-signature; bh=v/m4fByKBWxCAx/FXLVRFw1Zdd5U8GDbPAgzKFpQnv0=; b=0o83oM+KblAuEXkef11IryfoCofsx93tl3yfeB2TKrl5Lr+QKDhaTu5vOpeM5/9354 j6ch/1azOJui+hSJc8xAoJpVtvpoRWdjGLMbeffzJlsbL0jr2ZioIVNRfqKZzzdP/K0x PQD+Ppc7aBmwo4XjuBUkv2JjkoR4VIQ7neeeTrcRcJ0A5y0rPPdaKUufy9maxNFlycZl Dkscs26b3PA0B3dgAcNxzvLj1s8LZRmZKuJIC0hG0VsTVlAnn4b/mXem2jdMmEUCD1mC ACUh3Ptojy4ZL4jolJLjFFmZQXFMMxVuaBXYwTlgV0X/FxoJGyi9BwJLT7/ul9SNN3W1 kfwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jdiS9lWf; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i69si3981133pgc.538.2018.12.07.14.38.50; Fri, 07 Dec 2018 14:39:05 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jdiS9lWf; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726160AbeLGWgl (ORCPT + 99 others); Fri, 7 Dec 2018 17:36:41 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:48470 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbeLGWgl (ORCPT ); Fri, 7 Dec 2018 17:36:41 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB7MT6UZ114459; Fri, 7 Dec 2018 22:36:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=v/m4fByKBWxCAx/FXLVRFw1Zdd5U8GDbPAgzKFpQnv0=; b=jdiS9lWfGkhKep5OrKjN6c9zUFqbb6QOUHF9kNk9UvE7C6BoXQB2wBYkdUqo/FuZu1sS Fol9no5g6upPcZppCwbNFyqWJ04uLKMZnWlhohmsnH49SVWJqjXGX/ud1ZrRPQ2aaipe eOPvHrVBlUDrx2iN0Tk8wt+PGdW/H5C+PYs40eYU1/GfO0Cg+4LdCiq+ho7IPCY1HLT+ QKdr4+6HzdCEB4h+cP5lG7A4fwCcQe3DlNiZ7VcTKpocGjTt6sSIMP7luM4Oxca5k9PJ 85eRp0xBZiBsM28dpcVovFkZ6Krh7Zeke5EsoitNQDghtDYZMqZCQ12vXg2+oKWY8Jcs fQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2p3hqug7ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Dec 2018 22:36:18 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB7MaHl4014059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Dec 2018 22:36:17 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB7MaGFS002816; Fri, 7 Dec 2018 22:36:16 GMT Received: from [10.39.214.172] (/10.39.214.172) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Dec 2018 14:36:15 -0800 Subject: Re: [PATCH v4 08/10] sched/fair: Steal work from an overloaded CPU when CPU goes idle To: Valentin Schneider , 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: Steven Sistare Organization: Oracle Corporation Message-ID: <9f798c5d-f58a-e1fc-5b03-6598e04916bb@oracle.com> Date: Fri, 7 Dec 2018 17:36:08 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9100 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812070180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/7/2018 3:21 PM, Valentin Schneider wrote: > 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(). try_steal() already checks cpu_active. I could hoist it. - Steve > >> 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; > [...] >