DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feifei Wang <Feifei.Wang2@arm.com>
To: Alexander Kozyrev <akozyrev@nvidia.com>,
	Ruifeng Wang <Ruifeng.Wang@arm.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, nd <nd@arm.com>
Subject: RE: ARM power-saving measurements
Date: Tue, 4 Apr 2023 02:47:35 +0000	[thread overview]
Message-ID: <AS8PR08MB771851311B32B81D7C7970BCC8939@AS8PR08MB7718.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <DM5PR12MB24058BDD9EE9C3913320AD56AF8F9@DM5PR12MB2405.namprd12.prod.outlook.com>

Hi, Alex

Thanks for your attention.
Following I will share how to measure the power savings in Arm:

1.Test Setup:
1.1  ensure the dpdk version has been applied the wfe patch:
http://patches.dpdk.org/project/dpdk/cover/20230220085109.3463640-1-feifei.wang2@arm.com/
This is due to dpdk cannot support l3fwd-power  'power monitor' in arm before this patch

1.2 enable wfe instructions in arm:
dpdk/config/arm/meson.build:
'RTE_ARM_USE_WFE', false -> 'RTE_ARM_USE_WFE', true

1.3 build l3fwd-power
meson -Dexamples=l3fwd-power build  &&  cd build  &&  ninja

2. Test Command:
L3fwd-power uses 'power monitor' mode
sudo ./examples/dpdk-l3fwd-power -l 14-15 -n 4 -a 0000:13:00.0 -a 0000:13:00.1 -- -p 0x3 -P --config='(0,0,14),(1,0,15)' --pmd-mgmt=monitor
note: power monitor can just support more than 1 cores.

3. Power saving count:
For arm, wfe instructions can let CPU go into sleeping mode if it is always idle.
Thus, we have 2 ways to collect power saving info.

3.1 Using perf to record dynamic instruction number within 1 second:
$sudo perf stat -C <cpu id>, and then we can get CPU instructions number during a fixed time slot.
For examples:
Performance counter stats for 'CPU(s) 14':
          3,506.56 msec cpu-clock                 #    1.000 CPUs utilized
                 0      context-switches          #    0.000 K/sec
                 0      cpu-migrations            #    0.000 K/sec
                 0      page-faults               #    0.000 K/sec
     8,768,815,778      cycles                    #    2.501 GHz
        26,071,802      instructions              #    0.00  insn per cycle
   <not supported>      branches
           104,982      branch-misses

       3.506978873 seconds time elapsed

Dynamic instructions number for 1 second = 26,071,802/3.506978873

If we disable wfe in arm, we can find 'dynamic instructions number for 1 second'
increases significantly. This also means CPU is running at full load.

3.2 Get CPU power form BMC:
For ampere altra and thunderx2 server, we can look up CPU timely power from BMC.
For example, when we run l3fwd-power in thunderx2, server information->power->consumption:
-----------------------------------------------------------------------------------
CPU0 Current Power Consumption	69 W | 235 BTU/hr
CPU1 Current Power Consumption	0 W | 0 BTU/hr
CPU Power Limit Management Activated	
CPU Power Limit in Watts(1-150)	
-----------------------------------------------------------------------------------
If we disable wfe, CPU0 Current Power Consumption will increase, then we can know how much power we can save.

Best Regards
Feifei

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Saturday, April 1, 2023 1:29 AM
> To: Feifei Wang <Feifei.Wang2@arm.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org
> Subject: RE: ARM power-saving measurements
> 
> Hi Feifei/Ruifeng, any advice on power saving measurements on ARM?
> 
> Regards,
> Alex
> 
> > -----Original Message-----
> > From: Alexander Kozyrev
> > Sent: March 13, 2023 18:08
> > To: Feifei Wang <feifei.wang2@arm.com>; ruifeng.wang@arm.com
> > Subject: ARM power-saving measurements
> >
> > Hi Feifei/ Ruifeng, I can see that power management support on ARM has
> > been integrated successfully.
> > Could you please share the knowledge on how to measure the power
> > savings on this architecture?
> > What are the tools available there? Unfortunately, turbostat is not
> > supported on ARM. How did you test your feature?
> >
> > Regards,
> > Alex

      reply	other threads:[~2023-04-04  2:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DM5PR12MB24054E73276AF2E35087B391AFB99@DM5PR12MB2405.namprd12.prod.outlook.com>
2023-03-31 17:28 ` Alexander Kozyrev
2023-04-04  2:47   ` Feifei Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8PR08MB771851311B32B81D7C7970BCC8939@AS8PR08MB7718.eurprd08.prod.outlook.com \
    --to=feifei.wang2@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).