From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756221AbbJAJnT (ORCPT ); Thu, 1 Oct 2015 05:43:19 -0400 Received: from casper.infradead.org ([85.118.1.10]:59947 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755414AbbJAJnQ (ORCPT ); Thu, 1 Oct 2015 05:43:16 -0400 Date: Thu, 1 Oct 2015 11:43:13 +0200 From: Peter Zijlstra To: "Meyer, Mike" Cc: "linux-kernel@vger.kernel.org" , "mingo@redhat.com" Subject: Re: [PATCH] sched: fix task and run queue run_delay inconsistencies Message-ID: <20151001094313.GA3281@worktop.programming.kicks-ass.net> References: <72105DE171429F468B83CE64C279BFFA1760DC12@SUSHDC8002.TD.TERADATA.COM> <20150930154413.GO3604@twins.programming.kicks-ass.net> <72105DE171429F468B83CE64C279BFFA17615A68@SUSHDC8002.TD.TERADATA.COM> <20151001063732.GM2881@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151001063732.GM2881@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2015 at 08:37:32AM +0200, Peter Zijlstra wrote: > On Wed, Sep 30, 2015 at 08:28:41PM +0000, Meyer, Mike wrote: > > Yes that will also address the issue. > > > > The reason I approached the way I did was to avoid adding code path to > > the far more common uses of {en,de}queue_task() but I doubt anyone is > > going to notice a difference with the addition of some register > > save/restores and a compare in that path. Overall the code does > > shrink with the alternative which is good. > > In most cases the flags should be compile time constants, and with the > inline we can determine the branch at compile time, avoiding emitting > that branch instruction entirely. > > But let me double check the asm for a few important sites. It looks like the sites in the wakeup path do indeed not get any additional conditionals. > > My only comment is I am not sure about the naming of the flag > > ENQUEUE_TEMP which implies (to me) the enqueue is temporary which > > clearly it isn't. Maybe something like DEQUEUE_MOVE/ENQUEUE_MOVE > > would be a bit more descriptive of the use case. > > Yes, I ran out of creative juices, let me attempt a better name once > I've woken up a bit. How about DEQUEUE_SAVE, ENQUEUE_RESTORE ? Ideally I'd wrap the whole pattern into a helper but C isn't really supportive of pre+post patterns like this.