Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1732253imm; Tue, 22 May 2018 08:29:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpa7POKlx2ereyXO+dzkd5ypmbxIEoquDsewAOVb59bOBwOC5jJ6es/DT12P6ZSPnNnqx48 X-Received: by 2002:a17:902:20c9:: with SMTP id v9-v6mr25203315plg.206.1527002941050; Tue, 22 May 2018 08:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527002941; cv=none; d=google.com; s=arc-20160816; b=awXqbLhxi7woaWVNRVzVb+sUW6HhjzaLK+lgPvAQefWUnDCCi6WJVU6kPhMrXE21cK /xexXMDzSQFzqxnjC8s9EQlDKQ1rZb1G/5G7RdRZ/8QYueoiJHEbeUhKIAr6S1s70/2D cthosv6nY6LYH9zs2F+omzaXUlkt2LLomej7PK/FfcDN2zjSiSVo53YXXUSE46xrz6JI beoaGm59LZrx2yDTn53wjB9wtawb4dxLrRy8wiEJ5bs70/SO3rAWocLujYfECBddrMtL NcpMGjaHPQR3Q8rks3T+8DFcEv/pCu4PB8gf+CWbkYVZwa1mL6nZD+bOa6JGyBs3xj2x HI8Q== 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=Mzcxqc7n+G24aPGL5XWkqi0ir03UhMr6LkvmeEVKb4E=; b=E7o8yf/Uc9WdKBWPPIoMV9SlUUhkhQaDTvxKmNa0tef1Do2tzMxVCO/sKit00YW9/T oFRYWkNSJO7KSS/BUu6XhgCa+1MZsHMo5VkC2atumJXBBWYmm46LIf1hpFjyKPz7WR8X 8W0xGqZ39g7LBj0Xe1wfdN8iivxyTrr+SBGW9sNSPh67Tnkj2omOExLSTK+YZ1gNZyaU wSj3w1FMCaGkPIlVjbQcQRbQ1ezxU7nr/iMPKU4qIv+cSqvIn+hefgO9ttAppbMeglI3 /ijxOps0hhoBpvp+UqNCfB2By2wCzPkmoU8hYfz/4cc3eSfRBQyS2aHyck/1OXvNe3Id 6hOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LNK3PY0g; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g59-v6si16816905plb.381.2018.05.22.08.28.41; Tue, 22 May 2018 08:29:01 -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=fail header.i=@gmail.com header.s=20161025 header.b=LNK3PY0g; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbeEVP1Q (ORCPT + 99 others); Tue, 22 May 2018 11:27:16 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:43906 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbeEVP1M (ORCPT ); Tue, 22 May 2018 11:27:12 -0400 Received: by mail-oi0-f67.google.com with SMTP id p62-v6so16579864oie.10; Tue, 22 May 2018 08:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Mzcxqc7n+G24aPGL5XWkqi0ir03UhMr6LkvmeEVKb4E=; b=LNK3PY0geL7Xr5QlLNnsXAQzYjIwNXi4qH7LmSUySGyCCcXmTGPda/fkHsFdbmEddA Ss8eXDeMBxYuU+hi1EL4K+Aqdcgqg9oS2ePRL01feGND1mh2yZOf+TxWAh/bOF6tZyjq rdiWtCXDWZDNXZCbkJ537gfL84XK+s8b+BYiE9SByj0Wm9LHSAxb/ifs5UNVbkMt0XPi 8yKOFqEp/zaOhQKdaTRQArtHEW9vqmEb8b9PrEOzDcL/m8CSM+QkotmTO94yy6LEp91t sEw0sIrNmuNY+R225gp52Kwk/MjyIScZtwUdQIeuLMOQ5p3+GZxX3J7MVB6BEUMMriSh xWKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Mzcxqc7n+G24aPGL5XWkqi0ir03UhMr6LkvmeEVKb4E=; b=EPm9VNZFr0VBUidkpMOtYOhFD3sPv4VK+nCg9ePR/6JGWp+vSdxWkFcPqDLA9OSYGf Q6wBEGoYXbgZsckDXqrl5yF7/QTzZIJ+y5RMxyCnw2VCixNIhjQB6Oo7xyBQJivjxbm6 2Pmzmj0jlHNjWbhwpITk2NrJ5g7STELdEQJi5LESOyTQRNIIJwi8r4UfW7HLFKpkGXyX lXZhXHR1VPqUrdWsQm85nNFN91cZRiHetofH850TcPfWKIHpG6OmeEJ4s0O/hM9wVnBg 7u9ejIkpj+ORJrd9JJlpr0gr8pEjOjLaaebi7KjtnwAO8GddHlVxwZUqOmDkgzUj5DrI 1Nlg== X-Gm-Message-State: ALKqPwebffsqg9ZNAZnWiD0deEcD2rYFWsnBR+LbClRNQlPElW149paQ G7z4I6UlNLNiN42deIG8Mq+jtgBpmqmemjR9Cvw= X-Received: by 2002:aca:e156:: with SMTP id y83-v6mr13609102oig.282.1527002832282; Tue, 22 May 2018 08:27:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1468:0:0:0:0:0 with HTTP; Tue, 22 May 2018 08:27:11 -0700 (PDT) In-Reply-To: <4237890.zlzv5C60QP@aspire.rjw.lan> References: <20180518185501.173552-1-joel@joelfernandes.org> <20180522113844.5rz3skjeck57arft@vireshk-i7> <4237890.zlzv5C60QP@aspire.rjw.lan> From: "Rafael J. Wysocki" Date: Tue, 22 May 2018 17:27:11 +0200 X-Google-Sender-Auth: OiWPvzHn_kGeVlZI5iUk1EHisag Message-ID: Subject: Re: [PATCH v2] schedutil: Allow cpufreq requests to be made even when kthread kicked To: Viresh Kumar , "Joel Fernandes (Google)" Cc: "Rafael J. Wysocki" , Linux Kernel Mailing List , "Rafael J . Wysocki" , Peter Zijlstra , Ingo Molnar , Patrick Bellasi , Juri Lelli , Luca Abeni , Todd Kjos , Claudio Scordino , kernel-team@android.com, Linux PM , "Joel Fernandes (Google.)" 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 Tue, May 22, 2018 at 2:22 PM, Rafael J. Wysocki wrote: > On Tuesday, May 22, 2018 1:42:05 PM CEST Rafael J. Wysocki wrote: >> On Tue, May 22, 2018 at 1:38 PM, Viresh Kumar wrote: >> > On 22-05-18, 13:31, Rafael J. Wysocki wrote: >> >> So below is my (compiled-only) version of the $subject patch, obviously based >> >> on the Joel's work. >> >> >> >> Roughly, what it does is to move the fast_switch_enabled path entirely to >> >> sugov_update_single() and take the spinlock around sugov_update_commit() >> >> in the one-CPU case too. > > [cut] > >> > >> > Why do you assume that fast switch isn't possible in shared policy >> > cases ? It infact is already enabled for few drivers. > > I hope that fast_switch is not used with devfs_possible_from_any_cpu set in the > one-CPU policy case, as that looks racy even without any patching. Which would be the only case in which sugov_update_single() would run on a CPU that is not the target. And running sugov_update_single() concurrently on two different CPUs for the same target is a no-no, as we don't prevent concurrent updates from occurring in that path. Which means that the original patch from Joel will be sufficient as long as we ensure that sugov_update_single() can only run on one CPU at a time.