Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp774873imm; Fri, 11 May 2018 06:16:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp43gFGEtX/PXZD7fsV8hHs1Uag8JGAc+dZXPl2P4q+klm+OAqycmRfh6ACoxX2bIeegjjq X-Received: by 2002:a63:b443:: with SMTP id n3-v6mr4362654pgu.81.1526044587226; Fri, 11 May 2018 06:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526044587; cv=none; d=google.com; s=arc-20160816; b=D5ghBbB7x5ixJN2mT85dtlp0vSBJkfuiyj5lBkSW614lOxr1gwj9LuzeIONt4LgH00 U5KlrCNEFOu2oOaWzW3tmjxuwaFfbilVzekXqvoAzvJBOZtXAXaZlwCVHWS9RXMritZO 6/sSbGyzFEIJbvaOF4Gc68w8nZA1v5I7tfKPJI6Pdm4saC4v8IfFdzg19N1oaaWcSv9p hiEXsPp7DKss2JjkWVATTfTq+fNirdbqhLyrURO/Vrq29h1iUD+c1cC5bI8Nyj2flAxi OYh+7RneXgNwAnAdANWu7aUlpGjQ8IE0c7jvKQeqnwQETs0g5oN7BCn3yp5VZeOZVpKB TTOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2/GBSyuAsp+fxUzkktAqimCbEFpT1HFEDkaBNhESxi0=; b=epOfHrU3kO2jndqKy758Tjj/UNkER/DD+k7R9f/HtsWTrDeNYCe6yRY5FS4O3xr8MX Y8lUhQbnwXdSHTQA4B6RZxEgKqZOHZ9cIvq2BjlCOwoaxpu0mlPayeWQ/ry1YTdgXQFw wx5/fxSDoznmeS/xTaS/d9xt4Oa4J6lZlPC918f1z+akNyAA3paDRIEjrTiXE5qoeoXq C0W5o866YSEr+LLf4u4Zdks8x+q34EKOApBcZ+5XBN+Ki+RX2z2ZQj35BVKpl0HRFhml hVQ5ovJWuKMAbSQTL0GddxTsdi5Ay6yOVa/qr3HO/nxR0Nsbr4t+8PPpaL7eVLxinuHB Ui+g== 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 d14-v6si3166590pfl.122.2018.05.11.06.16.10; Fri, 11 May 2018 06:16:27 -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 S1752857AbeEKNPZ (ORCPT + 99 others); Fri, 11 May 2018 09:15:25 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41170 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbeEKNPX (ORCPT ); Fri, 11 May 2018 09:15:23 -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 72B221596; Fri, 11 May 2018 06:15:23 -0700 (PDT) Received: from e110439-lin.cambridge.arm.com (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3B1993F73E; Fri, 11 May 2018 06:15:21 -0700 (PDT) From: Patrick Bellasi To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Joel Fernandes , Steve Muckle Subject: [PATCH v2 0/3] Improve schedutil integration for FAIR tasks Date: Fri, 11 May 2018 14:15:06 +0100 Message-Id: <20180511131509.16275-1-patrick.bellasi@arm.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here is an update of: https://lkml.org/lkml/2018/5/10/346 Where, apart from some minor clean-ups, I've added a cpufreq_enqueue() wrapper function for cpufreq_update_util() to be used in enqueue_task_fair(). That's because: - it helps to keep more clean the enqueue_task_fair() by collecting all cpufreq related code into a single function - it fixes the flags masking issue reported by Peter - it allows to add a compilation guard for !SMP systems where we never migrate tasks and thus we should never set the SCHED_CPUFREQ_MIGRATION flag. The SCHED_CPUFREQ_MIGRATION flag was previously set from update_load_avg() which is empty defined for !SMP. Now that we update schedutil at the end of enqueue_task_fair, we have to specifically address this case. Still, the resulting code, it's more clean in defining when schedutil is going to be updated and under which conditions/flags. Again, I want to call out that with the last patch there is one function change wrt mainline. When the CPU controller is in use, and a task is queued into a throttled RQ, the behavior of the IOWAIT flag is different. Currently we set the flag (and thus boost the frequency to max) even tough we know the task is not going to run. With the patch the flag is not set, and thus the frequency not bumped, which seems to most correct behavior to me. Moreover, the IOWAIT flag for this task is lost forever, since when the RQ in unthrottled we do not walk the tasks to collect their flags. However, given the task has been already delayed because of the throttled RQ, perhaps a delayed IOWAIT boost also does not make a lot of sense. What do you think? Finally, Viresh suggested some patches could/should have "stable" in Cc but I was not entirely sure. Thus, I've left it as a maintainers call. Cheers Patrick Changes in v2: - improved comment in enqueue_task_fair (Peter) - fixed flags masking (Peter) - fixed !CONFIG_SMP build (0-DAY) by using a cpufreq_enqueue wrapper to avoid setting the SCHED_CPUFREQ_MIGRATION flag on !SMP systems - removed blank lines (Viresh) - add "Acked-by" Viresh tag to the first two patches Patrick Bellasi (3): sched/cpufreq: always consider blocked FAIR utilization sched/fair: util_est: update before schedutil sched/fair: schedutil: explicit update only when required kernel/sched/cpufreq_schedutil.c | 17 ++++---- kernel/sched/fair.c | 93 +++++++++++++++++++++------------------- 2 files changed, 56 insertions(+), 54 deletions(-) -- 2.15.1