Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2745961rdg; Mon, 16 Oct 2023 13:36:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwz4XSWFf0PQrUiuDX9gQwzXst9ekRqkGkTrI8ppq8nk0kzHfDsuyVtJaCHpua91S6Cgi0 X-Received: by 2002:a05:6a00:18aa:b0:6bd:9281:9458 with SMTP id x42-20020a056a0018aa00b006bd92819458mr279076pfh.9.1697488588512; Mon, 16 Oct 2023 13:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697488588; cv=none; d=google.com; s=arc-20160816; b=mPzScKuZTHDfGQ9KxFAfvUZxv4GhXCIbIIpjJf1FmxjJEghvbHlLQM7PvHjQ+0vwv4 RIc00kf+R8FEEjlHkU5daeFb5XIpZRJjoBY/SGF6HFXQyMCCL3QuntYN2lEDixxwkxH6 35OkAVFcWwHoqIj6XAMdCZOoqMxoMLsDkbFF/HyIkgM4oMzEDk0mktHUAB+O955pAJib z93g/lnfaQAVpLF8F5DkWng9YPLaCS88HAqsq0mTnkX94B476rEw6PIKjx2vwN1r13qj Ycr7SEb3BEdizVj5X8N5jbPJ0W8q8PWj/rmMR+vHxHBYf9glSLy/U1qJOTEW5om9qTXp XuNA== 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=6c1GldrD3B2cqZQgxPbEoq6L4W0gya9yq2Y6Mb3na/A=; fh=KuL+coC1VMi9/3QtKKGZnc+sJf5ToJR+In64MMoLqog=; b=Nz6DMnpF4h2vMH6o6J09Lns+xLl03AA5tGcVR+ENnLOVzSEIltarL3WotMJydeI45Y hGYVtqkw5Khs7KC8xy9d1l4hPFA4CFj3qVGcqp2pXDY1VblJYG8QFUlNjSUZPFsumqVN chzH8/OEzntGi1xPlhnn3MRA1RX/HM2dowv4BXttIb+mR8a5An3pGSe9g74sRVH0pgFo 0ohFkfAKqg8evvQqL6rvbDJWeCy0Jc0ZRfI7s81ZEpPdeR4e8+bEtMg9C+AkKoqXj+GN tB7WSvVGzFZjZcX8OolYqCubZhmiOFzpkKEjante/Mo9qwaOReIRb99pCLxqnEa1a/NQ 6fnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BdYuJjt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o7-20020a056a0015c700b0068a6f6d9f7dsi654858pfu.57.2023.10.16.13.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 13:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BdYuJjt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 6E906807D8C4; Mon, 16 Oct 2023 13:35:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232792AbjJPUfF (ORCPT + 99 others); Mon, 16 Oct 2023 16:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbjJPUfE (ORCPT ); Mon, 16 Oct 2023 16:35:04 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D19FF95 for ; Mon, 16 Oct 2023 13:35:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DB7DC433C7; Mon, 16 Oct 2023 20:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697488502; bh=wGAWECJL1BSXHvDFaMRrPSWSvwLJYHm/I9oGrujUIAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BdYuJjt1GSddf/zrQSv0pdrIjA45COUidcM3VPniZAQYxH6XC0ZG9D6vybAA2cQup 52zTEMSK+XeARFKnvYMKoMgdyPQTIjKPZ/12kF2cXBG5DuAak0F/G3nR8qWJMBurxg sTl/k9XqmiNvsIVp3/SNK3ovp9J6mGzclimZPtps3yDU8qNdTM9ee0c9a7o62n6SUq tVF4akZRpQnRyCytZI/B238907lNT3PSowAQ3swgFY3KtiQEEI1+Dr5pe0snxJkHLH j8sU7x7O80bIuhLDA9OFTmBGYrDN9UrnzgDZGk8iXbS1gMDXu/uTvIAf4W8/4S7UEX qKZOAANLT63mA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 89DE040016; Mon, 16 Oct 2023 17:34:59 -0300 (-03) Date: Mon, 16 Oct 2023 17:34:59 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH v3] perf bench sched pipe: Add -G/--cgroups option Message-ID: References: <20231016044225.1125674-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 13:35:15 -0700 (PDT) Em Mon, Oct 16, 2023 at 12:55:33PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Oct 16, 2023 at 12:51:52PM -0300, Arnaldo Carvalho de Melo escreveu: > > Now back at testing with with cgroups. > Humm, even without the -G I get: > [root@five ~]# perf stat -e context-switches,cgroup-switches perf bench sched pipe -l 10000 > # Running 'sched/pipe' benchmark: > # Executed 10000 pipe operations between two processes > Total time: 0.082 [sec] > 8.246400 usecs/op > 121265 ops/sec > Performance counter stats for 'perf bench sched pipe -l 10000': > 20,002 context-switches > 20,002 cgroup-switches Same number, but then I forgot to add the 'taskset -c 0' part of the command line, if I have it: [root@five ~]# perf stat -e context-switches,cgroup-switches taskset -c 0 perf bench sched pipe -l 10000 # Running 'sched/pipe' benchmark: # Executed 10000 pipe operations between two processes Total time: 0.072 [sec] 7.231500 usecs/op 138283 ops/sec Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000': 20,002 context-switches 3 cgroup-switches 0.082855113 seconds time elapsed 0.007765000 seconds user 0.074020000 seconds sys [root@five ~]# perf stat -e context-switches,cgroup-switches taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB # Running 'sched/pipe' benchmark: # Executed 10000 pipe operations between two processes Total time: 0.093 [sec] 9.341800 usecs/op 107045 ops/sec Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB': 20,004 context-switches 20,003 cgroup-switches 0.103436330 seconds time elapsed 0.018109000 seconds user 0.063058000 seconds sys [root@five ~]# I.e. it works as in your results, but can you please spell out why that 'taskset -c 0' is needed to get these results? I wasn't expecting the same number of cgroup-switches when not using 'taskset -c 0' :-\ - Arnaldo