Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp409828ybv; Thu, 13 Feb 2020 02:50:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwGKa9ZA/f6rlMa9kG7G8U/pY6JUOVWCvPf4ngjro5Sg+dNjKFV+xFEX8/QvyS1KSSXlfzw X-Received: by 2002:aca:44d7:: with SMTP id r206mr2444276oia.33.1581591046807; Thu, 13 Feb 2020 02:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581591046; cv=none; d=google.com; s=arc-20160816; b=nf+jnEPGq3PR27Soz8axbdZPPAXfoFUGlbrn4LUtArTbZvDgZh65YXGPfgFc2zF4q1 n/ftmHf51yLbMLoKNpcguOB9/VX+lphpT21AgkzV+pOg5a/XwgNbpcmpHpZV6iKqJ9tm tWNHtbJouNCSEahg7fSZC7JLkn1a05RaYnYUJKlJxlNXnb5M5/XM/hBg0t+HbxLWmIHS Djxrp8q6/7253bayGuN4uIeMkLBY3y1PI2LypcdJD5cR2Eg5JZneMPWurjmKepp0xekp mLa65g28PuihHlk0x6jyHTleNtdOyiMNLwD88rSO10IvK/DNMO0fpx9wEFMlvcq8biKI jH0A== 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 :in-reply-to:references:mime-version:dkim-signature; bh=fXD3NUgPbItg+EdbT8uLMEndhqABRKbmudYKP6OTeTY=; b=B57eMGVHZ/dyV9F9IFkOVNYQsr8papHpN2IeNDA6R+zKMkNNwQiXbab3zJ5k+tm/fQ uL1/09dlBb3g7fI8p2e99SiDqBsAi2G+Nj/D1uuFjMU0Tss+a5KNkYEAB77X06NzqY6z yi66WLwCFgwnxY6+U7v8ZpH4wwj85FMuLm4dIGWQVga5gQSGm2Lx1eQQ7RMrYLWqC1a/ umvB2YBQIv0DLr3JiACsiYCa0fLsDbn8uxtIGUDXBMkjNE82aEF+2ObXzzfjghlyi+Y9 leUPJVb3GzUJwQB6vYDRESSNjr5ym8Z47mSCRH/0eIohP7FEE9Exk/FgcEs9jHVkShXm UXeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tEK2VNcv; 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=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 i11si818875otc.105.2020.02.13.02.50.34; Thu, 13 Feb 2020 02:50:46 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=tEK2VNcv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729761AbgBMKuL (ORCPT + 99 others); Thu, 13 Feb 2020 05:50:11 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35244 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729494AbgBMKuL (ORCPT ); Thu, 13 Feb 2020 05:50:11 -0500 Received: by mail-lj1-f194.google.com with SMTP id q8so6052687ljb.2 for ; Thu, 13 Feb 2020 02:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fXD3NUgPbItg+EdbT8uLMEndhqABRKbmudYKP6OTeTY=; b=tEK2VNcvvP/Fs8a1XfdgXwXHAOHziWPxDjtTpPnfs0njU9+Z6xURNs5tbTbgsTdhSW et1ExI+S25xMn8ikhaf6LY2hQYaT/rUBAXh1BHPIKTWBgP7ZSeNgtHjVcK9ZngzHSOkl vPICzA2jGI8DmbzYqLApFKFoX975IEB1MmG03dvR6DqsTw7rGYzIyY7gZGZwa3eXqkRW Utt1Bo/TtLIjbpDEJRtVBZLLo/SjZ8ZsTMh293ElsFy4pLGm3jN0cnVO6dFG0fGRgW89 k74WVlE/X7pNhpyUq9Px0DDsLB3Tl8hTxC+lLpMRpidtjejTf/TJCdh/B/pKLIA2JUfQ v7qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fXD3NUgPbItg+EdbT8uLMEndhqABRKbmudYKP6OTeTY=; b=aHYhm5MglvIegtr5M0ta1L3mUJWM8TL5D61hZIVr6ZJwqLz8JMVI5CruTM4363WFPe C49uLh4jQOS/XrxSzhO1fbTUzsWzxqgxZ9Mh6UKbDYRoKA+GfFZUAAk7Tdh1S9p2KGyN ssQNfe9UHsVcKxjJTqjnYpl5aBLfzDiJ09CQpcXmo139mJ24wiqDLtKZginNqzHM0LJD 9ibrsXICAwXJrNA/L4REp5vEdaH0KRVFBwccNtsWACpKsvwp33ZfsC0JyPOh1syBO0WB vIf+CWXKWvWtqTX69SUGfmTU3f/7L2803+CQVviOJTFI01ZwuTqyoetVga0j0xScQjrp sS0w== X-Gm-Message-State: APjAAAWbXKkz65B/ayYeiG9kAn/rDlWQLdDYNwHIMqlyJ/IsLtFa2HgG 1BB3QlHR+LZBp/kXczB731jX4NIfuyGGvlWTtj8mqcInOP4= X-Received: by 2002:a2e:8e91:: with SMTP id z17mr10501916ljk.13.1581591007651; Thu, 13 Feb 2020 02:50:07 -0800 (PST) MIME-Version: 1.0 References: <1654227.8mz0SueHsU@kreacher> In-Reply-To: From: Amit Kucheria Date: Thu, 13 Feb 2020 16:19:56 +0530 Message-ID: Subject: Re: [PATCH 00/28] PM: QoS: Get rid of unuseful code and rework CPU latency QoS interface To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , LKML 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 Thu, Feb 13, 2020 at 3:47 PM Rafael J. Wysocki wrote: > > On Thu, Feb 13, 2020 at 8:10 AM Amit Kucheria wrote: > > > > On Wed, Feb 12, 2020 at 5:09 AM Rafael J. Wysocki wrote: > > > > > > Hi All, > > > > > > This series of patches is based on the observation that after commit > > > c3082a674f46 ("PM: QoS: Get rid of unused flags") the only global PM QoS class > > > in use is PM_QOS_CPU_DMA_LATENCY, but there is still a significant amount of > > > code dedicated to the handling of global PM QoS classes in general. That code > > > takes up space and adds overhead in vain, so it is better to get rid of it. > > > > > > Moreover, with that unuseful code removed, the interface for adding QoS > > > requests for CPU latency becomes inelegant and confusing, so it is better to > > > clean it up. > > > > > > Patches [01/28-12/28] do the first part described above, which also includes > > > some assorted cleanups of the core PM QoS code that doesn't go away. > > > > > > Patches [13/28-25/28] rework the CPU latency QoS interface (in the classic > > > "define stubs, migrate users, change the API proper" manner), patches > > > [26-27/28] update the general comments and documentation to match the code > > > after the previous changes and the last one makes the CPU latency QoS depend > > > on CPU_IDLE (because cpuidle is the only user of its target value today). > > > > > > The majority of the patches in this series don't change the functionality of > > > the code at all (at least not intentionally). > > > > > > Please refer to the changelogs of individual patches for details. > > > > Hi Rafael, > > > > Nice cleanup to the code and docs. > > > > I've reviewed the series, and briefly tested it by setting latencies > > from userspace. Can we not remove the debugfs interface? It is a quick > > way to check the global cpu latency clamp on the system from userspace > > without setting up tracepoints or writing a program to read > > /dev/cpu_dma_latency. > > Come on. > > What about in Python? > > #!/usr/bin/env python > import numpy as np > > if __name__ == '__main__': > f = open("/dev/cpu_dma_latency", "r") > print(np.fromfile(f, dtype=np.int32, count=1)) > f.close() > > And probably you can do it in at least 20 different ways. :-) Indeed, I can, just not as straightforward as "cat /debugfs/filename" when you don't have python or perl in your buildroot initramfs. Some hexdump/od acrobatics will yield the value, I guess. > Also note that "echo the_debugfs_thing" does the equivalent, but the > conversion takes place in the kernel. Is it really a good idea to > carry the whole debugfs interface because of that one conversion? > > > Except for patch 01/28 removing the debugfs interface, please feel to add my > > > > Reviewed-by: Amit Kucheria > > Tested-by: Amit Kucheria > > Thanks!