Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4669181ybz; Tue, 28 Apr 2020 16:05:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJsZ3WIpWjFXvDYZz7zuOUDAi/ZBecOJl2IIUyS22eNo6jPGPGrFSibcKdD5kETD1Samugq X-Received: by 2002:a17:906:138c:: with SMTP id f12mr77733ejc.35.1588115103238; Tue, 28 Apr 2020 16:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588115103; cv=none; d=google.com; s=arc-20160816; b=nmGMUvtknNf1TkvLfzYR9i25i8UigaIpm8apOS2kY+wXQ7CEggak2CfJFIU9T9VoZK InbwX9eQeSjCH9Y4rM+uRXLiwVkpz/mcxRT7q+wa5rWGhi2Pz4Tn8IfGBOiy0th1XR10 JBQY9AnQm32I7hCbLGtDEpYMLOX78bdTvW4zchPo6CAuST9xRUnD8DjgLQiumIumwCj1 v9FlcFh4Gnhr4MTJqE5kIZ3aTTQycWOLgDvuapWkP+qf1MGf7CK2jnJPrZYYERGRFD83 NT75N7IY2XcrNUOwuFdthJqndRVKNm+b2bLKUfaJn5ClZ7rxIYjsDLdNdAoNZlaZL1Vc lpzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AIu07HAj/AGrMk6ZycUKbLgO7uQhu/8EqeWjT0+uzss=; b=vavAXRuar1kCtJVo7W+NaWEe5DbHGVK3/adivGrgb915waWNihyeQz90MfDyjjW6RU x9vsZpxU3lQILWYlApbXNDuVt6DohRmCuu7Bn7uORC5c4JMTqho9ywZ5CIw8Xrj72VKM gvQhpyoYPDmFX1f72Wg8z3WAd+Mk6VTz1hAVCNS8RGpjJTHPjU6fFjR67764F6mqM9Bz hZ8/u4NM7wWRyFY2e3P3Z/BZASCdgi/BPISfJgQUSQg+OG8y5udRt6nB/7pDSQ2yXoEJ w91OJ8QVgv97DUik0bREfOaM0oKM+kXjH4nCw7qCtVv9xRu13dtu7scPeNJ5ttbTbrDO He+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=thRXx1m2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si2375184edo.476.2020.04.28.16.04.32; Tue, 28 Apr 2020 16:05:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=thRXx1m2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbgD1XCw (ORCPT + 99 others); Tue, 28 Apr 2020 19:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726343AbgD1XCv (ORCPT ); Tue, 28 Apr 2020 19:02:51 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 632F7C03C1AC; Tue, 28 Apr 2020 16:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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; bh=AIu07HAj/AGrMk6ZycUKbLgO7uQhu/8EqeWjT0+uzss=; b=thRXx1m2QR0nYaAuVcc/ntn9As h/QSxVIT6/nGdm0M7C501bF5GnnX81xbd/jZHBBuT1q0d3ucFzUzI0Z1Uz03kKGhv4qkEtc2bcWTh GS65J4aMfLxF7PONFoTRashCsbog5RHU4F7PsB9IuVmWtu4t/pL046rv+7dIfGco1NcIejiJOgLkw /Lq7LUz31RzkCgaJkhdZa1xp11tGcQe1FhiT6CoiP/+yWecjefEqsBd3Fd/BJy46lPocoFQtQc8hh 6YIwFuv3LtL3NaKeS4jJXXostKoGxWafOLcN3t0MNiITkG4ugjDFlyB9A+Dobxi+3FpoQmjmcucvl W7PRb+Vg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTZEt-0004TY-7Y; Tue, 28 Apr 2020 23:02:07 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 54444304121; Wed, 29 Apr 2020 01:02:04 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3BCE22392F89E; Wed, 29 Apr 2020 01:02:04 +0200 (CEST) Date: Wed, 29 Apr 2020 01:02:04 +0200 From: Peter Zijlstra To: Scott Wood Cc: Valentin Schneider , Steven Rostedt , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Rik van Riel , Mel Gorman , linux-kernel@vger.kernel.org, linux-rt-users Subject: Re: [RFC PATCH 1/3] sched/fair: Call newidle_balance() from finish_task_switch() Message-ID: <20200428230204.GE16027@hirez.programming.kicks-ass.net> References: <20200428050242.17717-1-swood@redhat.com> <20200428050242.17717-2-swood@redhat.com> <20200428220917.GB16027@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 05:55:03PM -0500, Scott Wood wrote: > On Wed, 2020-04-29 at 00:09 +0200, Peter Zijlstra wrote: > > Also, if you move it this late, this is entirely the wrong place. If you > > do it after the context switch either use the balance_callback or put it > > in the idle path. > > > > But what Valentin said; this needs a fair bit of support, the whole > > reason we've never done this is to avoid that double context switch... > > > > balance_callback() enters with the rq lock held but BH not separately BH? softirqs you mean? Pray tell more. > disabled, which interferes with the ability to enable interrupts but not BH. > It also gets called from rt_mutex_setprio() and __sched_setscheduler(), and > I didn't want the caller of those to be stuck with the latency. You're not reading it right.