linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Michael Kelley <mikelley@microsoft.com>,
	Wei Hu <weh@microsoft.com>,
	"b.zolnierkie@samsung.com" <b.zolnierkie@samsung.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"sashal@kernel.org" <sashal@kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"mchehab+samsung@kernel.org" <mchehab+samsung@kernel.org>,
	"sam@ravnborg.org" <sam@ravnborg.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"info@metux.net" <info@metux.net>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Cc: kbuild test robot <lkp@intel.com>
Subject: RE: [PATCH v4] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
Date: Mon, 6 Jan 2020 22:37:59 +0000	[thread overview]
Message-ID: <HK0P153MB0148F18913BEA45144AF8443BF3C0@HK0P153MB0148.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CY4PR21MB06293C21EC5338C98080F6AED7580@CY4PR21MB0629.namprd21.prod.outlook.com>

> From: Michael Kelley <mikelley@microsoft.com>
> Sent: Monday, December 9, 2019 8:33 AM
> To: Wei Hu <weh@microsoft.com>; b.zolnierkie@samsung.com; KY
> Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>;
> Stephen Hemminger <sthemmin@microsoft.com>; sashal@kernel.org;
> hch@lst.de; m.szyprowski@samsung.com; mchehab+samsung@kernel.org;
> sam@ravnborg.org; gregkh@linuxfoundation.org;
> alexandre.belloni@bootlin.com; info@metux.net; arnd@arndb.de;
> dri-devel@lists.freedesktop.org; linux-fbdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org; Dexuan Cui
> <decui@microsoft.com>
> Cc: kbuild test robot <lkp@intel.com>
> Subject: RE: [PATCH v4] video: hyperv: hyperv_fb: Use physical memory for
> fb on HyperV Gen 1 VMs.
> 
> From: Wei Hu <weh@microsoft.com> Sent: Sunday, December 8, 2019 11:58
> PM
> >
> > On Hyper-V, Generation 1 VMs can directly use VM's physical memory for
> > their framebuffers. This can improve the efficiency of framebuffer and
> > overall performance for VM. The physical memory assigned to framebuffer
> > must be contiguous. We use CMA allocator to get contiguous physicial
> > memory when the framebuffer size is greater than 4MB. For size under
> > 4MB, we use alloc_pages to achieve this.
> >
> > To enable framebuffer memory allocation from CMA, supply a kernel
> > parameter to give enough space to CMA allocator at boot time. For
> > example:
> >     cma=130m
> > This gives 130MB memory to CAM allocator that can be allocated to
> > framebuffer. If this fails, we fall back to the old way of using
> > mmio for framebuffer.
> >
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Wei Hu <weh@microsoft.com>
> > ---
> >     v2: Incorporated review comments form hch@lst.de, Michael Kelley
> and
> >     Dexuan Cui
> >     - Use dma_alloc_coherent to allocate large contiguous memory
> >     - Use phys_addr_t for physical addresses
> >     - Corrected a few spelling errors and minor cleanups
> >     - Also tested on 32 bit Ubuntu guest
> >     v3: Fixed a build issue reported by kbuild test robot and incorported
> >     some review comments from Michael Kelley
> >     - Add CMA check to avoid link failure
> >     - Fixed small memory leak introduced by alloc_apertures
> >     - Cleaned up so code
> >     v4: Removed request_pages variable as it is no longer needed
> >
> >  drivers/video/fbdev/Kconfig     |   1 +
> >  drivers/video/fbdev/hyperv_fb.c | 182
> +++++++++++++++++++++++++-------
> >  2 files changed, 144 insertions(+), 39 deletions(-)
> >
> 
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>

Tested-by: Dexuan Cui <decui@microsoft.com>

For a Gen-1 VM running on recent Hyper-V hosts, this patch can greatly 
reduce the CPU utilization because it avoids the slow data copy from the 
shadow framebuffer to the MMIO framebuffer, and hence it resolves the
"blurred screen" issue when we output a lot of characters on the text-mode
ternimal (e.g. "dmesg").

  reply	other threads:[~2020-01-06 22:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  7:57 [PATCH v4] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs Wei Hu
2019-12-09 16:32 ` Michael Kelley
2020-01-06 22:37   ` Dexuan Cui [this message]
2020-01-15 15:16     ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HK0P153MB0148F18913BEA45144AF8443BF3C0@HK0P153MB0148.APCP153.PROD.OUTLOOK.COM \
    --to=decui@microsoft.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=hch@lst.de \
    --cc=info@metux.net \
    --cc=kys@microsoft.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab+samsung@kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sam@ravnborg.org \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=weh@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).