Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp257543imm; Wed, 11 Jul 2018 01:45:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqO5xeltyitH6O+d4Rs237MW3UIiZbRIA1a+IIgzzitkJp8m3daNBsLSdV/lom6/ORas45 X-Received: by 2002:a17:902:2884:: with SMTP id f4-v6mr27925990plb.204.1531298710865; Wed, 11 Jul 2018 01:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531298710; cv=none; d=google.com; s=arc-20160816; b=DFL1tNHtfMT8y2oIyuXYAwIt8jiFH19AQEFojHMK9F3rQYc018db92OkOXEnLDuAy5 obHlL9jvEQwZTvWayg9SK+H2nGAbRx6iGSxMfcpBRp3n0g15Jv2SSDKtyr8AmvjEXZAH tFEViiyDNglpSX2yw727FzwSP2PnMQQlMO0nF7+IjjuTZwA69EbqyitXlBuAKjme/2bX 6HsufKsuCdCD93WwnPA/D8bQ0LhkPMS2+k+B5JPNa9Gn1I4CheF1OwYf4w3/BUsOkMGt YNh08hzHFwccSV8hd7eihhYu7IwutfM5tytKlfDWv+NkhX+OW704MnrN0RLMULx8Ofa+ 9hpQ== 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:from:references:cc:to:subject:arc-authentication-results; bh=ZaaMByYjscMsYCsbP7oZq+kG7qoQ5k303Xi6drkvr+8=; b=i3PQ5NZlnetvCfcJPnoxwTkdpx1/crqOgAsdbm4C9XbT+GU9iq1cfz3Jn5EdA8ENMH WVToi8RBkEn70W6sKskCMiy25fpV4s58tFjYPuo7tenQlfzspBRxBhaXfl9VjRtIwTw2 2J0Qp3+DINePzPZcJQ5MZcnvZEEK4BSeFGHBBEvU/I8iGKZHKPxd4vnRL/2gmSnp4aS8 vh5iv0RAsOOKQb6TYsBiHL8wQyNGEOYTo1yb4S+FtaJfueuL9jKXP+tzDoBgCyVWPtZr kGLARC/VaAjdiKOpGGn59aQFOTlAOf5cRxLQph9+faA76Crt0ew+I0zbbY4qo3gBAXuq B9Wg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si18944792plz.290.2018.07.11.01.44.55; Wed, 11 Jul 2018 01:45:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732513AbeGKIqp (ORCPT + 99 others); Wed, 11 Jul 2018 04:46:45 -0400 Received: from foss.arm.com ([217.140.101.70]:59058 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbeGKIqp (ORCPT ); Wed, 11 Jul 2018 04:46:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09B29ED1; Wed, 11 Jul 2018 01:43:33 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBF543F5AD; Wed, 11 Jul 2018 01:43:30 -0700 (PDT) Subject: Re: [PATCH] sched/fair: Remove setting task's se->runnable_weight during PELT update To: Joel Fernandes Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Morten Rasmussen , Patrick Bellasi , Quentin Perret , kernel-team@android.com, Joel Fernandes , linux-kernel@vger.kernel.org References: <20180709164753.24699-1-dietmar.eggemann@arm.com> <20180710230917.GA187293@joelaf.mtv.corp.google.com> From: Dietmar Eggemann Message-ID: <0aba9bb6-eec7-130e-373f-5f87f192f2d4@arm.com> Date: Wed, 11 Jul 2018 10:43:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180710230917.GA187293@joelaf.mtv.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2018 01:09 AM, Joel Fernandes wrote: > On Mon, Jul 09, 2018 at 05:47:53PM +0100, Dietmar Eggemann wrote: >> A CFS (SCHED_OTHER, SCHED_BATCH or SCHED_IDLE policy) task's >> se->runnable_weight must always be in sync with its se->load.weight. >> >> se->runnable_weight is set to se->load.weight when the task is >> forked (init_entity_runnable_average()) or reniced (reweight_entity()). >> >> There are two cases in set_load_weight() which since they currently only >> set se->load.weight could lead to a situation in which se->load.weight >> is different to se->runnable_weight for a CFS task: >> >> (1) A task switches to SCHED_IDLE. >> >> (2) A SCHED_FIFO, SCHED_RR or SCHED_DEADLINE task which has been reniced >> (during which only its static priority gets set) switches to >> SCHED_OTHER or SCHED_BATCH. >> >> Set se->runnable_weight to se->load.weight in these two cases to prevent >> this. This eliminates the need to explicitly set it to se->load.weight >> during PELT updates in the CFS scheduler fastpath. > > Looks good to me. By the way just asking, is there a chance where > se_weight(se) and se_runnable(se) can ever be different? Yes they can be different, not for a task though but for se's representing task groups. It got introduced to be able to propagate load and runnable load independently through the task groups hierarchies.