From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: <oleksii.kurochko@gmail.com>, "Jan Beulich" <jbeulich@suse.com>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
"Bob Eshleman" <bobbyeshleman@gmail.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v1 2/5] xen/riscv: implement maddr_to_virt()
Date: Mon, 21 Oct 2024 11:08:55 +0100 [thread overview]
Message-ID: <D51EH2JFJVEZ.19LP27BXM7WZD@cloud.com> (raw)
In-Reply-To: <43e8ee94d3b7aa5b643db1d81a63e513a8feef57.camel@gmail.com>
On Mon Oct 21, 2024 at 10:17 AM BST, oleksii.kurochko wrote:
> On Mon, 2024-10-21 at 08:56 +0100, Alejandro Vallejo wrote:
> > On Fri Oct 18, 2024 at 2:17 PM BST, oleksii.kurochko wrote:
> > > On Thu, 2024-10-17 at 16:55 +0200, Jan Beulich wrote:
> > > > On 16.10.2024 11:15, Oleksii Kurochko wrote:
> > > > > --- a/xen/arch/riscv/include/asm/mm.h
> > > > > +++ b/xen/arch/riscv/include/asm/mm.h
> > > > > @@ -25,8 +25,12 @@
> > > > >
> > > > > static inline void *maddr_to_virt(paddr_t ma)
> > > > > {
> > > > > - BUG_ON("unimplemented");
> > > > > - return NULL;
> > > > > + /* Offset in the direct map, accounting for pdx
> > > > > compression */
> > > > > + unsigned long va_offset = maddr_to_directmapoff(ma);
> > > >
> > > > Why the mentioning of PDX compression?
> > > It was mentioned because if PDX will be enabled
> > > maddr_to_directmapoff()
> > > will take into account PDX stuff.
> > >
> > > > At least right now it's unavailable
> > > > for RISC-V afaics. Are there plans to change that any time soon?
> > > At the moment, I don't have such plans, looking at available
> > > platform
> > > there are no a lot of benefits of having PDX compression now.
> > >
> > > Perhaps it would be good to add
> > > BUILD_BUG_ON(IS_ENABLED(PDX_COMPRESSION)) for the places which
> > > should
> > > be updated when CONFIG_PDX will be enabled.
> > >
> > > ~ Oleksii
> >
> > I'd just forget about it unless you ever notice you're wasting a lot
> > of entries
> > in the frame table due to empty space in the memory map. Julien
> > measured the
> > effect on Amazon's Live Migration as a 10% improvement in downtime
> > with PDX
> > off.
> >
> > PDX compression shines when you have separate RAM banks at very, very
> > disparately far addresses (specifics in pdx.h). Unfortunately the
> > flip side of
> > this compression is that you get several memory accesses for each
> > single
> > pdx-(to/from)-mfn conversion. And we do a lot of those. One possible
> > solution
> > would be to alt-patch the values in the code-stream and avoid the
> > perf-hit, but
> > that's not merged. Jan had some patches but that didn't make it to
> > staging,
> > IIRC.
> Could you please give me some links in the mailing list with mentioned
> patches?
>
> ~ Oleksii
Sure.
Much of this was discussed in the "Make PDX compression optional" series. This
link is v1, but there were 3 in total and a pre-patch documenting pdx.h
explaining what the technique actually does to make sure we were all on the
same page (pun intended) and the pdx-off case wouldn't break the world.
https://lore.kernel.org/xen-devel/20230717160318.2113-1-alejandro.vallejo@cloud.com/
This was Jan's 2018 take to turn PDX into alternatives. He mentioned it
somewhere in those threads, but I can't find that message anymore.
https://lore.kernel.org/xen-devel/5B76740802000078001DF345@prv1-mh.provo.novell.com/
Cheers,
Alejandro
next prev parent reply other threads:[~2024-10-21 10:09 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 9:15 [PATCH v1 0/5] Setup memory management Oleksii Kurochko
2024-10-16 9:15 ` [PATCH v1 1/5] xen/riscv: add stub for share_xen_page_with_guest() Oleksii Kurochko
2024-10-17 14:51 ` Jan Beulich
2024-10-18 13:10 ` oleksii.kurochko
2024-10-18 13:27 ` Jan Beulich
2024-10-18 15:57 ` oleksii.kurochko
2024-10-28 8:04 ` Jan Beulich
2024-10-16 9:15 ` [PATCH v1 2/5] xen/riscv: implement maddr_to_virt() Oleksii Kurochko
2024-10-16 10:50 ` Alejandro Vallejo
2024-10-17 14:55 ` Jan Beulich
2024-10-18 13:17 ` oleksii.kurochko
2024-10-21 7:56 ` Alejandro Vallejo
2024-10-21 9:17 ` oleksii.kurochko
2024-10-21 10:08 ` Alejandro Vallejo [this message]
2024-10-16 9:15 ` [PATCH v1 3/5] xen/riscv: introduce setup_mm() Oleksii Kurochko
2024-10-17 15:15 ` Jan Beulich
2024-10-18 14:27 ` oleksii.kurochko
2024-10-28 8:19 ` Jan Beulich
2024-10-16 9:15 ` [PATCH v1 4/5] xen/riscv: initialize the VMAP_DEFAULT virtual range Oleksii Kurochko
2024-10-17 15:18 ` Jan Beulich
2024-10-16 9:15 ` [PATCH v1 5/5] xen/riscv: finalize boot allocator and transition to boot state Oleksii Kurochko
2024-10-17 15:18 ` Jan Beulich
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=D51EH2JFJVEZ.19LP27BXM7WZD@cloud.com \
--to=alejandro.vallejo@cloud.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=oleksii.kurochko@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.