Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1290069rdb; Fri, 20 Oct 2023 14:14:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkS14zO6NQBmngmr2Ft4FxrJGbLNU3gtDG/H82pGN8iFL7V3+0Sapn0XoXKt9gWevjlmzP X-Received: by 2002:a17:90a:8b07:b0:27d:5584:4cce with SMTP id y7-20020a17090a8b0700b0027d55844ccemr2887758pjn.12.1697836478500; Fri, 20 Oct 2023 14:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697836478; cv=none; d=google.com; s=arc-20160816; b=R53ay8kGiinzkHYq3IFhozaMsh/mUZSRxotDZ9QwRk2djpMpAd4y64ggPpAwXPWJK7 K+SgHdgrlLKi6NspBcJ8jHP26MisaKDWeiHy9lImroJIk4iqvc5C/Nt7Sry0fKoWr3TO fJ7boDFOP7aweDV2+rF9qZAMGrBwYtExWDq558ovO04jH/UpbSqNWB1heHK8agoswL5t K03QskcoJlK+g9r7/UGRAVHh+vLSxs4m2zyo2dniH/FbUTBjgT22bn96wISVbRzk0A6T Z18DlbzAvN0VNZ0CCJIxbNkpf8ZRILrx5IFGDi/PT5hhy8JXS3C4Urg/hE9DfmdbqpGq q35w== 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=ByRwXpms0srDCvXLKIeclCy7vxoD48N+X48UFN+Re64=; fh=Q3t6MaIy+pOWq1KhnTGVCzmNodqBOq2R9o6FZreW4Yk=; b=L8/aA66iZB9uRpr36AKeQhShMnpLvX4zHH3WOMTvWfqcAE4DncMVOlJdIKsK2SUEhv 10vRZpUZn4Au5NspeeBGY21WURzYZ0sfvcSBE5KT97Wp4t9xQKlA1Hgfzb1pJQDvDxhU wyfDIm4M4FDxkvzeRMIHiXGys0fuoOTz7CsfTBWPJns04D1vlZEuFIHDY0+lbjW5P2DH qNoxNCsc20aJ8f/IPBLTJvdptmqiGnnxl7qXyM8ubw3truqHGGoxy40pItrVbc7ytKK8 BvZLuZMY9n1IWtNNL2ba/LrLrB5sZJGe2Ef/cgnF4NfG2m9BmtUZ5Yl8InGmv1jT62KW EtMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 100-20020a17090a09ed00b002681fea6d14si5006982pjo.79.2023.10.20.14.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 14:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 2056B81BBA0D; Fri, 20 Oct 2023 14:14:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjJTVOJ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Oct 2023 17:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjJTVOI (ORCPT ); Fri, 20 Oct 2023 17:14:08 -0400 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30CD5D60; Fri, 20 Oct 2023 14:14:02 -0700 (PDT) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-27d329a704bso961208a91.0; Fri, 20 Oct 2023 14:14:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697836441; x=1698441241; 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=+xqiAA7yUfcFNuJz9yt0cNSqQJ4Uy3bxmqwHDlGSMdg=; b=X9I7DJntWiszeBtiKkAP0U17+rnkOyVfsAclN6i5ekgGD2VQzpcCRhBMdbwm9ANE+l UEDjWubM92hPhw6AzolrwmyKEIJkJzQyMEhd97ldijvg8NTbATqKHTBWU9aUsimrUhYf h6HCtPsrbDGhmbi6bWiPgv/jh1LVh3SdHom7EpZOPLaFs+AA02xWMzmXK8y3W+4Xxa69 Pkc94z0H+CJtPouKiN8saK+ALyAYRnbSHKAObhgDUFqwz63mhm9wOFfaHAORn1/IqOLt abitL/rtpGpyjfZHVlYjb6kACWh5mZaue9sgzKCFrHLnUxCxOrBaQJbP4a3Chq8YGsLE CTDA== X-Gm-Message-State: AOJu0YwITC4aWqHUaEKgL/5yjuRhzrX7FrC9T3ZQ1PiPOaT4hlCayJep pudwj8gFvXWI4aPlQAxyvPkD7vy0IMdL/YEuJmDdx9we X-Received: by 2002:a17:90b:3d87:b0:27d:1532:e736 with SMTP id pq7-20020a17090b3d8700b0027d1532e736mr2690226pjb.48.1697836441372; Fri, 20 Oct 2023 14:14:01 -0700 (PDT) MIME-Version: 1.0 References: <20231017202342.1353124-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Fri, 20 Oct 2023 14:13:50 -0700 Message-ID: Subject: Re: [PATCH v4] perf bench sched pipe: Add -G/--cgroups option To: Arnaldo Carvalho de Melo , Ingo Molnar Cc: Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 14:14:23 -0700 (PDT) On Fri, Oct 20, 2023 at 1:32 PM Arnaldo Carvalho de Melo wrote: > > Em Tue, Oct 17, 2023 at 01:23:42PM -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. > > > > 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 > > Tested-by: Arnaldo Carvalho de Melo Thanks a lot Arnaldo! Ingo, can I keep you Acked-by here? (forgot to add in v4, sorry!) Thanks, Namhyung > > [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.063 [sec] > > 6.367500 usecs/op > 157047 ops/sec > > Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000': > > 20,004 context-switches > 4 cgroup-switches > > 0.084191842 seconds time elapsed > > 0.008332000 seconds user > 0.067193000 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: > no access to cgroup /sys/fs/cgroup/BBB > Failed to open cgroup file in BBB > Hint: create the cgroup first, like 'mkdir /sys/fs/cgroup/BBB' > no access to cgroup /sys/fs/cgroup/AAA > Failed to open cgroup file in AAA > Hint: create the cgroup first, like 'mkdir /sys/fs/cgroup/AAA' > > Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB': > > 2 context-switches > 1 cgroup-switches > > 0.010356533 seconds time elapsed > > 0.003209000 seconds user > 0.007122000 seconds sys > > > [root@five ~]# vim /tmp/bla > [root@five ~]# > [root@five ~]# mkdir /sys/fs/cgroup/BBB /sys/fs/cgroup/AAA > [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.079 [sec] > > 7.987800 usecs/op > 125190 ops/sec > > Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB': > > 20,008 context-switches > 20,007 cgroup-switches > > 0.089361029 seconds time elapsed > > 0.009004000 seconds user > 0.065376000 seconds sys > > > [root@five ~]#