Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4313991imu; Tue, 18 Dec 2018 12:35:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/VDpJjXv8MRqzm9hUg3uZkx95RBeHhS3Kh/PzBP0aSwpxwOA4vYvs+6yp/OXH3RQVKZVdph X-Received: by 2002:a17:902:1122:: with SMTP id d31mr17668133pla.246.1545165322481; Tue, 18 Dec 2018 12:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545165322; cv=none; d=google.com; s=arc-20160816; b=myc1WqXjCl3haUmVH2ufHoF4RMi4BEhjt0qdbRg8A76Itf+zQvaKyUNqCEwbFCPYQx RMYpBVmAGm1ljubJHbUfTLPYiRHCBYpfLwI9wDPOF+Bjg1FY2JC8Hsdbtk8uIsOS9hIL Gi5GVZrPO2v3UpdPdPQjUex1Mpe/t2Q3dxbsglkC8Mdp3Z8Tz+K/3Bm6a/9XzTj5GfHG c586lIOs8rUPBiCNRW39ZvqbsR/ACQfxq+TCaacfnhelx7AXZZEGAq2fM9mPaRwAhjiR 3Wb3YJfAriRiFZ3LValrpJ61m+BZzGRhxltTNeWzvu7hn6ZWGCz+A3ZMNp7x5+m5KJZU dJKA== 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=NqDF5UhWnQFdjY5+ifQ42/eAuC7wfEF19ZVzDTAfbT8=; b=hqAP+iYoaq/WaW1QOf0i1sHAK4ikiTOeNPxV64XFilQlyRW8xz7mrUuZukKNfyFziS bAEYZMvhyRpgivJO1lmNHU3xnZuD266EktT+O44U0iBWoquUYg8vF1z1W8fs+ydXT1pv WCuWhkOPrZKQS+jOBGCdA4bRDYVFmmDL5hfIzjQ+yCwwIy9itP13gI9M+9ZmS5UcMrQk Deyi+OA7mjwFPgh4XOCODFqEBERTNCs2rOoI53SOBWaCStnEZ3FWr+z09rKIHVXJBzx8 v+s7cGV9wZOCIicE6JlaqEMF8RbonHwfM8zYQLK3NwzDreJZKTeCZaQZMxgoR8waqSOJ vWuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZXQfdXZp; 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 1si14168904ply.409.2018.12.18.12.35.06; Tue, 18 Dec 2018 12:35:22 -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=ZXQfdXZp; 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 S1727169AbeLRU3j (ORCPT + 99 others); Tue, 18 Dec 2018 15:29:39 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50829 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbeLRU3i (ORCPT ); Tue, 18 Dec 2018 15:29:38 -0500 Received: by mail-wm1-f67.google.com with SMTP id n190so3969172wmd.0 for ; Tue, 18 Dec 2018 12:29:35 -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=NqDF5UhWnQFdjY5+ifQ42/eAuC7wfEF19ZVzDTAfbT8=; b=ZXQfdXZpJZ1VR/Ywx6+z8PawKuPd29vPvHE5LyZcscdpijjsm5jiaNxfZCJ7p95iob i/+Z7fReQZlj9q/6IBlYYYyJcUBsaFFkpOD2EQXFE4bMP3qoQLzLABrS1JdIiPLcPZWj diGdpzt3/2wdtx1KnHEE2D/vOeu2HIzQaE4HkI7WRXs92QWqtTY9KjJ9amVCzXmkp3Q8 7tMAa9g83AhbBHv09A1228AcDPA+JdMiaPN+/YGLkyYn2RvrtqsxakZGPL1ek6MTG71q /x3w1F3XBvgIVLYtVPI+xiZIYROS49oVTnqX6a3xMrGsARHQWe+ZvM2jOwaQoUWIufcs A+Ew== 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=NqDF5UhWnQFdjY5+ifQ42/eAuC7wfEF19ZVzDTAfbT8=; b=X4QZOKHHiWdTnMoy27Xow5+EWlNKeWvX+2V5UC2C5wsUyjYbpRuEvV7K8tVVOpenVy 0oOS0OYJy8FvA6Ex11WuAJCsecBXl1MBfmxOmu64QRp7fGLvbIBND+w2aCBp+p95ovf7 OenVWUa/11mFrQlgp8BVo1Kb3FbHVQRbXyoYb5n1wIq+N4kEtc715gBHdkckzb/qrhKD FTBup8XjahFQQEhsuraOWMYa0QcFQMj3GWhoX3dOwPeNuSXikczBZ9P2akSIndB998It FQO+EBe+Wda/INwoVgg/N8NWu7NVEV5Mzb8OE10y/htXpL7mY/U02P0/P4oQJx7oqGhW QM1Q== X-Gm-Message-State: AA+aEWZavwDkN56pQKGnonwyjOIE0nrLDfGPr3WZTRtBhFpNU2JGparZ GyZKmah5YLrff/90w866TBQCj7fUvfC+3TMpYjeqqQ== X-Received: by 2002:a1c:70b:: with SMTP id 11mr4750314wmh.74.1545164974736; Tue, 18 Dec 2018 12:29:34 -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: Suren Baghdasaryan Date: Tue, 18 Dec 2018 12:29:23 -0800 Message-ID: Subject: Re: [PATCH 6/6] psi: introduce psi monitor To: Joel Fernandes Cc: Johannes Weiner , Peter Zijlstra , Greg Kroah-Hartman , Tejun Heo , lizefan@huawei.com, axboe@kernel.dk, dennis@kernel.org, Dennis Zhou , Ingo Molnar , Andrew Morton , Jonathan Corbet , cgroups@vger.kernel.org, linux-mm , linux-doc@vger.kernel.org, LKML , kernel-team@android.com 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 11:18 AM Joel Fernandes wrote: > > 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. Sorry, did that by accident. > Also I was going to say the same thing, just usecs only is better. Thanks for the input. > 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. > >