From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31035C28CC5 for ; Wed, 5 Jun 2019 20:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 093982075B for ; Wed, 5 Jun 2019 20:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726532AbfFEU1W (ORCPT ); Wed, 5 Jun 2019 16:27:22 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:34755 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbfFEU1W (ORCPT ); Wed, 5 Jun 2019 16:27:22 -0400 Received: by mail-qt1-f195.google.com with SMTP id m29so119963qtu.1 for ; Wed, 05 Jun 2019 13:27:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wGxHiQlWFn1uiPqF46GhGASLxDFDSqAuue1nQQO+VCs=; b=I93DefSfGh7O0Gou3nkQ7Sxim+Emlk3mgU9BuoAjJ8azFiAkKrNcWNi15dZYfCbDBk 6UCWNs1l3e9vXSAqLXf3dRA8rqYKtwnSs/SCTXm/sUYDcFZD3j70H3spJXup36+m8pFe dWuw6rHkSEdmDtlwfILSF4LqpU3iiAeluWIpAHioT5vZMq1dalzUpjR7DknGhozuQR87 eYavGUIyjWAK1K6Qj/0f5BLADWVhEDkqrpYaLX8ohJqlGEHmcQdg+C975Aq4eN3oc8UH bOGb4nPz0JZ4punI8oUcFHEt29DbnGgl6OtZ+pMH6WJAy0xAzydz/40Bv/sERN37CpFn 5sOw== X-Gm-Message-State: APjAAAVBvb1pgI+jv1LMlMTEB0lVMcjgnYB2q5SP8pzNIxczvW9AM6t+ MYhRiEmd9NPWkQecAt3TthcqVw== X-Google-Smtp-Source: APXvYqyNZwCNllCffk9CW8iJVZnNw6kyLj1Wao5YfIYT6vXREYUpwAyvBsDlsGb5oilKvNDw7Zk3hw== X-Received: by 2002:aed:254c:: with SMTP id w12mr37738167qtc.127.1559766441824; Wed, 05 Jun 2019 13:27:21 -0700 (PDT) Received: from redhat.com (pool-100-0-197-103.bstnma.fios.verizon.net. [100.0.197.103]) by smtp.gmail.com with ESMTPSA id z20sm14611825qtz.34.2019.06.05.13.27.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 05 Jun 2019 13:27:20 -0700 (PDT) Date: Wed, 5 Jun 2019 16:27:18 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, peterx@redhat.com, James.Bottomley@hansenpartnership.com, hch@infradead.org, davem@davemloft.net, jglisse@redhat.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, christophe.de.dinechin@gmail.com, jrdr.linux@gmail.com Subject: Re: [PATCH net-next 0/6] vhost: accelerate metadata access Message-ID: <20190605162631-mutt-send-email-mst@kernel.org> References: <20190524081218.2502-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524081218.2502-1-jasowang@redhat.com> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Fri, May 24, 2019 at 04:12:12AM -0400, Jason Wang wrote: > Hi: > > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling like SMAP. This is done through setup kernel address through > direct mapping and co-opreate VM management with MMU notifiers. > > Test shows about 23% improvement on TX PPS. TCP_STREAM doesn't see > obvious improvement. > > Thanks Thanks this is queued for next. Did you want to rebase and repost packed ring support on top? IIUC it's on par with split ring with these patches. > Changes from RFC V3: > - rebase to net-next > - Tweak on the comments > Changes from RFC V2: > - switch to use direct mapping instead of vmap() > - switch to use spinlock + RCU to synchronize MMU notifier and vhost > data/control path > - set dirty pages in the invalidation callbacks > - always use copy_to/from_users() friends for the archs that may need > flush_dcache_pages() > - various minor fixes > Changes from V4: > - use invalidate_range() instead of invalidate_range_start() > - track dirty pages > Changes from V3: > - don't try to use vmap for file backed pages > - rebase to master > Changes from V2: > - fix buggy range overlapping check > - tear down MMU notifier during vhost ioctl to make sure > invalidation request can read metadata userspace address and vq size > without holding vq mutex. > Changes from V1: > - instead of pinning pages, use MMU notifier to invalidate vmaps > and remap duing metadata prefetch > - fix build warning on MIPS > > Jason Wang (6): > vhost: generalize adding used elem > vhost: fine grain userspace memory accessors > vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() > vhost: introduce helpers to get the size of metadata area > vhost: factor out setting vring addr and num > vhost: access vq metadata through kernel virtual address > > drivers/vhost/net.c | 4 +- > drivers/vhost/vhost.c | 850 ++++++++++++++++++++++++++++++++++++------ > drivers/vhost/vhost.h | 38 +- > 3 files changed, 766 insertions(+), 126 deletions(-) > > -- > 2.18.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F8C4C28CC5 for ; Wed, 5 Jun 2019 20:27:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D92D22075B for ; Wed, 5 Jun 2019 20:27:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tmso7Eav" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D92D22075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0mKNTfwAUTjLBUQiEfu72RHPQUwtBVftMBc5OQYkNLw=; b=Tmso7EavZ8+6sb FY49b84NQ75YE4SUsKmytC6+EusWnHGDOfzK5ve3WW9/PDnSy9/eopj+ph6n3KtlAmdO2bUU4aouX PEWaaL7FlSwaC5NaevuqskiLeZqD2u2uEqWpfYkuVX9ztIRCo2XLoBatamSBVZ3qGmwCMkIuQrO1Z 3voqfROLfs1slD8IQC9azluPfSmypELFzbDSbb2cagaYvkSUr7nPjWNcxVnl524ta6ZTIlZBcIxm2 JjRXdUPF+lIpUVAGy37Pfm7uS0BPIFXLF0tZaqY+6UpRPoy1UsIRbeyBlT4Abp/7wfaFKwCqJ7IoS hImU7KbZJ2wDAqufBg8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYcVO-0003UM-MG; Wed, 05 Jun 2019 20:27:30 +0000 Received: from mail-qt1-f196.google.com ([209.85.160.196]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYcVJ-0003T3-Nm for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2019 20:27:28 +0000 Received: by mail-qt1-f196.google.com with SMTP id d23so111741qto.2 for ; Wed, 05 Jun 2019 13:27:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wGxHiQlWFn1uiPqF46GhGASLxDFDSqAuue1nQQO+VCs=; b=A6SCwuyEIN8eWuhLPg3WYssqG7FYkcVvNBYbrMe0/3QuvXGePRWjDshoshgYFQwFQq 9+jN8uCXACDmnHgFxP8g0TaLFZPH5Hyi/JhIzRU2o6YmA6/j2qihElKHSC8lVsjl2INk ZlS8TRdvUXYqYEo85g0QmS0c2Lxrn1nrqbbAOigEeEvZn4c6AcUYNT2LOMTZKcd5IRxR ILfxUoGsard2/P0wiN/x3NGsI6uKV20NwnyRaFZ8vcS0b+vViFvoIeQa5usrUctEE+E1 SPdSQ31TWf8PTS2M9utZR3H5M77nuE0jE1h3/9nRQ3YpXjdAAjrwUMpH2dSFWc5S+aFg 4tFA== X-Gm-Message-State: APjAAAUxIbGcAXL2VBVkMKv1VKuVj1tXkU8Fw3355vvLT/XSv6UcCrJQ +Zua25xgEqIrXfSW4NHk75JkOkAYz88= X-Google-Smtp-Source: APXvYqyNZwCNllCffk9CW8iJVZnNw6kyLj1Wao5YfIYT6vXREYUpwAyvBsDlsGb5oilKvNDw7Zk3hw== X-Received: by 2002:aed:254c:: with SMTP id w12mr37738167qtc.127.1559766441824; Wed, 05 Jun 2019 13:27:21 -0700 (PDT) Received: from redhat.com (pool-100-0-197-103.bstnma.fios.verizon.net. [100.0.197.103]) by smtp.gmail.com with ESMTPSA id z20sm14611825qtz.34.2019.06.05.13.27.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 05 Jun 2019 13:27:20 -0700 (PDT) Date: Wed, 5 Jun 2019 16:27:18 -0400 From: "Michael S. Tsirkin" To: Jason Wang Subject: Re: [PATCH net-next 0/6] vhost: accelerate metadata access Message-ID: <20190605162631-mutt-send-email-mst@kernel.org> References: <20190524081218.2502-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190524081218.2502-1-jasowang@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190605_132725_774929_98C89FBD X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hch@infradead.org, linux-parisc@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, peterx@redhat.com, virtualization@lists.linux-foundation.org, James.Bottomley@hansenpartnership.com, linux-mm@kvack.org, jglisse@redhat.com, jrdr.linux@gmail.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, christophe.de.dinechin@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 24, 2019 at 04:12:12AM -0400, Jason Wang wrote: > Hi: > > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling like SMAP. This is done through setup kernel address through > direct mapping and co-opreate VM management with MMU notifiers. > > Test shows about 23% improvement on TX PPS. TCP_STREAM doesn't see > obvious improvement. > > Thanks Thanks this is queued for next. Did you want to rebase and repost packed ring support on top? IIUC it's on par with split ring with these patches. > Changes from RFC V3: > - rebase to net-next > - Tweak on the comments > Changes from RFC V2: > - switch to use direct mapping instead of vmap() > - switch to use spinlock + RCU to synchronize MMU notifier and vhost > data/control path > - set dirty pages in the invalidation callbacks > - always use copy_to/from_users() friends for the archs that may need > flush_dcache_pages() > - various minor fixes > Changes from V4: > - use invalidate_range() instead of invalidate_range_start() > - track dirty pages > Changes from V3: > - don't try to use vmap for file backed pages > - rebase to master > Changes from V2: > - fix buggy range overlapping check > - tear down MMU notifier during vhost ioctl to make sure > invalidation request can read metadata userspace address and vq size > without holding vq mutex. > Changes from V1: > - instead of pinning pages, use MMU notifier to invalidate vmaps > and remap duing metadata prefetch > - fix build warning on MIPS > > Jason Wang (6): > vhost: generalize adding used elem > vhost: fine grain userspace memory accessors > vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() > vhost: introduce helpers to get the size of metadata area > vhost: factor out setting vring addr and num > vhost: access vq metadata through kernel virtual address > > drivers/vhost/net.c | 4 +- > drivers/vhost/vhost.c | 850 ++++++++++++++++++++++++++++++++++++------ > drivers/vhost/vhost.h | 38 +- > 3 files changed, 766 insertions(+), 126 deletions(-) > > -- > 2.18.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel