Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1616438ybt; Thu, 18 Jun 2020 12:58:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzARMuGDa76g6fmPipwBd84+iATtsnIh0IIUNXvd0WaIsP2rzbd8533bazqvLq9eXmCCpUF X-Received: by 2002:a17:906:33c5:: with SMTP id w5mr308331eja.275.1592510306468; Thu, 18 Jun 2020 12:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592510306; cv=none; d=google.com; s=arc-20160816; b=OiO9aAmVi8LRCLlIKPS9AMEoSLWkRtLB4Q5TDhQIsJKRcHhlfOiUsW17/OTzLZSGZ7 Q0pISB94I3QxvE9OExQ3nmv5EweDfUfU6z6HWOzANFMtuCYrcHAYdWjM3QTbkFLJ85aA QPAHHuPbSBPzKPJXLEVpEyOaopISkUCANDqfr0bKTWIwVMp7bPnlQF9vHAiCicrNoTwM rLr/NAzSaeOES5DtoAZz/VsoHfdOpHpsFqB52Xr8q8APYoVXacowuHb52ZkppbzuE3QP gUevwMfDYZBhYXl4d6LZUje/SQa5EKt+HD+TWZAE5BJZ12+3ziFAhzmEzTjN5KroJCMw +E/Q== 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; bh=Zxgh65+yaym62tqi6IkrlTU8+n/8NDApCQb3a8mq1/4=; b=Np0dwuOJxEMMO5MSWw60AG+rA1Bctkyw0S6VcW/FkhiR7btaGrE7darF+k+sOvhPJF XLoqqDgzVDrwzik7qHsPRqWYPeQX8twWIQaNtUEfGXaiXYGPFEtI5KB1gl/I/YG0fvW2 y9ZkEYTOpbZXQNpL23YYxItFBXzZ0tF3ultIBatKQPsAZh/VwJVkLxPAVEy0dwy4bi1d gg8lhBQbK5VqeCIAwXi1qTNPKLHk3djggOjIkL49Lczk/MRrS70QYnrU7OC1tGAXHmDH 1/UZLlK1vM0ydQYJZhz4uMsFRPmPBqvutRvTfoySWvDN9x+tc6rwRvCfU7SvcEabfpTp eolg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si2443081ejh.543.2020.06.18.12.58.02; Thu, 18 Jun 2020 12:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730254AbgFRTzd (ORCPT + 99 others); Thu, 18 Jun 2020 15:55:33 -0400 Received: from foss.arm.com ([217.140.110.172]:58746 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730193AbgFRTzd (ORCPT ); Thu, 18 Jun 2020 15:55:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 43EC91FB; Thu, 18 Jun 2020 12:55:32 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C0103F73C; Thu, 18 Jun 2020 12:55:29 -0700 (PDT) From: Qais Yousef To: Ingo Molnar , Peter Zijlstra Cc: Qais Yousef , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Patrick Bellasi , Chris Redpath , Lukasz Luba , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] sched: Optionally skip uclamp logic in fast path Date: Thu, 18 Jun 2020 20:55:23 +0100 Message-Id: <20200618195525.7889-1-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series attempts to address the report that uclamp logic could be expensive sometimes and shows a regression in netperf UDP_STREAM under certain conditions. The first patch is a fix for how struct uclamp_rq is initialized which is required by the 2nd patch which contains the real 'fix'. Worth noting that the root cause of the overhead is believed to be system specific or related to potential certain code/data layout issues, leading to worse I/D $ performance. Different systems exhibited different behaviors and the regression did disappear in certain kernel version while attempting to reporoduce. More info can be found here: https://lore.kernel.org/lkml/20200616110824.dgkkbyapn3io6wik@e107158-lin/ Having the static key seemed the best thing to do to ensure the effect of uclamp is minimized for kernels that compile it in but don't have a userspace that uses it, which will allow distros to distribute uclamp capable kernels by default without having to compromise on performance for some systems that could be affected. Thanks -- Qais Yousef Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Ben Segall Cc: Mel Gorman CC: Patrick Bellasi Cc: Chris Redpath Cc: Lukasz Luba Cc: linux-kernel@vger.kernel.org Qais Yousef (2): sched/uclamp: Fix initialization of strut uclamp_rq sched/uclamp: Protect uclamp fast path code with static key kernel/sched/core.c | 73 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 9 deletions(-) -- 2.17.1