From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>
Subject: [PATCH V1 0/2] Ability to allocate contiguous (was DMAable) pages using unpopulated-alloc
Date: Mon, 20 Jun 2022 18:48:54 +0300 [thread overview]
Message-ID: <1655740136-3974-1-git-send-email-olekstysh@gmail.com> (raw)
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Hello all.
You can find previous discussion at [1].
The purpose of this patch series is to get feedback about supporting the allocation
of contiguous pages by Linux's unpopulated-alloc.
The unpopulated-alloc feature has been enabled on Arm since the extended-regions support
reached upstream. With that (if, of course, we run new Xen version and Xen was able to
allocate extended regions), we don't allocate the real RAM pages from host memory and balloon
them out (in order to obtain physical memory space to map the guest pages into) anymore, we use
the unpopulated pages instead. And it seems that all users I have played with on Arm (I mean,
Xen PV and virtio backends) are happy with the pages provided by xen_alloc_unpopulated_pages().
It is worth mentioning that these pages are not contiguous, but this wasn't an issue so far.
There is one place, where we still steal RAM pages if user-space Xen PV backend tries
to establish grant mapping with a need to be backed by a DMA buffer for the sake of zero-copy
(see dma_alloc*() usage in gnttab_dma_alloc_pages()).
And, if I am not mistaken (there might be pitfalls which I am not aware of), we could avoid
wasting real RAM pages in that particular case also by adding an ability to allocate
unpopulated contiguous pages (which are guaranteed to be contiguous in IPA).
The benefit is quite clear here:
1. Avoid wasting real RAM pages (reducing the amount of CMA memory usable) for allocating
physical memory space to map the granted buffer into (which can be big enough if
we deal with Xen PV Display driver using multiple Full HD buffers)
2. Avoid superpage shattering in Xen P2M when establishing stage-2 mapping for that
granted buffer
3. Avoid extra operations needed for the granted buffer to be properly mapped and
unmapped such as ballooning in/out real RAM pages
The corresponding series is located at [2]. In my Arm64 based environment the series works good.
Only build tested on x86.
Any feedback/help would be highly appreciated.
[1] https://lore.kernel.org/xen-devel/1652810658-27810-1-git-send-email-olekstysh@gmail.com/
[2] https://github.com/otyshchenko1/linux/commits/unpopulated-cma1
Oleksandr Tyshchenko (2):
xen/unpopulated-alloc: Introduce helpers for contiguous allocations
xen/grant-table: Use unpopulated contiguous pages instead of real RAM
ones
drivers/xen/grant-table.c | 24 +++++
drivers/xen/unpopulated-alloc.c | 188 +++++++++++++++++++++++++++++-----------
include/xen/xen.h | 20 +++++
3 files changed, 182 insertions(+), 50 deletions(-)
--
2.7.4
next reply other threads:[~2022-06-20 15:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 15:48 Oleksandr Tyshchenko [this message]
2022-06-20 15:48 ` [PATCH V1 1/2] xen/unpopulated-alloc: Introduce helpers for contiguous allocations Oleksandr Tyshchenko
2022-06-30 1:06 ` Stefano Stabellini
2022-06-20 15:48 ` [PATCH V1 2/2] xen/grant-table: Use unpopulated contiguous pages instead of real RAM ones Oleksandr Tyshchenko
2022-06-30 1:06 ` Stefano Stabellini
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=1655740136-3974-1-git-send-email-olekstysh@gmail.com \
--to=olekstysh@gmail.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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
all inboxes | Powered by JetHome®