Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1884525imm; Thu, 7 Jun 2018 01:46:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLCmIaXEdeI1RjEYVmaxLGznxUUPg0Ep4pwlKd2CnArDpiw2Jq3HeNXZid0JcXcIHX3TSqb X-Received: by 2002:a17:902:6f0f:: with SMTP id w15-v6mr1081123plk.216.1528361175549; Thu, 07 Jun 2018 01:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528361175; cv=none; d=google.com; s=arc-20160816; b=WPbZdvR1ox9UUua2Cs/fUZalxz8PUwSI9aBpNvMWBn/r9S6MaGlVkZr1bPDnl4108i xf0BilR8OD1a5NnfSWZ92wXMVDq7r5PAWcr0g1oC1rgZsCBedLdnuJLNLObhMghu4xdG b5bjhUHY+PmPXOqCYYQbGItP7xPvjPc93srt9g9/8YbUKymGWfTucu9kMC5/ex59e2H+ 84jGRkE6FLn8DodHEmtDpkyP/hphvF4jQmbIDdVgg+iFmwHNwGE4nakil2q7kgRW4GUu YPdKjx/38n5yNa8s/XCuXOxIJtmRFRGsTn7bXp8R0B+H6woteBTuzVsMYdLooVbaMOut Ye2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=x/yc3VgSUiDw8FCw5qzMeEoZdN4wuSgHn2d7aaWwTT8=; b=BCdZN04iCBdzcXlKCDJ3inotvfeT2r8BUmsery8y5QF7U0MHiDdnbaLalU24E0+7dC DzNjuFaLRLjgD+8Yz0jQydP4UkWiyzOD+KqmZdnpW5Y8W+Z12/xtLJ74/vnZQOvkbDGA vsHklcW4QJ2IyNh26LcIUiXmHs7V9IMx5krbtBwUuB14mSU1QHb6aZChxTnaK10UznPA 0oOH86xpff7DXCEcSCBVFqRIJxIGrv0v84f66CT8TbOhTcemuGhs67hb7VTjxyvJ41kg eUO27MavjNNldZw2UZqr/MG4mBEi92QkJjwkbwaG0sk0Urh6y6VPSL3fW+K0EhztMktK q7fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGCoMFUo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64-v6si54643496pla.530.2018.06.07.01.46.00; Thu, 07 Jun 2018 01:46:15 -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=pass header.i=@linaro.org header.s=google header.b=kGCoMFUo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932737AbeFGIou (ORCPT + 99 others); Thu, 7 Jun 2018 04:44:50 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:44762 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932569AbeFGIos (ORCPT ); Thu, 7 Jun 2018 04:44:48 -0400 Received: by mail-io0-f195.google.com with SMTP id g7-v6so10885485ioh.11 for ; Thu, 07 Jun 2018 01:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=x/yc3VgSUiDw8FCw5qzMeEoZdN4wuSgHn2d7aaWwTT8=; b=kGCoMFUoGQVtZFDKid98e33brgysOA9VrOLyu89VmGFWC0Z8cilje/NwIJDkaKRyz8 Wqfu78+U3LwbqFIGAOGgiwrBmUYWkZ2GtQCZ8NOdFCK1B2TQyWoP5VKJX+ATVFcpWFUo w7V9UmFJVy5q624PaetuhmGc0aWIR8wFcdZik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=x/yc3VgSUiDw8FCw5qzMeEoZdN4wuSgHn2d7aaWwTT8=; b=TEBiAHv/thIWYbKmzSin534iAlYBNlTGKRAkSQ9ccAr+ZbIMTPgQQYmqWXZkhumOkg 4JzLqMTfhX0RSPkmtWWDLrhMXVBtdf0tZQatiI0MXNAmVTzeWxAaYOtM6xiSU6tCEofW ZFy211Udw0KyGcyZPGcLrJkivyH0Ms8L59Cc9Fnpi8qhjJf7zNhA72HsBjQ5qZ3EG1zG PjIV4cY5EUqd+ubm2m2L8fhzx8RKv6B9gnrqijxRZllYaW/pjlPTxyjGSO6SNDwtn2T+ BuGClnbgfwCobVaWS113EskdNexHhDSPxRD+tBsLh6b+mLBV4QHs9G+12vBDF5zYcHyN NQCw== X-Gm-Message-State: APt69E3d74q2mwdtPU3Q0sblxJfyyz7zN3rl91VweSAxG1YxrA5qD1b+ P0NGRPnEPE/Y46P9PfO3zGBUygosFfx4hXoFtZTGgg== X-Received: by 2002:a6b:1502:: with SMTP id 2-v6mr801035iov.18.1528361087676; Thu, 07 Jun 2018 01:44:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:304a:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 01:44:26 -0700 (PDT) In-Reply-To: <4368a36c-3df4-1454-1837-473e569b9080@arm.com> 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> <4368a36c-3df4-1454-1837-473e569b9080@arm.com> From: Vincent Guittot Date: Thu, 7 Jun 2018 10:44:26 +0200 Message-ID: Subject: Re: [PATCH v5 07/10] sched/irq: add irq utilization tracking To: Dietmar Eggemann Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , "Rafael J. Wysocki" , Juri Lelli , Morten Rasmussen , viresh kumar , Valentin Schneider , Quentin Perret Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7 June 2018 at 10:29, Dietmar Eggemann wrote: > 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. it's not a problem that the _sum variable are updated in different step because there are internal variable Only util_avg is used "outside" and the latter is updated after both idle and running steps have been applied > > 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? update_irq_load_avg(rq, 0) is called in update_blocked_averages to decay smoothly like other blocked signals and replace the need to call update_irq_load_avg(rq, 0) for every call to update_rq_clock_task() which can be significant > > 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. good point > > [...]