Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1870892imm; Thu, 7 Jun 2018 01:31:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPCFF/RvlcyIfatvI1Lkm/f7tq4iwt4XUsNv2H17EZaujgpW/I04DN7xKnP2SSf59xR706 X-Received: by 2002:a17:902:b110:: with SMTP id q16-v6mr1040908plr.286.1528360267731; Thu, 07 Jun 2018 01:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528360267; cv=none; d=google.com; s=arc-20160816; b=n2q9Dq1ghm3RdmwCO+9SI2veYyzs/NRP/w/7/44HoDicQAFxBBstN/MmSLFvhS8pTH dkp6z3upfCvMZMLh85gldhgmFHnaXcVmfeU7R+J64NRtBmmjWdjcUBZj7i9WchLpL7pw NNLNbjYggK003gpPIBr7Xd9GWv25hZQz4wNjpCurv+7Lj5TPJFhnOvtbM3T//VBZ/DYO hV3FYE2Icw+evJfwJJt3zIiLaL6d9TLzSx6Gul/3vvbvVpOOzfVBVnEoXJ+e4Rxg+K/v CxvXlCf8o+akEQc+uJB3m8SGkTXnh45b67wYOYFEiY3AF9QvOvtOSIRY0bO4U3aFfeD9 WCcw== 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=QWxEPzBPpEd3jQiyXztT7LomL3bApXVgXzpljtC9fME=; b=drjYbEpUQRzLrqPOiOhz6CLmOZp7lqzT0wHUdDZWxMW5nBTrmMOlHfy2rvhkpfMXZv yt9AjoHEZ1wKyQFeWRLEerIIMBLTUjuqHGpTU92bozjqCctIXepnCpA8TJG7mB4mPnXR fBMogDlc5a3gsE1wSYLzcYCeaL12iIXPaIni3OUzFEVVRfhY21FwS1oi2fC0IPkkhBUH fFcKcN9B8+6AtGUThSXUHNjUiXvfrFbiRErTPzcOt8cNMwSQW2yFcv+S2qWMr3mKZw2q a0EPeYlRCCNo90gl3h+YhZERh/xJmQJ0u4UXu7ki1xl8OHF5tTLfEgomBZ7XfIx6UoQM 3I6Q== 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 h3-v6si18417404plb.100.2018.06.07.01.30.52; Thu, 07 Jun 2018 01:31:07 -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 S932639AbeFGI3V (ORCPT + 99 others); Thu, 7 Jun 2018 04:29:21 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48204 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932572AbeFGI3U (ORCPT ); Thu, 7 Jun 2018 04:29:20 -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 D8F0480D; Thu, 7 Jun 2018 01:29:19 -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 B12613F59D; Thu, 7 Jun 2018 01:29:17 -0700 (PDT) Subject: Re: [PATCH v5 07/10] sched/irq: add irq utilization tracking To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , "Rafael J. Wysocki" , Juri Lelli , Morten Rasmussen , viresh kumar , Valentin Schneider , Quentin Perret References: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> <1527253951-22709-8-git-send-email-vincent.guittot@linaro.org> <72473e6f-8ade-8e26-3282-276fcae4c4c7@arm.com> From: Dietmar Eggemann Message-ID: <4368a36c-3df4-1454-1837-473e569b9080@arm.com> Date: Thu, 7 Jun 2018 10:29:15 +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: 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 06/06/2018 06:06 PM, Vincent Guittot wrote: > Hi Dietmar, > > Sorry for the late answer > > On 31 May 2018 at 18:54, Dietmar Eggemann wrote: >> On 05/30/2018 08:45 PM, Vincent Guittot wrote: >>> Hi Dietmar, >>> >>> On 30 May 2018 at 17:55, Dietmar Eggemann wrote: >>>> On 05/25/2018 03:12 PM, Vincent Guittot wrote: >> >> [...] >> >>>>> + */ >>>>> + ret = ___update_load_sum(rq->clock - running, rq->cpu, >>>>> &rq->avg_irq, >>>>> + 0, >>>>> + 0, >>>>> + 0); >>>>> + ret += ___update_load_sum(rq->clock, rq->cpu, &rq->avg_irq, >>>>> + 1, >>>>> + 1, >>>>> + 1); >> >> Can you not change the function parameter list to the usual >> (u64 now, struct rq *rq, int running)? >> >> Something like this (only compile and boot tested): > > To be honest, I prefer to keep the specific sequence above in a > dedicated function instead of adding it in core code. No big issue. > Furthermore, we end up calling call twice ___update_load_avg instead > of only once. This will set an intermediate and incorrect value in > util_avg and this value can be read in the meantime Can't buy this argument though because this is true with the current implementation as well since the 'decay load sum' - 'accrue load sum' sequence is not atomic. What about calling update_irq_load_avg(rq, 0) in update_rq_clock_task() if (irq_delta + steal) eq. 0 and sched_feat(NONTASK_CAPACITY) eq. true in this #ifdef CONFIG_XXX_TIME_ACCOUNTING block? Maintaining a irq/steal time signal makes only sense if at least one of the CONFIG_XXX_TIME_ACCOUNTING is set and NONTASK_CAPACITY is true. The call to update_irq_load_avg() in update_blocked_averages() isn't guarded my them. [...]