Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1254740rdg; Fri, 13 Oct 2023 15:42:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHixe2cp3JV8iqOX+rnB7XC/j/ukNVF9Cu+xi16BMpvfAo6Y2a/y3uwqsSi4p2BUf7OV4G8 X-Received: by 2002:a92:cc4b:0:b0:357:5d18:a47b with SMTP id t11-20020a92cc4b000000b003575d18a47bmr4886527ilq.17.1697236924660; Fri, 13 Oct 2023 15:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697236924; cv=none; d=google.com; s=arc-20160816; b=WNQ0jgUnr4DQhCOPI8Ppj+qLJlmBwV16hFZ4k6A8ROET7DclD3wyfuyYue8qF4HIOp NRo7GH5NBDk49yLcU3esP3iDp2zXv64hY60Lzw67VoDmNsWogQMSl6Sjv308xjDD0Ygt gx6WYlcWIYn8vYnylunZcVWhSoEQGie7XS7hRhOYENIpdsL4+fVlyT9qFVnZn20r/2pe Ezf0+EfjG/lVeowh1Eo8jKOBFv17mrgNN3cOS9KJalkzXiv07EfrXJk4wqo20yUWSlSV qpp1lHTTfRWZcfHNetQwb8f8ILabUWl3op8mcvGNB8Uvrsd+blmyUD3LbOiJ+PLiHLuC uZvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EPFRG+ZSSdy8IM93G+sFRZ8gy+sLlSCoFpcKp34xso0=; fh=ATmfKs0sIZhJDElMvHKl6znBn0xqTXk0lYgtDjKC1GM=; b=FLuGbyNjMSVklVw2+RIDjuvWC99Ecp1NyGof3mfGe1V1oWGy2FUa6z0zEIUFbNmYSf dDgv4O/PFQD0/IZP3IXpCeRrbzTB/PtcvgFS2XCKrt707GL2Szerjm0tU/nVbr6MUynm MLtwj8uwTk5etbMrV8pWKXHtPWa7cIyy9xXjrVMnTKzP/a3/ZujPI6Apn26kGC/W8KmB Woi814m7cULpgr1mv1nuRXKd2x4vxCHsSsFNFi060aDLxRf3SG++W4nukVVmqfeElOTu Qm4ZfBx+D5moH9KO4Xy6CKLIG5otRT4IW8M8cy8b0M81UqiXSS4BvvSuEjZQ+hgUT27E RDPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hG4W2RMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s5-20020a17090aad8500b00262ff3a4545si1002621pjq.169.2023.10.13.15.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hG4W2RMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 49DFD8095811; Fri, 13 Oct 2023 15:41:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbjJMWlF (ORCPT + 99 others); Fri, 13 Oct 2023 18:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjJMWlE (ORCPT ); Fri, 13 Oct 2023 18:41:04 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE41AB7 for ; Fri, 13 Oct 2023 15:41:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30DC1C433C7; Fri, 13 Oct 2023 22:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697236862; bh=w5/NPLmu7MtZsZVVLte85Zwy4WqEOc54OWUu9qmyrvk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hG4W2RMUHsaEqwOCNz9stfK3ICMpL0xfiA9ZCgXuk8FIXM3kbo5nGojmEyK9sl0Ve TnUhs/Zc+bCg+zc7bDqgcRs5td6gA73tzZ1yK3AadQFKGiP/uA3Xk7gp01CDs9bKwM 6oHEF/nSrFGVz62YyXvkJCLGVpUr2nBcpGFvw5x2mRnSkwsGy2W9R9a27LHau64i7m 6qQ8INPJ4lRW/o3NljNqUV735NSWWnuVj0rDHyjMsONa0Y0QOcDCFLa5zHuLS/8XZN fjLbN9+pIftaXA0nFJXkELV7wfRw4l+TBJn1qQ8EMoWY4LCl5ypmYRfSQ5aUVF2sko hbkgbJUskQRKw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 7A01A40016; Fri, 13 Oct 2023 19:40:58 -0300 (-03) Date: Fri, 13 Oct 2023 19:40:58 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf bench sched pipe: Add -G/--cgroups option Message-ID: References: <20231004204741.985422-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004204741.985422-1-namhyung@kernel.org> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 15:41:13 -0700 (PDT) Em Wed, Oct 04, 2023 at 01:47:41PM -0700, Namhyung Kim escreveu: > The -G/--cgroups option is to put sender and receiver in different > cgroups in order to measure cgroup context switch overheads. > > Users need to make sure the cgroups exist and accessible. > > # perf stat -e context-switches,cgroup-switches \ > > taskset -c 0 perf bench sched pipe -l 10000 > /dev/null > > Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000': > > 20,001 context-switches > 2 cgroup-switches > > 0.053449651 seconds time elapsed > > 0.011286000 seconds user > 0.041869000 seconds sys > > # perf stat -e context-switches,cgroup-switches \ > > taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB > /dev/null > > Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB': > > 20,001 context-switches > 20,001 cgroup-switches > > 0.052768627 seconds time elapsed So I tried with: [root@quaco ~]# perf bench sched pipe -G system.slice,user.slice # Running 'sched/pipe' benchmark: cannot enter to cgroup: system.slice cannot enter to cgroup: user.slice # Executed 1000000 pipe operations between two processes Total time: 6.301 [sec] 6.301478 usecs/op 158692 ops/sec [root@quaco ~]# Should't it bail out when not managing to enter the cgroups? Also: [root@quaco ~]# mkdir /sys/fs/cgroup/AAA [root@quaco ~]# mkdir /sys/fs/cgroup/BBB [root@quaco ~]# [root@quaco ~]# perf bench sched pipe -G AAA,BBB # Running 'sched/pipe' benchmark: cannot enter to cgroup: AAA cannot enter to cgroup: BBB # Executed 1000000 pipe operations between two processes Total time: 6.397 [sec] 6.397830 usecs/op 156302 ops/sec [root@quaco ~]# -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 :-\ - Arnaldo