Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4292614imu; Tue, 18 Dec 2018 12:12:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkXyEH9sx/qx/UBsqPYLBr5E4t+UIY84JoRQN71e5DpjP8jUcaVXZwjh84MAyy2GbAK0u9 X-Received: by 2002:a17:902:a98c:: with SMTP id bh12mr17867464plb.31.1545163929221; Tue, 18 Dec 2018 12:12:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545163929; cv=none; d=google.com; s=arc-20160816; b=YGaRY5Qre6N8TJnlC2VuQN3Mvnm80hkzmuo7tfIpecwbuvz6jBHgN8ZV7AiO/DWM1c GT3EiXlsYDXpb0IMVw5Fsy8QOoI/xbc0AL9aV7Q1dMyKZcY3bHJOlN10tIxUprhhTu8J J0kN1OSHLBkE/5RbgvKHpQXumRnwgWvdsQ7EBK6IsVX8ddJGgl2AaV426zh0U7m8OK7o 2RhBasKzhB/yfxo6hO05v44FXM6R8/kgnWCeNMSnLgociLPdafSmDM8EEHK6McxLbyzh +atpt5Nv22UJZjCajokTbk66zyXdT/IqjhXLBMWYK+V47/XdEvo2mV/HWVz3a40zQ5YZ C9sg== 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=ntVX8JGSVBRYIvxgJqMMgLRiYpA1/HXcQRgPq+xYILU=; b=E+0NYe0upGs2JtQdMT1//KjUcu6dlX491WGKtY+xPPAcMyk3O4J17IzJCqZtTw9E0w +q01rcIh6DxU7J5WBvuoG6ebPWccXSk8e0hfdnRWCbM1SvEDb1LAv7rHRVz277K5WFt/ j/wwPN8h3YkX/Y0ZJPRruJZ2se+lmyqhQuSqgKaSrwHSYlq96/n3+Tz96rFiSL0ZFdWS +sqL/OlJnR4peOFdTcm7ycvhIlhWDUEZpwFW/4nhDfCZv7tuq4E/xK+vKp1v/b2wT5xl wmscOpi0LL9Rsly7o/giK5HsDjSELphUK4N/l9UbMZe5P8Dgrso7GhhVqiZLR4RoMRnq K6oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p+hqVbjS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si13623809pll.255.2018.12.18.12.11.53; Tue, 18 Dec 2018 12:12:09 -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=@google.com header.s=20161025 header.b=p+hqVbjS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbeLRTSg (ORCPT + 99 others); Tue, 18 Dec 2018 14:18:36 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46560 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726658AbeLRTSg (ORCPT ); Tue, 18 Dec 2018 14:18:36 -0500 Received: by mail-qt1-f193.google.com with SMTP id y20so19451713qtm.13 for ; Tue, 18 Dec 2018 11:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ntVX8JGSVBRYIvxgJqMMgLRiYpA1/HXcQRgPq+xYILU=; b=p+hqVbjSRoc0znn4/Ppyjld7TxzeVR+teGHodCuOXEGnphkluM9YpKGUIaPFtwT3Kb n6nl8Sq0R4rwx4NTEDWbCaYL3c/k8w0eGe7f9wy/GGpqJN2FeOK+lXMOIO20iAl71ixG r0EG74th5CPMI8L7WxF+1tqcFF3WEojosStDoYNaICiXbf9fVfW5ZrwqePhrzfcHIIt2 tSGmy7VfBPfEirLqCoDMYzGtaoZoFhR59AUAqK9a9Oka459DOGtSFLGHWa2YDqF9hKZ/ 3kl5Sx8WAot5dP8KzHDnU3be5O99L0PTB0rzPsbH0tvSNScRQo/VqwULribFqf0lJJQG RU1g== 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=ntVX8JGSVBRYIvxgJqMMgLRiYpA1/HXcQRgPq+xYILU=; b=ZW1L85wQ3ii1Hwx07obq2uvAxumMM5D+h9JXD5yITT6dsFB3e/lXA6o9NfEFCCEpBn a9yJIbKRXUKMQkyKuUVX9NqSBi9SE0OvMOopvtBSUkI3ISj42fwPNP0hnIPgkhu62Z4K WiPsAzRGnVNpra6Ok6IzEivIjHobr6TOufqb4wbCNeqO5hXFFxFrysH+DK4h4WTY8L0V /icB8i5hhma6KLv6eUkE6GPFBZOp5XnXBETUircs5NvrtGOKUNu0YWq9NYJpB3lwDY4X arQpyUw5X/bwNeTgxyMWZd1vOqFhleA5RN/gfDfg1lm8ODn0fctOzN0DWgjvMn9mNCuo 0bBA== X-Gm-Message-State: AA+aEWb0Tv56qX7xt5L5QWHk9pt/1jGniazAJztvOdVu/1Fua4mHFo2Q IuwGUB0IOM6xvmaFNp2cwQO3lr3S1PBGMCcg/tp/kg== X-Received: by 2002:ac8:2c34:: with SMTP id d49mr19137013qta.152.1545160713292; Tue, 18 Dec 2018 11:18:33 -0800 (PST) MIME-Version: 1.0 References: <20181214171508.7791-1-surenb@google.com> <20181214171508.7791-7-surenb@google.com> <20181217162223.GD2218@hirez.programming.kicks-ass.net> <20181218104622.GB15430@hirez.programming.kicks-ass.net> <20181218173000.GA4733@cmpxchg.org> In-Reply-To: From: Joel Fernandes Date: Tue, 18 Dec 2018 11:18:21 -0800 Message-ID: Subject: Re: [PATCH 6/6] psi: introduce psi monitor To: Suren Baghdasaryan Cc: Johannes Weiner , Peter Zijlstra , Greg Kroah-Hartman , Tejun Heo , lizefan@huawei.com, Jens Axboe , dennis@kernel.org, Dennis Zhou , Ingo Molnar , Andrew Morton , Jonathan Corbet , cgroups@vger.kernel.org, linux-mm , "open list:DOCUMENTATION" , LKML , "Cc: Android Kernel" 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, Dec 18, 2018 at 9:58 AM 'Suren Baghdasaryan' via kernel-team wrote: > > Current design supports only whole percentages and if userspace needs > more granularity then it has to use usecs. > I agree that usecs cover % usecase and "threshold * win / 100" is > simple enough for userspace to calculate. I'm fine with changing to > usecs only. Suren, please avoid top-posting to LKML. Also I was going to say the same thing, just usecs only is better. thanks, - Joel > On Tue, Dec 18, 2018 at 9:30 AM Johannes Weiner wrote: > > > > On Tue, Dec 18, 2018 at 11:46:22AM +0100, Peter Zijlstra wrote: > > > On Mon, Dec 17, 2018 at 05:21:05PM -0800, Suren Baghdasaryan wrote: > > > > On Mon, Dec 17, 2018 at 8:22 AM Peter Zijlstra wrote: > > > > > > > > How well has this thing been fuzzed? Custom string parser, yay! > > > > > > > > Honestly, not much. Normal cases and some obvious corner cases. Will > > > > check if I can use some fuzzer to get more coverage or will write a > > > > script. > > > > I'm not thrilled about writing a custom parser, so if there is a > > > > better way to handle this please advise. > > > > > > The grammar seems fairly simple, something like: > > > > > > some-full = "some" | "full" ; > > > threshold-abs = integer ; > > > threshold-pct = integer, { "%" } ; > > > threshold = threshold-abs | threshold-pct ; > > > window = integer ; > > > trigger = some-full, space, threshold, space, window ; > > > > > > And that could even be expressed as two scanf formats: > > > > > > "%4s %u%% %u" , "%4s %u %u" > > > > > > which then gets your something like: > > > > > > char type[5]; > > > > > > if (sscanf(input, "%4s %u%% %u", &type, &pct, &window) == 3) { > > > // do pct thing > > > } else if (sscanf(intput, "%4s %u %u", &type, &thres, &window) == 3) { > > > // do abs thing > > > } else return -EFAIL; > > > > > > if (!strcmp(type, "some")) { > > > // some > > > } else if (!strcmp(type, "full")) { > > > // full > > > } else return -EFAIL; > > > > > > // do more > > > > We might want to drop the percentage notation. > > > > While it's somewhat convenient, it's also not unreasonable to ask > > userspace to do a simple "threshold * win / 100" themselves, and it > > would simplify the interface spec and the parser. > > > > Sure, psi outputs percentages, but only for fixed window sizes, so > > that actually saves us something, whereas this parser here needs to > > take a fractional anyway. The output is also in decimal notation, > > which is necessary for granularity. And I really don't think we want > > to add float parsing on top of this interface spec. > > > > So neither the convenience nor the symmetry argument are very > > compelling IMO. It might be better to just not go there. > > -- > You received this message because you are subscribed to the Google Groups "kernel-team" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >