From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757132AbdEDUAu (ORCPT ); Thu, 4 May 2017 16:00:50 -0400 Received: from mail-sn1nam01on0114.outbound.protection.outlook.com ([104.47.32.114]:45384 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751628AbdEDUAs (ORCPT ); Thu, 4 May 2017 16:00:48 -0400 From: KY Srinivasan To: Vitaly Kuznetsov , "devel@linuxdriverproject.org" , "x86@kernel.org" CC: "linux-kernel@vger.kernel.org" , "Haiyang Zhang" , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Steven Rostedt , "Jork Loeser" , Simon Xiao Subject: RE: [PATCH v2 00/10] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements Thread-Topic: [PATCH v2 00/10] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements Thread-Index: AQHSs3mjzAhxREiv60OwEmDZQPfwqaHkoXgg Date: Thu, 4 May 2017 20:00:44 +0000 Message-ID: References: <20170412104326.19126-1-vkuznets@redhat.com> In-Reply-To: <20170412104326.19126-1-vkuznets@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetBy=kys@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-05-04T13:00:42.7808368-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:7::22c] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR03MB1419;7:DZTrW2K1nJSboSpz4oqw/q+INB3xGGIVOBuHiaBFxsF8ELto8mFc7SLkYC2FYgIyW7bD9Cr8957eL662pKk55WY/HRqaYS0EPrMYmk0is+R9t4n+D/x9EL0F5k/JQEj8YJQPvciyK/KKq/h+w7nAyzrJvam0LXNFbVvgWUPN65wSE4DER9LEYFZ+YdXrKDfset59FQdXaGdYjOoNsvbJuP8YWyqXuP829P4XVz3XGf+G8b3bserbPXkuc1GHWZpWYIQC7qupvi4McriAjIKu8rcEhI/ylqTkKm1lwp4nE9g32CzvvIRDOLNVedmDdg8eJTaQ5MVxfY8QPA65LvFbHneKoMz0wp8noTWsQ+PM7XU= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(39400400002)(13464003)(377454003)(9686003)(99286003)(189998001)(229853002)(77096006)(55016002)(54906002)(38730400002)(107886003)(53936002)(6506006)(102836003)(6436002)(575784001)(10290500003)(86362001)(4326008)(53546009)(2501003)(6246003)(478600001)(2201001)(5005710100001)(10090500001)(2900100001)(6116002)(25786009)(54356999)(50986999)(33656002)(8936002)(76176999)(81166006)(8676002)(2906002)(74316002)(7736002)(3280700002)(5660300001)(7696004)(122556002)(2950100002)(3660700001)(305945005);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1419;H:DM5PR03MB2490.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-ms-office365-filtering-correlation-id: 697eda92-a0ce-4a32-526f-08d493283fef x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:BY1PR03MB1419; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(6072148);SRVR:BY1PR03MB1419;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1419; x-forefront-prvs: 02973C87BC spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2017 20:00:44.4054 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1419 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v44K0sZJ030721 > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Sent: Wednesday, April 12, 2017 3:43 AM > To: devel@linuxdriverproject.org; x86@kernel.org > Cc: linux-kernel@vger.kernel.org; KY Srinivasan ; > Haiyang Zhang ; Stephen Hemminger > ; Thomas Gleixner ; Ingo > Molnar ; H. Peter Anvin ; Steven > Rostedt ; Jork Loeser > ; Simon Xiao > Subject: [PATCH v2 00/10] Hyper-V: praravirtualized remote TLB flushing and > hypercall improvements > > Changes since v1: > - Add a patch to build code in arch/x86/hyperv/ only when CONFIG_HYPERV > is > set. > - Add a patch to get maximum virtual/logical processor on Hyper-V. > - Add additional clobbers to hypercalls [Jork Loeser] > - Add variable header size support to rep hypercalls. > - Rename vmbus_cpu_number_to_vp_number -> > hv_cpu_number_to_vp_number > [K. Y. Srinivasan] > - Remove spinlocks from hyperv_flush_tlb_others() [Jork Loeser] > - Account for mm==NULL in hyperv_flush_tlb_others() [Simon Xiao] > - Add support for HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX/LIST_EX > hypercalls > to support >64 vCPUs [K. Y. Srinivasan, Jork Loeser] > - Move hyperv.h to arch-specific place [Steven Rostedt] > - Rebased to the latest char-misc-next tree. > > Original descriptions: > > Hyper-V supports hypercalls for doing local and remote TLB flushing and > gives its guests hints when using hypercall is preferred. While doing > hypercalls for local TLB flushes is probably not practical (and is not > being suggested by modern Hyper-V versions) remote TLB flush with a > hypercall brings significant improvement. > > To test the series I wrote a special 'TLB trasher': on a 16 vCPU guest I > was creating 32 threads which were doing 100000 mmap/munmaps each on > some > big file. Here are the results: > > Before: > # time ./pthread_mmap ./randfile > real 3m44.994s > user 0m3.829s > sys 3m36.323s > > After: > # time ./pthread_mmap ./randfile > real 2m57.145s > user 0m3.797s > sys 2m34.812s > > This series brings a number of small improvements along the way: fast > hypercall implementation and using it for event signaling, rep hypercalls > implementation, hyperv tracing subsystem (which only traces the newly > added > remote TLB flush for now). > > Vitaly Kuznetsov (10): > x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set > x86/hyper-v: stash the max number of virtual/logical processor > x86/hyper-v: make hv_do_hypercall() inline > x86/hyper-v: fast hypercall implementation > hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT > x86/hyper-v: implement rep hypercalls > hyper-v: globalize vp_index > x86/hyper-v: use hypercall for remote TLB flush > x86/hyper-v: support extended CPU ranges for TLB flush hypercalls > tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Thanks Vitaly; we have tested these patches on various platforms of interest. Acked-by: K. Y. Srinivasan Tested-by: Simon Xiao Tested-by: Srikanth Myakam Regards, K. Y > > MAINTAINERS | 1 + > arch/x86/Kbuild | 4 +- > arch/x86/hyperv/Makefile | 2 +- > arch/x86/hyperv/hv_init.c | 90 ++++++------ > arch/x86/hyperv/mmu.c | 270 > ++++++++++++++++++++++++++++++++++++ > arch/x86/include/asm/mshyperv.h | 148 +++++++++++++++++++- > arch/x86/include/asm/trace/hyperv.h | 34 +++++ > arch/x86/include/uapi/asm/hyperv.h | 36 +++++ > arch/x86/kernel/cpu/mshyperv.c | 14 +- > drivers/hv/channel_mgmt.c | 22 ++- > drivers/hv/connection.c | 8 +- > drivers/hv/hv.c | 9 -- > drivers/hv/hyperv_vmbus.h | 11 -- > drivers/hv/vmbus_drv.c | 17 --- > drivers/pci/host/pci-hyperv.c | 4 +- > include/linux/hyperv.h | 21 ++- > 16 files changed, 567 insertions(+), 124 deletions(-) > create mode 100644 arch/x86/hyperv/mmu.c > create mode 100644 arch/x86/include/asm/trace/hyperv.h > > -- > 2.9.3