From patchwork Thu Aug 10 04:20:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 109776 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1806571qge; Wed, 9 Aug 2017 21:21:12 -0700 (PDT) X-Received: by 10.98.252.204 with SMTP id e195mr10578573pfh.265.1502338872087; Wed, 09 Aug 2017 21:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502338872; cv=none; d=google.com; s=arc-20160816; b=Lr45S5e6mRe0CHb+LKXNVXb7dpWXtTYu5XslioOb73c30C5vwBr9h0cA9HYoY9eC7V 0c3ulFN0XE0TYdJgL1vJcebwvj6HXh8J6TMsr9nKgW2S/YaaWur3usPC10npHio8MHFr x2U1NfZmp6jUVswEDSgVfh3aTvlbB2guLBQu8TDyJP4uUAMrQSRNTzYoc0shna3Anc1y RGM44Fy9b1rVahnRP/Mp7xm391NhUOtneeAHOfC522QkNRmc6WAcr9ZtUEo4bMn6MLwS Aex8ReOEozb4fy1MrDqL1Dz0gckKwzTb5GRq+zaytQTVx8hCLu1+GqwOZ5D1h47BeMm0 Vnmg== 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 :dkim-signature:arc-authentication-results; bh=jbMCdRWD5YjIgYM7mYYoVS/jUV7D/gBYLJ1ze498zPs=; b=AChLZHdbTq2/sZvcszQGjtxGZ8mdX5FWuhbK6jOiChxhhJ7qR/9zdDkMUxbYbcFoy6 0+lS4RAVLuqc0rPhfOVj7LYE0cyZTS4XV0mU7J4b02A7Zl0y0UJZXMRCDK031RdYhnsV 1AOWJGrge9O211Bb7mksYPDdpADRh77g/wWXVega2hFT1GXIp+7ZGIcxoAhpkjemEO2/ cIYBcL/N2jRfTX5zxKfzisXgF1dg1YTCUcTHfBi9YjAY29rmkty+AJBWQyypGHMHVBb8 +eVnxiYrYZzHahISbZyxLqLqgvOLYgUAJyqGW+ANP5NB+9MyzcAeUzZMQvn7KSIut4Oy 6xbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RzupQiNp; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 z70si3570206pff.289.2017.08.09.21.21.11; Wed, 09 Aug 2017 21:21:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=RzupQiNp; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1751512AbdHJEVK (ORCPT + 12 others); Thu, 10 Aug 2017 00:21:10 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:37672 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbdHJEVJ (ORCPT ); Thu, 10 Aug 2017 00:21:09 -0400 Received: by mail-pg0-f43.google.com with SMTP id y129so36431947pgy.4 for ; Wed, 09 Aug 2017 21:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=jbMCdRWD5YjIgYM7mYYoVS/jUV7D/gBYLJ1ze498zPs=; b=RzupQiNp96RIKhdBEnAqOGkJSkidauGyXpeRiiPZn9y8jNFpp/YZxFoHn708L0GO+4 x3NHwnWWXyPhibgoeJh7iCN7U465VCfZYd380tHpX5w/VyX2idmUvcEgo2wmM16feQ5i Zf2r6/KbXYYhmqiahDYrlXmZNCJt1rbJHPzuw= 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; bh=jbMCdRWD5YjIgYM7mYYoVS/jUV7D/gBYLJ1ze498zPs=; b=jMpI88AdYHqphxOgN9N1TXoFDPKa0gPz5kHAZKWb+qTYRTYcxox1CLqH4iGYKE1awV Q171ZTGy1c1x7N8Nl7mO2eklW17Kw3FPek04kS1xD/dLjPCuiVCsRG6MWow8DXmjU3ld LxN2x2IOkVLVSvYgeLCZZVOPpGZ+FW+VrqzCqgpQzBSUnwmrK7Wuiqd+5uqVUCMeJD6x 8mhReL7rLFtmyKHVtcUoI4A6b2MWeLwsbqfRbU1cj7QXLOqo8QmIzkxV9eKFnKehEh/E aavivH4eO30Vvq2Wen4weewm/pKfYGbgseFtlskWy/fv9xYbDcu66lIfa0Hr6F+j+CtL 55+w== X-Gm-Message-State: AHYfb5hFqWYbL/nO1kXfaRiIsxMjDwzSh+RVvb7a8NesKWUAUIuJ9mqM X4AUpYroY4MXELPV X-Received: by 10.101.73.72 with SMTP id q8mr10027579pgs.219.1502338869103; Wed, 09 Aug 2017 21:21:09 -0700 (PDT) Received: from localhost ([122.172.24.241]) by smtp.gmail.com with ESMTPSA id 80sm10389775pfr.90.2017.08.09.21.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2017 21:21:07 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Juri Lelli , joelaf@google.com, Pavan Kondeti , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] cpufreq: schedutil: Don't restrict kthread to related_cpus unnecessarily Date: Thu, 10 Aug 2017 09:50:55 +0530 Message-Id: <8dd297a6ed05ed3f6c33aeb3059e71a1d270c530.1502338812.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.71.gd7076ec9c9cb Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Utilization update callbacks are now processed remotely, even on the CPUs that don't share cpufreq policy with the target CPU (if dvfs_possible_from_any_cpu flag is set). But in non-fast switch paths, the frequency is changed only from one of policy->related_cpus. This happens because the kthread which does the actual update is bound to a subset of CPUs (i.e. related_cpus). Allow frequency to be remotely updated as well (i.e. call __cpufreq_driver_target()) if dvfs_possible_from_any_cpu flag is set. Reported-by: Pavan Kondeti Signed-off-by: Viresh Kumar --- kernel/sched/cpufreq_schedutil.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.13.0.71.gd7076ec9c9cb diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 2e74c49776be..504d0752f8f2 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -487,7 +487,11 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy) } sg_policy->thread = thread; - kthread_bind_mask(thread, policy->related_cpus); + + /* Kthread is bound to all CPUs by default */ + if (!policy->dvfs_possible_from_any_cpu) + kthread_bind_mask(thread, policy->related_cpus); + init_irq_work(&sg_policy->irq_work, sugov_irq_work); mutex_init(&sg_policy->work_lock);