Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp710278pxb; Thu, 9 Sep 2021 10:12:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmPoNgymCRpyiPdL/oNcRsl6gRmx1ASItrCCdpprJ2p4nYtaMuSgFQxU1iU0IL9U1652+b X-Received: by 2002:a1c:f405:: with SMTP id z5mr4175741wma.33.1631207525022; Thu, 09 Sep 2021 10:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631207525; cv=none; d=google.com; s=arc-20160816; b=hhvElky05/5n17Cdm7pSD8eJSwyblosgMYjOA/8XpdvMMyCsyBqvoXgQs0hlh6O3G/ Qijo1ccsEb93w5HnvzzPfynnkh/Yh5sDq0WxKZkXXtr2JBmtKADPBKxTW450+3hrhLOj tij7EBrzABXl37pSf9+N3BiIZY+MaFZNlTqzZv0Sw44VTMWwDXG/f10z1ZMR/Np5zKGC VlS3OhpcPs4h9blCMr+d6RT6vaYBXrZHjHnZl0lwAOk7BTfPxetDHDOfKUiwXNkiRB0N qO8LMx8mZc+37HsB0UbFElrciSTgtFJzBAynHvJpgcB3A5Ks5BqodscWiW700h3uQxwG TAog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4R55HGCX5kPiIdGourKYRqDLwJwF8WpWPhWp89wjZ2A=; b=0KKE4OIUtCBHGpmz6CPOjKUYdvKr8kfarQyxE3MAxRjbwVBZDhh3nw9Q6axvjTtKpi 0/9flpgJGEp/w9jXW2f/7ga564yFuc6XfwgKWPQbUC3RzWLKTdSk82u/+U8JaoO++wy8 D/qLUaoh8vBiONMBbaIgegOyQfkFcp1IJm5T3uG1//+3Sw6+xG1QpcUyKTY4Ah9Coobc paz/AQxjvUBqxqPNUHaOEi2FHAO7Xmcco/yDIwy7mRt2JjYHLU3tlnMl851ZoR+rQoDw V3L6ag1ufVBxVgaIWmQixgNMZwAyVx2jIWeH28/FUZ9PKai3pnlcNRbnlQGVfBdFH6Ee JIOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WFfYj9RQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e1si3351566edl.348.2021.09.09.10.11.32; Thu, 09 Sep 2021 10:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WFfYj9RQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S240916AbhIIRK2 (ORCPT + 99 others); Thu, 9 Sep 2021 13:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240915AbhIIRK1 (ORCPT ); Thu, 9 Sep 2021 13:10:27 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 995E3C061574 for ; Thu, 9 Sep 2021 10:09:17 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id e23so5055537lfj.9 for ; Thu, 09 Sep 2021 10:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4R55HGCX5kPiIdGourKYRqDLwJwF8WpWPhWp89wjZ2A=; b=WFfYj9RQ/+CHwxP1EKydAwy0xyGRTKUWvF0EFylgCw0ummpVqqR+qlnHE+s3nGMV6H wNaPrKSGu0kuhKvxKWfgzSkrzk0UxkNFJozak3jVIUxe2Y+3X/V8L7sXP97u9eLsXyLr RnbvRWT28a4GkgJpXu/dG/sxpesgDHNLad6n4bn62ObFCt2BXe6Ivcx+AEBCTzI73F3f r4kknqIged7tVjFk6Q1n70H111zzqGzXRwWg55hm6vsEgYhXV8qsi04oNyVtONp8Wljt ee2XR2txI//CcTYgL+xIqkSHWzf2bT/xRXsQ89LxaL6nRIg9rI871PPoK25LrT6GnC3U lRpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4R55HGCX5kPiIdGourKYRqDLwJwF8WpWPhWp89wjZ2A=; b=22eqo9yqRu+sucJFTJSQP1TgsR3bj5QqjjdOZ+UtWo8tMXxGK9Dmy9p66v9QRBe32G 2MAFjGKHagjvONWfYkOm2z+EbIUT+psuaMt1VpneL1U6Oh+AO3BH6xYi4wVh16cg+6rf RulKIJ3EpTtJWHVsdXv0vK/WJLUdn5qH96xXqYNItrSqT+WZaYIYxNhtiiLjiCY0qdx9 XMK+zwVqtQBDOlEHhPkzrMWqkyB0DqcVTr7I/nzG3ESv928f+EgphktLHl5iVPnjrrEb Y2iHPBBnyfwPY1D4YIeT2e2ebI/HfXJaWLul6cSrXDGAmlCoI405bfNvmFaRZ5hIpOM/ U9BQ== X-Gm-Message-State: AOAM531ZndaFKMutbmkH/YoMHl+b5w4HkV3ocPrF7L1y0WU+I0h0CyU6 wC9VDVPYZf9L1bVx5ydtKf2gHiBO6EI4oZAB8SjZ0iR4J6Y= X-Received: by 2002:a05:6512:3393:: with SMTP id h19mr665587lfg.13.1631207355736; Thu, 09 Sep 2021 10:09:15 -0700 (PDT) MIME-Version: 1.0 References: <988f340462a1a3c62b7dc2c64ceb89a4c0a00552.1631077837.git.brookxu@tencent.com> <20210909143702.GA13761@blackbody.suse.cz> In-Reply-To: <20210909143702.GA13761@blackbody.suse.cz> From: Vipin Sharma Date: Thu, 9 Sep 2021 10:08:39 -0700 Message-ID: Subject: Re: [RFC PATCH 1/3] misc_cgroup: introduce misc.events and misc_events.local To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: brookxu , tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 9, 2021 at 7:37 AM Michal Koutn=C3=BD wrote: > > Hello Chunguang. > > The new version looks like a good step generally. > > My main remark is that I wouldn't make a distinct v1 and v2 interface, > it's a new controller so I think the v2 could be exposed in both cases > (or in other words, don't create new v1-specific features). I agree with Michal. We can have the same interface for v1 otherwise there will not be any form of feedback in v1 for failures. > > On Wed, Sep 08, 2021 at 01:24:34PM +0800, brookxu = wrote: > > +static int misc_events_show(struct seq_file *sf, void *v) > > +{ > > + struct misc_cg *cg =3D css_misc(seq_css(sf)); > > + unsigned long count, i; > > + > > + for (i =3D 0; i < MISC_CG_RES_TYPES; i++) { > > + count =3D atomic_long_read(&cg->events[i]); > > + if (READ_ONCE(misc_res_capacity[i]) || count) > > + seq_printf(sf, "%s %lu\n", misc_res_name[i], coun= t); > > More future-proof key would be > seq_printf(sf, "%s.max %lu\n", misc_res_name[i], = count); > or > seq_printf(sf, "max.%s %lu\n", misc_res_name[i], = count); > > (Which one is a judgement call but I'd include the "name" of event type t= oo.) > I am inclined more towards "%s.max", it looks nice to see the resource name before its corresponding events.