Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp119043pxa; Tue, 4 Aug 2020 00:55:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGppjNbmm8mYtRuPgKlk3Tef0RGws1n/WryGzU6jAm53G92Zbz6iaWsfa5SVd7RVjPCnjX X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr19874568edt.137.1596527725472; Tue, 04 Aug 2020 00:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596527725; cv=none; d=google.com; s=arc-20160816; b=fAvEvB840LFU4nZ9ZLqLAof2jREviTJKEbF+m7EQmpSFluIYbEgjIpFb6+qh5mYxGo Hp8urTJw/zfTb/G8tV5aeYlK0aCaZo2/BzrrUcOuxb7FvMRmDR9eZbbKxO4uMUfMBikq X/Z74WKqnUMR/PXAvrCRfCWOHcTzOnj+8dV4dvHkVVnNlv0N5f/MV4nIkvlDsup66Buh 8NgO6vgHoruCPOsfpJEu3lbZajkfRbqp9esNrHRu1t1aSZI0stAH3Q6r51jq7bNVWNDH rHm1Q+WCXwJPqg5YKmFd1THIZCUllPtPnM/5EfAjzspFC/cAiY0Jz23yqmXs5j763/S9 15Ag== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zYEc+6a7E/gabrUW1l1oa9EKsDvyQIWgJXIkTHUE6P0=; b=HkPmFjsGRhYRDITNgtkL0zgi9bsSwRRDJZzQEamKncZSYRjtLqI0Bd+KbJNxGb1l2c Lz5MRJAhHT0gqjVH/0A7iQiWzN156bG+vRjbf7eN83UG9bSSmSyGLbjVaTjXrMQAZgyV Yw306xMaDi8u6KV68GD9cyij/CkMiGNq4X4LLREppqpHAzHOVxAY68NBmjqyzcwyXKfG DR2zwe1Kxwi8bH7HNRIYVmVL9fYsMESjYAgUY5oOrwkUq1mIBHKakMJp9wXswootT7gI v7HTgpPd5G2kK4Z91jJbCY4YiAPUzp5EGMOOV0tTowKBcFq9edTdb3qlaEZ/g/YsHq4z mWBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MQKi9p+O; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl14si1152999ejb.509.2020.08.04.00.55.03; Tue, 04 Aug 2020 00:55:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MQKi9p+O; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728609AbgHDHwp (ORCPT + 99 others); Tue, 4 Aug 2020 03:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbgHDHwo (ORCPT ); Tue, 4 Aug 2020 03:52:44 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 703CFC06174A; Tue, 4 Aug 2020 00:52:44 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id s15so10112645pgc.8; Tue, 04 Aug 2020 00:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zYEc+6a7E/gabrUW1l1oa9EKsDvyQIWgJXIkTHUE6P0=; b=MQKi9p+OTeU7KudYYa62FbuV/BULPjiYgzSkpxX0hFt239tzKILs5CMVfi2I1KxSZL GfihFA6OtXRLxRQZD7oKwMeU6KXG34wfOsADEs28IGhmmbGqiDHJdzpccC0r6xQi6DWC SmnN8OHk6s9e2JP/D9Q+JfazrLLzkvtesb7IIRikhyUkITFY5PbKPCZHHwbs2/apyclg eNcuyJ6WnVTf9qPR9vDJKs7jVfL8wIU6TsQX4MyyqBMwS1E5Vd7SgH1otpekCUFEz6p4 PqxhKVpxcN5w3gGBM4dy1lH3mTxVsrUKrh4Mxpvh0oQEovzU9xkWFM83iZS3SVMQhlcV TaQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zYEc+6a7E/gabrUW1l1oa9EKsDvyQIWgJXIkTHUE6P0=; b=RV2YpjJTcdXYMxSzaMI8JT5F/qFPPlniw6iI45fVvroWET+RdYdW2IKh7JGXuydKDJ Pr5/waLxnDOc1trXG/p0HaHv47VKbCcnaf8yy7q3v+KLPG0v23XNKU3tSEoJiH9S/Jda Mq3GTMvOVFvx6l+x0xJX4wLaw8kWgGKOmfnjT4Sgf6Xtt0U7dUTQ5ccxQnrJFMGdPM79 b67zl3F141L1Aal0ZcTV0HJslxJbH3U/5vm3az0Uv9MKKeY9PiCQlvMfYaY7zQ55hGnX tmDClgj4WAY3M8gvIrbUkcGC4kLqAuPHh4M4Y9kV3zy3Am2UQFHN3otA3zwUfvwTwudA boKQ== X-Gm-Message-State: AOAM531uEGzD4r0+zKH1WjWwgg66N36PjirEV+9AKv0dyWE14AFCBaHg /90w79YkOGi14AuUC2v3/mo= X-Received: by 2002:a63:741b:: with SMTP id p27mr558733pgc.194.1596527563970; Tue, 04 Aug 2020 00:52:43 -0700 (PDT) Received: from yangdongdo-OptiPlex-9010.mioffice.cn ([209.9.72.214]) by smtp.gmail.com with ESMTPSA id h18sm9462018pfo.21.2020.08.04.00.52.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2020 00:52:43 -0700 (PDT) From: Dongdong Yang To: gregkh@linuxfoundation.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-pm@vger.kernel.org, yangdongdong@xiaomi.com, yanziily@xiaomi.com, rocking@linux.alibaba.com Subject: [PATCH v4] Provide USF for the portable equipment. Date: Tue, 4 Aug 2020 15:50:34 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongdong Yang This patch provides USF(User Sensitive Feedback factor) auxiliary cpufreq governor to support high level layer sysfs inodes setting for utils adjustment purpose from the identified scenario on portable equipment. Because the power consumption and UI response are more cared for by portable equipment users. And the "screen off" status stands for no request from the user, however, the kernel is still expected to notify the user in time on modem, network or powerkey events occur. USF provides "sched_usf_non_ux_r" sysfs inode to cut down the utils from user space tasks according to high level scenario. In addition, it usually hints more cpufreq demand that the preemptive counts of the tasks on the cpu burst and over the user expecting completed time such as the ratio sysctl_sched_latency to sysctl_sched_min_granularity on "screen on" status, which more likely with more UI. The sysfs inodes "sched_usf_up_l0_r" and "sched_usf_down_r" have been provided to adjust the utils according to high level identified scenario to alloc the cpufreq in time. Changes in v4 Based on comments from Greg, Randy and Viresh - Add USF sysfs to ABI - Remove kobj field from usf. - Clean Kconfig left at staging. Changes in v3 Based on comments from Greg, Dietmar, Christoph and Randy - Move usf.c to kernel/sched from staging. - Remove trace_printk and debugfs. - Add document draft. - Update comments. Changes in v2 Based on comments from Steven, Greg, Peter and Dan: - Add adjust_task_pred_set switch. - Move adjust_task_pred_demand declaration into sched.h - Update comments. - Clean usf structure. Changes in v1 Initial USF Dongdong Yang (1): sched: Provide USF for the portable equipment. Documentation/ABI/testing/sysfs-devices-system-cpu | 48 ++++ drivers/cpufreq/Kconfig | 11 + include/trace/events/sched.h | 35 +++ kernel/sched/Makefile | 1 + kernel/sched/cpufreq_schedutil.c | 3 + kernel/sched/sched.h | 10 + kernel/sched/usf.c | 294 +++++++++++++++++++++ 7 files changed, 402 insertions(+) create mode 100644 kernel/sched/usf.c -- 2.7.4