Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1265107rdg; Fri, 13 Oct 2023 16:11:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTUsqpoZadcMKZiyFEprE9F2Ih2Coopg0f99zIjLyrTIbliNm0JYXMeOeFpofFm6A6eLL9 X-Received: by 2002:a05:6a20:8e26:b0:16b:b900:2d6d with SMTP id y38-20020a056a208e2600b0016bb9002d6dmr22177548pzj.60.1697238672560; Fri, 13 Oct 2023 16:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697238672; cv=none; d=google.com; s=arc-20160816; b=T/kTDcOD1owWK8xhg5VTuUaYdZVI0/id+IMPuHunweA9QfpONEDkY0YPYxQ5DQHoDO AMSW7vKMrWplKxgbkH8BUKByxJ6qslER+cr0HIsljxREmBNj7n4bNZvcjQACwhj4/Z74 lSO053LGMBBCVcRdZuJT70oNChn/TYRVMYCUmQKDKMEQmpnBgcw6MxPgec5arNaiDyhG tzWN+47ZHz+oQNiSHciKva/59YsmUbofIPN7Sfga7IGwNYarBHOnAL3HxU42RySO94Ic TKunXva0QmTy0YhTI0khZ1Z8osbsKc9rqMNEpvJG2x8l1nSUH99kSN4urQ4E0YYcfUAs I3Uw== 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; bh=5zyoMwRmnGpc1e7z6hgmZ4ztEIm7SoP0Krd8PSOWv0I=; fh=CeF/sjQ1/PrJQCA4zRbl8D8Nn/XbFr9/r1euVnuk+qw=; b=t/arUIrXeJV/R9+2FR7OpLDqIkMk3IjxOp4XgXKEjMTS35lIqIj7Dx2IYUWZfAPqQx R+qNjz3bwrJf519Nz1lh2Xr+5qBjgosI+2HwZFy9K1e8UgjSOHNxrHkfAULDkb/YI5qK pLlCnzh6YQgC1qGWCb72wvigDqfl9raiktObnaqcAxTJnfDtQKpsPIHcC0kT8ZFlLEhD iRR4Peo3knVZsvoqbsyY4ZLVut8dlTsSFuvV2VmlCX0gXqOrDC+KNmCgVZJAeX5dB0Bz 8ChfxQgOx/Y7rCbWW1PjWVz+Vmcuq7yWVTSxtmmdVr7H7ZxYzEE6OtgemYJxDAN2Hq2n JlRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g11-20020a1709026b4b00b001c5b9ef1d34si5155399plt.340.2023.10.13.16.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 16:11:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 09D5082B8ABC; Fri, 13 Oct 2023 16:11:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232273AbjJMXKv convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Oct 2023 19:10:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjJMXKv (ORCPT ); Fri, 13 Oct 2023 19:10:51 -0400 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C0F5B7; Fri, 13 Oct 2023 16:10:47 -0700 (PDT) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5aaebfac4b0so811097a12.2; Fri, 13 Oct 2023 16:10:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697238647; x=1697843447; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jq9pAKpCKsuW4M2aVm6h0RSLxNTvAXPcyrENZdgKoqs=; b=FLbHlM+CsBJ1q47Hkw7tR76MR8JZFIFLdspOuZXXKY3TZRKhgR1znJVNuN5lfOxBRa MXGX021UqhZYrnHPIYseFgpoH/0x4HH7hVB+JclKdNHOb2k6SMjjribeHW+vRyieApz4 S7Q5mZ8pXrUmH4wcf8+v9+fgvQNJ7BoYsJxXtGRfm6T8JSWhPfQBlvA7dgGJm4XCEfDM 9kbaVcbMQAa2xNrbqMBnKCnRlWMChCPoM6igRwfwjPoPbm2GtsQcr9rcrvTwAJRV4dzq Ok+dgXPMCqwJh2eryd3C/P6E4XC5Ra86r94qHASgcLj43rQ3HI3PL5hjwkw2+G/v0GZJ RKCA== X-Gm-Message-State: AOJu0Yy5+mxUrgjh7GGMu1oTHcLCAQlrRL+YtrY239W3nbE6bXTl/4EK go4JtluQ9irS9RuWJrDjA55eUVF6w3aFpBUlYbI= X-Received: by 2002:a05:6a20:3c90:b0:171:75ef:d636 with SMTP id b16-20020a056a203c9000b0017175efd636mr14759284pzj.21.1697238646628; Fri, 13 Oct 2023 16:10:46 -0700 (PDT) MIME-Version: 1.0 References: <20231004204741.985422-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Fri, 13 Oct 2023 16:10:35 -0700 Message-ID: Subject: Re: [PATCH] perf bench sched pipe: Add -G/--cgroups option To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 16:11:10 -0700 (PDT) On Fri, Oct 13, 2023 at 4:03 PM Arnaldo Carvalho de Melo wrote: > > Em Fri, Oct 13, 2023 at 03:57:27PM -0700, Namhyung Kim escreveu: > > Hi Arnaldo, > > > > On Fri, Oct 13, 2023 at 3:41 PM Arnaldo Carvalho de Melo > > wrote: > > > -rw-r--r--. 1 root root 0 Oct 13 19:22 /sys/fs/cgroup/AAA/cgroup.procs > > > [root@quaco ~]# ls -la /sys/fs/cgroup/AAA/cgroup.threads > > > -rw-r--r--. 1 root root 0 Oct 13 19:22 /sys/fs/cgroup/AAA/cgroup.threads > > > [root@quaco ~]# ls -la /sys/fs/cgroup/BBB/cgroup.threads > > > -rw-r--r--. 1 root root 0 Oct 13 19:22 /sys/fs/cgroup/BBB/cgroup.threads > > > [root@quaco ~]# ls -la /sys/fs/cgroup/BBB/cgroup.procs > > > -rw-r--r--. 1 root root 0 Oct 13 19:22 /sys/fs/cgroup/BBB/cgroup.procs > > > [root@quaco ~]# > > > > > > [root@quaco ~]# perf bench sched pipe -G AAA,BBB > > > # Running 'sched/pipe' benchmark: > > > cannot enter to cgroup: AAA (written=-1, len=6, errno=Operation not supported) > > > cannot enter to cgroup: BBB (written=-1, len=6, errno=Operation not supported) > > > # Executed 1000000 pipe operations between two processes > > > > > > Total time: 6.303 [sec] > > > > > > 6.303221 usecs/op > > > 158649 ops/sec > > > [root@quaco ~]# > > > > > > I'm certainly missing something here :-\ > > > > Try to enable some cgroup controllers first. Like > > > > # echo +cpu > /sys/fs/cgroup/AAA/cgroup.subtree_control > > # echo +cpu > /sys/fs/cgroup/BBB/cgroup.subtree_control > > [root@quaco cgroup]# echo +cpu > /sys/fs/cgroup/AAA/cgroup.subtree_control > [root@quaco cgroup]# echo +cpu > /sys/fs/cgroup/BBB/cgroup.subtree_control > [root@quaco cgroup]# perf bench sched pipe -G AAA,BBB > # Running 'sched/pipe' benchmark: > cannot enter to cgroup: AAA (written=-1, len=6, errno=Operation not supported) > cannot enter to cgroup: BBB (written=-1, len=6, errno=Operation not supported) > # Executed 1000000 pipe operations between two processes > > Total time: 6.267 [sec] > > 6.267680 usecs/op > 159548 ops/sec > [root@quaco cgroup]# cat /sys/fs/cgroup/AAA/cgroup.subtree_control > cpu > [root@quaco cgroup]# cat /sys/fs/cgroup/BBB/cgroup.subtree_control > cpu > [root@quaco cgroup]# uname -a > Linux quaco 6.5.6-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Oct 6 19:02:35 UTC 2023 x86_64 GNU/Linux > [root@quaco cgroup]# Hmm... I don't know, I've tested it on v1 only ;-p I'll take a look. Also I found a bug, will fix too. Thanks, Namhyung diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c index 1103fd658d5d..25236f339b90 100644 --- a/tools/perf/bench/sched-pipe.c +++ b/tools/perf/bench/sched-pipe.c @@ -118,9 +118,9 @@ static void enter_cgroup(struct cgroup *cgrp) /* try cgroup v2 interface first */ if (threaded) - fd = openat(cgrp->fd, "cgroup.procs", O_WRONLY); - else fd = openat(cgrp->fd, "cgroup.threads", O_WRONLY); + else + fd = openat(cgrp->fd, "cgroup.progs", O_WRONLY); /* try cgroup v1 if failed */ if (fd < 0)