Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1149332pxb; Thu, 9 Sep 2021 22:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLx8Leh1ohgae7d2aA4iFWKHXimhSjvAmVR5gEQQJ9fL5JAfOEqBO5de6CPiy1dbxR9KTW X-Received: by 2002:a05:6e02:1aa5:: with SMTP id l5mr4941126ilv.271.1631251354232; Thu, 09 Sep 2021 22:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631251354; cv=none; d=google.com; s=arc-20160816; b=mkd3D6iUWJHxsnofdgZmz3cF2jHipa4dA5qoz5hA7KAoo5684EtbxBmva2pQeiaCGt tY7mv9Ym9+hSXD9hM59RoCzEGS0Bryt8FTPWwr/TvPKlUK9lhTyFrSQDPT3q43blPTiP ZJojIsc37DWP/HhMxW+zgukrlW8SbEFQ7Ck0q3EMh1pIITCGGOafBsSB212vyslu9xIT OYzf88nNfqhku4qsUzvy07HxEY2dpC56sRD7TZxm4MGNpjEGhZoYPgu0HDpBHnejTf0S o6i7UPLW+6mHDksK35Q0XG/89HbpUKq5YwahEiA9PPG4UQ/RawhVKYkWzL4i81+FLcAI Ps4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=BLhN9TB7Ol57sQQenKldl3mBRnGfktBhdGML7tJA3Ww=; b=TpJyPk9sjpAvKh9j8nBUD2D8oSpPYrjDFSoxO4BDTP3WVm9MrSWULLK1RZEXp4XtyG omiLpbW/fFuoIbUImEzSVitLpYKStYyTwpMa/mLJUQnB6rTFDrCuiPw270wpKIFxj7wF 9ESMbFGtzrbG3YqU36iguYgBIaScXVFgNvmM6ULq2VKCAd4lswDsJ/9dAfTAuRXFF+gt Enfkz7hAA6URQF9QWTAUv9gfAL6Wv9loU8QPPV/8KyBaVtZLf3KlR8Frxx/p8YwDpte6 6oseVMej4nTEXnPSMkTViBjUpIf240UKlCnZmpaJHW2lBPrrF8Ciwz5R48jpi56UHYu/ O05Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hktGUARw; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si3971714jaa.118.2021.09.09.22.22.21; Thu, 09 Sep 2021 22:22:34 -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=@gmail.com header.s=20210112 header.b=hktGUARw; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbhIJFWg (ORCPT + 99 others); Fri, 10 Sep 2021 01:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbhIJFWf (ORCPT ); Fri, 10 Sep 2021 01:22:35 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60C80C061574; Thu, 9 Sep 2021 22:21:25 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id gp20-20020a17090adf1400b00196b761920aso653515pjb.3; Thu, 09 Sep 2021 22:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BLhN9TB7Ol57sQQenKldl3mBRnGfktBhdGML7tJA3Ww=; b=hktGUARwAQCs/rrNssjoUdMQwzYznSPdwPBEc22JFRemiMjqWDYzC+dzoeKKnhYkVR T1b9xEKSF9jGM3t4ejhzDcAaOuGihnjoM9wLUIwdzf6I5vcf9wB0X50i3Gb5YBshLTWc 3sTMapg+S1zz4st1unMb/cCOtt9BhQZrX/Bf8xUH/lTpNzBqpRF9fbSgYBO27yA2QBRK yJUoMwX+D+ewzlDCf/az0x2t/2YAi4ZQlePOx7sTheh6r5kQs8nw9NK8aU1cNzQ0X6ub iXVl4yiUgKfBdndy432DD6n6kFiQjT+nsjoFj4Wfro0AVRddDjIAZl1OBvQTR6FZMYvC 5HeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BLhN9TB7Ol57sQQenKldl3mBRnGfktBhdGML7tJA3Ww=; b=D791Mab4RPEMUuFl1mvD23Qjw/V5Z9XKVXn48/cm8LmUX55dhKk/7tzjhby8tnACPE fndymAyGr+p4ghofzmff/IKQ0NRkTtCTWhnza8DWj4Cl57BKpm3nzNsOIttH8NjULq8K K6EFU+BIHW+ghwwOQ2XwYvdAYtPDGUfb9JZWIxfJ03oGLowiOyUwMgiYRlbmR7JEnrJO vyTHD8q7t7FkyOwBEYnCvQrtz094UDsdulRsR/+vFTCD13I6YDFSBN9PNTY4UBio90tH aVfAdTijjehWgMNrcAPuYNM2R6MaBYvPpZ6McYIaLcs79J+nPpdqtXpCjqAP32smPYdG uf8Q== X-Gm-Message-State: AOAM530L2B+YxzlEGB8PLk+x3kkF+eRpZ92exjblaBpQutGYPGGpKrOB fAY+2INSb/gTrJ6nEPNPtfnO2e3FpGo= X-Received: by 2002:a17:90a:b881:: with SMTP id o1mr7485690pjr.141.1631251284688; Thu, 09 Sep 2021 22:21:24 -0700 (PDT) Received: from [192.168.255.10] ([203.205.141.113]) by smtp.gmail.com with ESMTPSA id m18sm3866631pjq.32.2021.09.09.22.21.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 22:21:24 -0700 (PDT) Subject: Re: [RFC PATCH 1/3] misc_cgroup: introduce misc.events and misc_events.local To: Vipin Sharma , =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org References: <988f340462a1a3c62b7dc2c64ceb89a4c0a00552.1631077837.git.brookxu@tencent.com> <20210909143702.GA13761@blackbody.suse.cz> From: brookxu Message-ID: <8259b666-f3a4-6788-880c-38d679414bcb@gmail.com> Date: Fri, 10 Sep 2021 13:20:37 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vipin Sharma wrote on 2021/9/10 1:08 上午: > On Thu, Sep 9, 2021 at 7:37 AM Michal Koutný 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. Yeah, this is more reasonable. But there is still one question, whether we need to be consistent with other cgroup subsystems, events and events.local under v1 should not support hierarchy? >> >> 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 = css_misc(seq_css(sf)); >>> + unsigned long count, i; >>> + >>> + for (i = 0; i < MISC_CG_RES_TYPES; i++) { >>> + count = atomic_long_read(&cg->events[i]); >>> + if (READ_ONCE(misc_res_capacity[i]) || count) >>> + seq_printf(sf, "%s %lu\n", misc_res_name[i], count); >> >> 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 too.) >> > I am inclined more towards "%s.max", it looks nice to see the resource > name before its corresponding events I also think %s.max may be more intuitive.