Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10417813ybi; Thu, 11 Jul 2019 05:03:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbfVmLItAwYiOCGh+8fyu3ICF+4i4oJaC/yWXlvRj+w4tW76ON7t6ThOIzXtmmdIYCbbQA X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr4601778pjq.32.1562846599864; Thu, 11 Jul 2019 05:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562846599; cv=none; d=google.com; s=arc-20160816; b=fCOK5IpCLp6XnTJQ7eVR9Vw53MKBKPqWNVbNEJ2WUykF7Nzn9E5aqZX/1azRjY3d0w OD6B/i8Sap7YNG06fLQi1O+iOuJOziO+SKEgT7/mjIJLm45qBLBcofxjSs4p0TIX061V AI/7kS/vgZ+xXbQiIJmfMnVVMkSZQnIW9Zzr2rP+teqiw07aPisgLV++9CeZ45ByxwyV 87kmEQkGN7icrK80Ml+q+ess2m0FkDh5lfJ/mw3D4OLgeb8sD+1A6sPOI762piJ9xl2m A2tkuRzWmt0YHrhKeniNdlYHP7hLzFKbqQAMO8EbFct7/P4wu+zPtqO04fjRkK2MIBQ9 cMYw== 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:dkim-signature; bh=mk20t0rVpeYwBEDdSRhCZJaIpHfjZGJUpoaHMNtcYEY=; b=Hg2Wjm8yrf7hbT35uZAA5r/XEvcqjgfMsCTDh4peDsL+q7kcEKun8vw3H8s3T1u+ep QMVOWcPCr46Hl3CA7pvlhUyjba9haYw0FdNQkNeNwsERMvPLmxuHrFIysPqtqUEcExXQ PnldbbiHTSCXoth9J+zv/kqoGMlW+S7f7rCSdxiHBB9lZdit9tcfHWX71Sk2AgnRzSFu CKUkfdipaE6xCPc7OdsLolQ2yCl5wpL3P95byAFiwfAg8K3nWZPP38nVUPH/fYpqy6dA /7NPcgerhholvLrN5039fQbzU5iG2o3+NUPDOhkesiAfZZOIjBhe4yhuWjqnCHUgQuA0 08kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=T6uOw5fd; 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 q5si4735813pll.279.2019.07.11.05.02.58; Thu, 11 Jul 2019 05:03: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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=T6uOw5fd; 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 S1728427AbfGKMAw (ORCPT + 99 others); Thu, 11 Jul 2019 08:00:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33334 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728194AbfGKMAw (ORCPT ); Thu, 11 Jul 2019 08:00:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mk20t0rVpeYwBEDdSRhCZJaIpHfjZGJUpoaHMNtcYEY=; b=T6uOw5fd9BvjTCiLlpJ0vsWiX RQyItAuqA2mm9ZkCDQzXLF6ldsNOM+Yz2aW9M1YEEDL75lwyAsClYiOsm3FCnEUnorMzVWg+1L2oz Du9x4vtpQ7MTVdbdyxWod2Xg+7HzHKIKj/BndA2nFMZu5oaCNfnwmuMdmrvjFSC9glPDauljnUlUx muPCr7XJ2mSFWvRsOEysjzxiaa9T2ZE+wgPyyoh39qskI2lPLcIfrl3ouBnMbC4P+F52aNbh3j4LW t/cmJQMchc74/vUOp/wWT/kULa6tBIl478s+u3eZSLjVbuE07nmQw4pHCiY5BY8YJ8DJBdTsjjrco rDxvFAzAw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hlXkh-0001wO-AF; Thu, 11 Jul 2019 12:00:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B1A55201247EB; Thu, 11 Jul 2019 14:00:41 +0200 (CEST) Date: Thu, 11 Jul 2019 14:00:41 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: luca abeni , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Ingo Molnar , Vincent Guittot , "Paul E . McKenney" , Joel Fernandes , Quentin Perret , Luc Van Oostenryck , Morten Rasmussen , Juri Lelli , 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: <20190711120041.GA3402@hirez.programming.kicks-ass.net> References: <20190506044836.2914-1-luca.abeni@santannapisa.it> <20190506044836.2914-4-luca.abeni@santannapisa.it> <20190708135536.GK3402@hirez.programming.kicks-ass.net> <20190709152436.51825f98@luca64> <20190709134200.GD3402@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 11, 2019 at 01:17:17PM +0200, Dietmar Eggemann wrote: > On 7/9/19 3:42 PM, Peter Zijlstra wrote: > >>> That is, we only do those callbacks from: > >>> > >>> schedule_tail() > >>> __schedule() > >>> rt_mutex_setprio() > >>> __sched_setscheduler() > >>> > >>> and the above looks like it can happen outside of those. > Is this what you are concerned about? > > (2 Cpus (CPU1, CPU2), 4 deadline task (thread0-X)) with > > @@ -1137,6 +1137,13 @@ static inline void rq_pin_lock(struct rq *rq, struct rq_flags *rf) > rf->cookie = lockdep_pin_lock(&rq->lock); > > #ifdef CONFIG_SCHED_DEBUG > +#ifdef CONFIG_SMP > + /* > + * There should not be pending callbacks at the start of rq_lock(); > + * all sites that handle them flush them at the end. > + */ > + WARN_ON_ONCE(rq->balance_callback); > +#endif > > > [ 87.251237] *** <--- queue_balance_callback(migrate_dl_task) p=[thread0-3 3627] on CPU2 > [ 87.251261] WARNING: CPU: 2 PID: 3627 at kernel/sched/sched.h:1145 __schedule+0x56c/0x690 > [ 87.615882] WARNING: CPU: 2 PID: 3616 at kernel/sched/sched.h:1145 task_rq_lock+0xe8/0xf0 > [ 88.176844] WARNING: CPU: 2 PID: 3616 at kernel/sched/sched.h:1145 load_balance+0x4d0/0xbc0 > [ 88.381905] WARNING: CPU: 2 PID: 3616 at kernel/sched/sched.h:1145 load_balance+0x7d8/0xbc0 I'm not sure how we get 4 warns, I was thinking that as soon as we exit __schedule() we'd procress the callback so further warns would be avoided. > [ 88.586991] *** ---> migrate_dl_task() p=[thread0-3 3627] to CPU1 But yes, something like this. Basucally I want to avoid calling queue_balance_callback() from a context where we'll not follow up with balance_callback().