Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4799142ybv; Tue, 11 Feb 2020 03:44:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxJk70xVecB+/BNwMGGtJ9ZBPgHpZ9cg91XV1pPclDoYvZjjL9C/7uinw7zlyA4FNbReKeD X-Received: by 2002:a9d:806:: with SMTP id 6mr4658154oty.90.1581421455344; Tue, 11 Feb 2020 03:44:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581421455; cv=none; d=google.com; s=arc-20160816; b=XE/74jc1cna7TTFTWfRefZZoMIQGHlqj+eObcq+z3nU5u8FdrMEnw1eCnFtdEM4gW5 bHPOMXcXX5d4lW6Jzw7FksbGvBwwMwYPi26NaX0LmwybfHOtoMDw3y+wXjaJPrZK/rH4 IC/+1dQhWssV+QFBV4f6tYPS0AswBWR92yh/1B7w+G3hmPUqlkstIW2C1i+weJBsujbc 9jei3kdKuAMf5zzb2S8WP4Gyl8vdluegzXeUSpCGjypXqmLeZIGvMt5ywkvb6yyYQ/UB K1PeGCvQpGpXkRVlZIx+oBH7UwdVept264qPqjHxFDXOauLpr3CmVRldYd6FWDwmUQsR yDug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zHDZin+UZkvf57OXTiAEW8DlkByJ4zhgnoIg7b8L+NE=; b=FpJHal11DOMYuS6Eluvk9Pz+sKojIAX6kGG86janE+ybluxEWxD4+xNpHBJGAnT2v/ I+LFzH5UD1pDrIQSz/rwj3xBOxrTmIbRUP/4U/nSNwWxnQ/Xzo8J3J7zjuzYdKJFv0IA wOY1NOa2pIUSwIgCVXd/u3HxCzNkAHNfglHUq2dCe80Ca/K3HcdPPnxMkrzt2/of8mni KdmE0uKzihUOfBMh7j9pmdxi6aEElqaAYV3IXMKOJ/DK5HMazIU9mJJ1+jXnhpzhcltB vrJbYifxM237jYBglfuE0XsWPbcySF2YQeGp7j6HIB/kKdlGLjKHKT+GWyJJOABfSO3n NV2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=faJGcOsb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si1663038oix.48.2020.02.11.03.44.03; Tue, 11 Feb 2020 03:44:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=faJGcOsb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbgBKK5U (ORCPT + 99 others); Tue, 11 Feb 2020 05:57:20 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60630 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727558AbgBKK5T (ORCPT ); Tue, 11 Feb 2020 05:57:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581418638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zHDZin+UZkvf57OXTiAEW8DlkByJ4zhgnoIg7b8L+NE=; b=faJGcOsbQf9aU4IBHUxmzJEiwYkD+olJJ/UH+ZW2HYb4qPGWub9FRIDhhU5xrWyB6N7s8J uqLZMjo73Jgitoa+EyhmsNAo4dFc4l6petiYQcMmYno4aBRLBj5S5OCbizA40GWH+nzAEG VxHn6MznHSUPx5HUC1b4SYk/LiD3IY0= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-K3g9EBoYNGu5hbs7vf_xWg-1; Tue, 11 Feb 2020 05:57:15 -0500 X-MC-Unique: K3g9EBoYNGu5hbs7vf_xWg-1 Received: by mail-qt1-f197.google.com with SMTP id c8so6299378qte.22 for ; Tue, 11 Feb 2020 02:57:15 -0800 (PST) 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=zHDZin+UZkvf57OXTiAEW8DlkByJ4zhgnoIg7b8L+NE=; b=OXLgaVf3tzuM9Uoq4hlAurf+RPGU8UGmNlu7SizHGgF+nn0eZ8T+KEY6bHMPUe32zT O4L/+3iJM6pOLNthCIOKFuFzrlWou29ZiUyHxbDtOZJzwJluu+Sd0ljFSPrJqrkMl3xx rZ3RkfhK/LWNfBSFgFcEAV48NNO3E1Kd3UZ/rHKPW23OhnGDhKqDcjvqJoGd8iwiVDoz +9NSpRqLyErNNNnDFHx/gMiyK6o49mxe/+fXXgUpm8TkO3QH4V98hvcnHx5QbjeUjSc/ jnsRxVI+u9hqaYIeknuVRJ9+/TtkrUU+HAuv3eNKfJG6F02GK8I5fEGtPTV1s3McGCd0 oeIA== X-Gm-Message-State: APjAAAWyOfGsIvO7iqk87lO0F8vdSVd8MJyCquuPjrZdfBEs2PnWbNzm pzM7C+fUjTC26SbAR3/6s64C6ny9tS9v+X0Fhn3nelzN2/ZaMMqVWyRTKQH2LIOCmwHTDmx9nJP M+V5SXLE/oqR0/OMf87+QGNTo X-Received: by 2002:ac8:6618:: with SMTP id c24mr1791420qtp.327.1581418634810; Tue, 11 Feb 2020 02:57:14 -0800 (PST) X-Received: by 2002:ac8:6618:: with SMTP id c24mr1791404qtp.327.1581418634534; Tue, 11 Feb 2020 02:57:14 -0800 (PST) Received: from redhat.com (bzq-79-176-41-183.red.bezeqint.net. [79.176.41.183]) by smtp.gmail.com with ESMTPSA id z1sm1872926qtq.69.2020.02.11.02.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 02:57:13 -0800 (PST) Date: Tue, 11 Feb 2020 05:57:09 -0500 From: "Michael S. Tsirkin" To: Chao Peng Cc: Zha Bin , linux-kernel@vger.kernel.org, jasowang@redhat.com, slp@redhat.com, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, gerry@linux.alibaba.com, jing2.liu@linux.intel.com Subject: Re: [PATCH v2 0/5] virtio mmio specification enhancement Message-ID: <20200211053953-mutt-send-email-mst@kernel.org> References: <20200210062938-mutt-send-email-mst@kernel.org> <20200211160541.GA37446@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211160541.GA37446@chaop.bj.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 04:05:41PM +0000, Chao Peng wrote: > On Mon, Feb 10, 2020 at 06:44:50AM -0500, Michael S. Tsirkin wrote: > > On Mon, Feb 10, 2020 at 05:05:16PM +0800, Zha Bin wrote: > > > We have compared the number of files and the lines of code between > > > virtio-mmio and virio-pci. > > > > > > Virtio-PCI Virtio-MMIO > > > number of files(Linux) 161 1 > > > lines of code(Linux) 78237 538 > > > > > > > > Something's very wrong here. virtio PCI is 161 files? > > Are you counting the whole PCI subsystem? > > Right, that is just a rough statistics. Please try not to make them look so wrong then. E.g. you don't include drivers/base/platform-msi.c for mmio do you? Your patch brings a bunch of code in there. > Surely enough, some drivers will > never get enabled in a typcial config. > > > Sure enough: > > > > $ find drivers/pci -name '*c' |wc -l > > 150 > > and plus: > $ find arch/x86/pci/ -name '*c' |wc -l > 22 But what's the point? This is code that is maintained by PCI core people anyway. > > > > That's not reasonable, this includes a bunch of drivers that > > never run on a typical hypervisor. > > > > MMIO is also not as small as you are trying to show: > > > > $ cloc drivers/virtio/virtio_mmio.c include/uapi/linux/virtio_mmio.h > > 2 text files. > > 2 unique files. > > 0 files ignored. > > > > github.com/AlDanial/cloc v 1.82 T=0.01 s (230.7 files/s, 106126.5 lines/s) > > ------------------------------------------------------------------------------- > > Language files blank comment code > > ------------------------------------------------------------------------------- > > C 1 144 100 535 > > C/C++ Header 1 39 66 36 > > ------------------------------------------------------------------------------- > > SUM: 2 183 166 571 > > ------------------------------------------------------------------------------- > > > > > > I don't doubt MMIO is smaller than PCI. Of course that's because it has > > no features to speak of - just this patch already doubles it's size. If > > we keep doing that because we want the features then they will reach > > the same size in about 4 iterations. > > Since current virtio-mmio size is small enough, so adding any notable > feature would easily double it. But really unlike PCI this is just PV stuff that is not reused by anyone. We end up maintaining all this by ourselves. > I have no objection that it may one day > reach the same level of PCI, but in this patch some are actually > generic changes and for MSI specific code we provide the option to > confige away. > > Thanks, > Chao The option will make it fall down at runtime but it does not actually seem to remove all of the overhead. > > > > > > -- > > MST