From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 49620201 for ; Mon, 28 Nov 2016 15:15:32 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id t79so156012658wmt.0 for ; Mon, 28 Nov 2016 06:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=XN7r8Q6PALJbE0wOAc9lxtN0UTtYcf+V3sab4gsC7kA=; b=2CxrxuTGdlNbSb+10w8gTlAVbqN4fIBaEUVwx4RddJc61OkaeJ0Fle3+xDpRUN7uHy RyEUGIH5uyq97MnmFYmtwWxHrpmJcXGp8cyYeu0GROqX8pWsi7Fol+CZ90JNNnGDll3K qhrJIEuv0uTzds4DefmbOjV3JMzFdAeP5IcJpI8s5vI/q1sB+jnpBmxBOBubteUBCUr6 h/LCzVhjrgT/KpZlxSI7j/rU2nuwtscJrT5kRMCb7n60oEuuTOIpJCoYwWGFgtfEEcW0 +fpyqnmZEnyafF9fd464AjBE8En+aDrQUFwHm3RHtHEX6cdg7AjGwDvhQwgwps8qbAhR kzxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=XN7r8Q6PALJbE0wOAc9lxtN0UTtYcf+V3sab4gsC7kA=; b=lIECI/UAmrcQsrrN6oLAKGNaVaPChbzCNfSWYhpvZXqT+7UkvD6SFWG23OyzZwLSw9 C93OMIxucfeTPn7ecOeJq2KYSXPj07nN6X8lhhI1VNGmpal7n3x4Qmn6U6Js7baSQA+J 2yFErwLSFG01Jz57TFAf3uyWcKgOL0Ck/RsFgjRDAGOI57ScUGboQUFRZ2LRcQ3mhw9g 5ZrGgd4JdK3MSZ4PUxK/Q5A+Yy0ReK30ZKOSUEERJku282qvnqFavk4TFv+cDcn6T9S5 2kgdXsyXk7n26SIO53JIzuDLIVi0FY1Hxzd0xR8uEddb5SsFqRW4SmqJgJuz7+TCK+ND S9ug== X-Gm-Message-State: AKaTC02/PdUrYPDiGe1s+KFjEYZKF/ClvgzjhPWp8r/eOSR2C4GZokf7GmQRl/dE9gf4QaH6 X-Received: by 10.28.32.150 with SMTP id g144mr20352503wmg.46.1480342531994; Mon, 28 Nov 2016 06:15:31 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id ua15sm62716623wjb.1.2016.11.28.06.15.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 06:15:31 -0800 (PST) From: Thomas Monjalon To: Maxime Coquelin Cc: yuanhan.liu@linux.intel.com, john.mcnamara@intel.com, zhiyong.yang@intel.com, dev@dpdk.org, fbaudin@redhat.com Date: Mon, 28 Nov 2016 15:15:30 +0100 Message-ID: <1948533.ERBNTx8Tcb@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <20161123210006.7113-1-maxime.coquelin@redhat.com> <2842042.7AjAPCMeNN@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] doc: introduce PVP reference benchmark X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 14:15:32 -0000 2016-11-28 15:02, Maxime Coquelin: > > On 11/28/2016 12:22 PM, Thomas Monjalon wrote: > > 2016-11-23 22:00, Maxime Coquelin: > >> +You can use this qmp-vcpu-pin script to pin vCPUs: > >> + > >> + .. code-block:: python > >> + > >> + #!/usr/bin/python > >> + # QEMU vCPU pinning tool > >> + # > >> + # Copyright (C) 2016 Red Hat Inc. > >> + # > >> + # Authors: > >> + # Maxime Coquelin > >> + # > >> + # This work is licensed under the terms of the GNU GPL, version 2. See > >> + # the COPYING file in the top-level directory > >> + import argparse > >> + import json > >> + import os > >> + > >> + from subprocess import call > >> + from qmp import QEMUMonitorProtocol > >> + > >> + pinned = [] > >> + > >> + parser = argparse.ArgumentParser(description='Pin QEMU vCPUs to physical CPUs') > >> + parser.add_argument('-s', '--server', type=str, required=True, > >> + help='QMP server path or address:port') > >> + parser.add_argument('cpu', type=int, nargs='+', > >> + help='Physical CPUs IDs') > >> + args = parser.parse_args() > >> + > >> + devnull = open(os.devnull, 'w') > >> + > >> + srv = QEMUMonitorProtocol(args.server) > >> + srv.connect() > >> + > >> + for vcpu in srv.command('query-cpus'): > >> + vcpuid = vcpu['CPU'] > >> + tid = vcpu['thread_id'] > >> + if tid in pinned: > >> + print 'vCPU{}\'s tid {} already pinned, skipping'.format(vcpuid, tid) > >> + continue > >> + > >> + cpuid = args.cpu[vcpuid % len(args.cpu)] > >> + print 'Pin vCPU {} (tid {}) to physical CPU {}'.format(vcpuid, tid, cpuid) > >> + try: > >> + call(['taskset', '-pc', str(cpuid), str(tid)], stdout=devnull) > >> + pinned.append(tid) > >> + except OSError: > >> + print 'Failed to pin vCPU{} to CPU{}'.format(vcpuid, cpuid) > >> > > > > > > No please do not introduce such useful script in a doc. > > I think it must be a separate file in the DPDK repository or > > in the QEMU repository. > > Ok. The patch is under review on Qemu ML. > While it gets merged, I can add a link to its patchwork ID. > Ok for you? Perfect, thanks