From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 70DC523C for ; Wed, 18 Jul 2018 17:23:16 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C944421221; Wed, 18 Jul 2018 11:23:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 18 Jul 2018 11:23:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=CL73f0Rw57lfMimAa1NbYTXk28 kn62EWZ8h3Sc2Wmlg=; b=nREwTyBhtbmmCE3yCUzis0P57OfrhSsCfPJWB4kOED jw9rHRtW3v17d2BDBjIb9pf8qwreUfw1/JdSUVucjI92c/W155bxFDH7iQYe6CUO V7j74NjZ4SPJZyYYkviCAHekUlnRlZlVthROShlmMZle+3vWaKRz8vngbJO0E3eQ E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=CL73f0 Rw57lfMimAa1NbYTXk28kn62EWZ8h3Sc2Wmlg=; b=naCN+lw3zD3tg9AB5Sw6MC upjBp8FA8an/rJYmVYBpV4t6swkb6aj0qLM7HJPj1Z/YV7D4nHd9XyQiPnvMuuxa Bun9uJh6KNc/QDlGvmiloIBdy7yEB+Ex6FN3s+svLTErEwoPIJ2Ue4UHOFew9pMM h2L41Bku1HoXFXnha9csOCdHb7tWKYJlQneblx94AeAAgJL+lrhtCCrSMvtB5AMV Hk/uLFvnKay2o62tsBGzcP8Xq9J3rta2RZcWmqEFLDWr5RZhETw1pG4PvUGfoE2R Ht+2OvA8hMDHW84HUCfBrJnqlPRyit66gP5P4h+ECfLr4HOx7SEl0DseBcOiO8ug == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (unknown [37.173.231.123]) by mail.messagingengine.com (Postfix) with ESMTPA id D95CA10268; Wed, 18 Jul 2018 11:23:11 -0400 (EDT) From: Thomas Monjalon To: "Hunt, David" Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, arybchenko@solarflare.com, ferruh.yigit@intel.com, bruce.richardson@intel.com Date: Wed, 18 Jul 2018 17:23:04 +0200 Message-ID: <2801427.dF8lWImUGl@xps> In-Reply-To: References: <20180621132414.39047-2-david.hunt@intel.com> <4106595.MIdGIlFmsH@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [0/9] examples/vm_power: 100% Busy Polling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 15:23:16 -0000 13/07/2018 10:43, Hunt, David: > > On 13/7/2018 9:33 AM, Thomas Monjalon wrote: > > 13/07/2018 10:31, Hunt, David: > >> Hi Thomas, > >> > >> On 12/7/2018 8:09 PM, Thomas Monjalon wrote: > >>> 26/06/2018 11:23, David Hunt: > >>>> This patch set adds the capability to do out-of-band power > >>>> monitoring on a system. It uses a thread to monitor the branch > >>>> counters in the targeted cores, and calculates the branch ratio > >>>> if the running code. > >>>> > >>>> If the branch ratop is low (0.01), then > >>>> the code is most likely running in a tight poll loop and doing > >>>> nothing, i.e. receiving no packets. In this case we scale down > >>>> the frequency of that core. > >>>> > >>>> If the branch ratio is higher (>0.01), then it is likely that > >>>> the code is receiving and processing packets. In this case, we > >>>> scale up the frequency of that core. > >>>> > >>>> The cpu counters are read via /dev/cpu/x/msr, so requires the > >>>> msr kernel module to be loaded. Because this method is used, > >>>> the patch set is implemented with one file for x86 systems, and > >>>> another for non-x86 systems, with conditional compilation in > >>>> the Makefile. The non-x86 functions are stubs, and do not > >>>> currently implement any functionality. > >>>> > >>>> The vm_power_manager app has been modified to take a new parameter > >>>> --core-list or -l > >>>> which takes a list of cores in a comma-separated list format, > >>>> e.g. 1,3,5-7,9, which resolvest to a core list of 1,3,5,6,7,9 > >>>> These cores will then be enabled for oob monitoring. When the > >>>> OOB monitoring thread starts, it reads the branch hits/miss > >>>> counters of each monitored core, and scales up/down accordingly. > >>> It looks to be a feature which could be integrated in DPDK libs. > >>> Why choosing to implement it fully in an example? > >> I needed to set up a thread that looped tightly (~100uS interval) and > >> run it on it's > >> own core. From what I have seen in other cases, it is usually the > >> application that > >> allocates cores and decides what to run on them. I did think about putting > >> some of it in a library, but for this case I thought it made more sense > >> to keep > >> it purely as a sample app. > > I feel some code deserves to be in a library. > > For instance, having different implementations per CPU is a good reason > > to make a library. > > > > Sure, I can look at moving some of the code into the library in a future > release. However, I > believe it's OK as it is for the current merge window. I will to pull it in 18.08-rc2 if compilation is fine.