Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4768038yba; Wed, 8 May 2019 02:24:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfybls3bIl5pa9e1aH1QrveJ9AhU7uaIcOu88td+qn9F1rSgrcyVISVsDWRKRZQQ2rF1GD X-Received: by 2002:a65:5181:: with SMTP id h1mr46028430pgq.167.1557307458493; Wed, 08 May 2019 02:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557307458; cv=none; d=google.com; s=arc-20160816; b=DvscKvymKNoEuXEvRwf5seh2Ztc2HIRVrZR4WzZtkEgniqa3OpLLzCmd2DgED+TXis 38P529zixeHiVtyk9sfcTBrlkX5QtEAK54APZsJLUNZkZ9mBZZXFTQ8gXvmqdQiAKxrw Z13K6dtNcEfwqjuESW8TnRrlKgFpXi/d0sqnsO42SOXL56J+U/is3Rg7P1sYxZkUzNrg xONpTFa9xO3gcFTrWp7/SqxFgMMIHAaiXjcAAjg/+9usX1qjjrOpiQ7AcxcSzNQOmHLl uiItEvqQbKbNau+066E96dRlpgNtcYxLh1VEEVVb2MwKAMDAuvvVYjOcV8t7Yl0RM2eN FrOQ== 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; bh=j2zkhFBEgB76ZnYIx375guL7nGDbHUSh9B5wtwzZ4zU=; b=lZRLW73iFf/CTLwg2FYO1WW0I0Loqxqng6rcpInN1241cPC9NOsu/0hsnWTxp2caQD BoeXXUglMGhig2yWzcV/GYWlcZa/Wuz7NkVD4SJJ0gRuH64g3vQKDXzqYwyIm+QAVMfF bap3uwpG1XlQzKAH3JmpU28j0BaGMSPBr5NYE5H8jy+yS0ZNj3JDCZCDADIlrTgLcmo2 5/5Xa1Eew5dNezKZ84GlfkfgSxBi12zb3fzZWNNvAv4QdrFJaVXr5u+zwIHPZ9ObTKME 316yo0cWVBIRYZHq3XFHHvRGy16KqkPaxqJyurfCqJBqFRgOTZv3KOdLW0yblgegtD0a L8og== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si21992126plq.56.2019.05.08.02.24.01; Wed, 08 May 2019 02:24:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727324AbfEHJW2 (ORCPT + 99 others); Wed, 8 May 2019 05:22:28 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51023 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfEHJW1 (ORCPT ); Wed, 8 May 2019 05:22:27 -0400 Received: by mail-wm1-f68.google.com with SMTP id p21so2318141wmc.0 for ; Wed, 08 May 2019 02:22:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j2zkhFBEgB76ZnYIx375guL7nGDbHUSh9B5wtwzZ4zU=; b=nG/X4xG82SXuDtwwFSnDwhShPXx0KQY5ak5ccoF/J4EelfRKYVGzmLoW2HzLmLOBgH LDW/WJE7Zv241doIeHze/HaP1T4uWibnWsL3jwW8o9Eq0frexUnOS3hfUIW9m3/GGVBN 537/TCtivlB20cYixS6KgtxZfG9sNFOp0dRU1ZXEnCSRRfK2827X6/Paf8MJyMOvO+Cc oADxH8Asrtus9n6pppmewFMXAVsRnL35vykkXFBkZ1cyogFIR4F2COYogJJ5lIFaDARq iewgTjsk6CmRwNBKNGFzmcfz7bPWXy0foF4cgH9jIA5CKjZnbkR/R0cisxKZLrKF+TlH 7v2A== X-Gm-Message-State: APjAAAWLB+Vq/L/fTQFX8oI7xnf+JsLxMOwp5X6Q/Lb9yauBB89SSf6d AraBCueXmiHNLFnBYXwHYYTAbA== X-Received: by 2002:a05:600c:22c5:: with SMTP id 5mr2123967wmg.129.1557307345100; Wed, 08 May 2019 02:22:25 -0700 (PDT) Received: from localhost.localdomain ([151.29.174.33]) by smtp.gmail.com with ESMTPSA id v184sm2013826wma.6.2019.05.08.02.22.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 02:22:24 -0700 (PDT) Date: Wed, 8 May 2019 11:22:22 +0200 From: Juri Lelli To: luca abeni Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Ingo Molnar , Peter Zijlstra , Vincent Guittot , "Paul E . McKenney" , Joel Fernandes , Quentin Perret , Luc Van Oostenryck , Morten Rasmussen , Daniel Bristot de Oliveira , Patrick Bellasi , Tommaso Cucinotta Subject: Re: [RFC PATCH 3/6] sched/dl: Try better placement even for deadline tasks that do not block Message-ID: <20190508092222.GH6551@localhost.localdomain> References: <20190506044836.2914-1-luca.abeni@santannapisa.it> <20190506044836.2914-4-luca.abeni@santannapisa.it> <20190508080116.GE6551@localhost.localdomain> <20190508101414.1c968810@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190508101414.1c968810@nowhere> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/19 10:14, luca abeni wrote: > Hi Juri, > > On Wed, 8 May 2019 10:01:16 +0200 > Juri Lelli wrote: > > > Hi Luca, > > > > On 06/05/19 06:48, Luca Abeni wrote: > > > From: luca abeni > > > > > > Currently, the scheduler tries to find a proper placement for > > > SCHED_DEADLINE tasks when they are pushed out of a core or when > > > they wake up. Hence, if there is a single SCHED_DEADLINE task > > > that never blocks and wakes up, such a task is never migrated to > > > an appropriate CPU core, but continues to execute on its original > > > core. > > > > > > This commit addresses the issue by trying to migrate a > > > SCHED_DEADLINE task (searching for an appropriate CPU core) the > > > first time it is throttled. > > > > Why we failed to put the task on a CPU with enough (max) capacity > > right after it passed admission control? The very first time the task > > was scheduled I mean. > > I think the currently executing task cannot be pushed out of a > CPU/core, right? > > So, if a task switches from SCHED_OTHER to SCHED_DEADLINE while it is > executing on a fast core, the only way to migrate it would be to > preempt it (by using the stop_sched_class, I think), no? > (the typical situation here is a "cpu hog" task that switches from > SCHED_OTHER to SCHED_DEADLINE, and it is the only SCHED_DEADLINE > task... The task never blocks, so push/pull functions are never invoked) > > Or am I missing something? OK, but "ideally" we should not be waiting to it to be throttled, right? I wonder if you could queue a balance callback in switched_to_dl() (from check_class_changed()), so that it is picked up by balance_callback() before setscheduler returns.