All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>,  Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	 Henry Wang <Henry.Wang@arm.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	 Xen-devel <xen-devel@lists.xenproject.org>,
	George Dunlap <george.dunlap@citrix.com>
Subject: Re: [PATCH 1/4] xen: Introduce non-broken hypercalls for the p2m pool size
Date: Fri, 28 Oct 2022 16:27:21 +0100	[thread overview]
Message-ID: <CAFLBxZbWkLSMxXAYRGYc9Z3Vvj6bT+m7nvdiZgWRdr+_nF0BfQ@mail.gmail.com> (raw)
In-Reply-To: <8a8bc184-6237-ed24-8d9f-daa3c36df915@suse.com>

[-- Attachment #1: Type: text/plain, Size: 2551 bytes --]

On Thu, Oct 27, 2022 at 8:12 AM Jan Beulich <jbeulich@suse.com> wrote:

> On 26.10.2022 21:22, Andrew Cooper wrote:
> > On 26/10/2022 14:42, Jan Beulich wrote:
>


> > paging isn't a great name.  While it's what we call the infrastructure
> > in x86, it has nothing to do with paging things out to disk (the thing
> > everyone associates the name with), nor the xenpaging infrastructure
> > (Xen's version of what OS paging supposedly means).
>
> Okay, "paging" can be somewhat misleading. But "p2m" also doesn't fit
> the use(s) on x86. Yet we'd like to use a name clearly better than the
> previous (and yet more wrong/misleading) "shadow". I have to admit that
> I can't think of any other sensible name, and among the ones discussed
> I still think "paging" is the one coming closest despite the
> generally different meaning of the word elsewhere.
>

Inside the world of operating systems / hypervisors, "paging" has always
meant "things related to a pagetable"; this includes "paging out to disk".
In fact, the latter already has a perfectly good name -- "swap" (e.g., swap
file, swappiness, hypervisor swap).

Grep for "paging" inside of Xen.  We have the paging lock, paging modes,
nested paging, and so on.  There's absolutely no reason to start thinking
of "paging" as exclusively meaning "hypervisor swap".

[ A bunch of stuff about using bytes as a unit size]

> This is going to be a reoccurring theme through fixing the ABIs.  Its
> > one of a several areas where there is objectively one right answer, both
> > in terms of ease of use, and compatibility to future circumstances.
>
> Well, I wouldn't say using whatever base granularity as a unit is
> "objectively" less right.
>

Personally I don't think bytes or pages either have a particular advantage:

* Using bytes
 - Advantage: Can always use the same number regardless of the underlying
page size
 - Disadvantage: "Trap" where if you forget to check the page size, you
might accidentally pass an invalid input.  Or to put it differently, most
"reasonable-looking" numbers are actually invalid (since most numbers
aren't page-aligned)/
* Using pages
 - Advantage: No need to check page alignment in HV, no accidentally
invalid input
 - Disadvantage: Caller must check page size and do a shift on every call

What would personally tip me one way or the other is consistency with other
hypercalls.  If most of our hypercalls (or even most of our MM hypercalls)
use bytes, then I'd lean towards bytes.  Whereas if most of our hypercalls
use pages, I'd lean towards pages.

 -George

[-- Attachment #2: Type: text/html, Size: 3643 bytes --]

  reply	other threads:[~2022-10-28 15:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 10:20 [PATCH for-4.17 0/4] XSA-409 fixes Andrew Cooper
2022-10-26 10:20 ` [PATCH 1/4] xen: Introduce non-broken hypercalls for the p2m pool size Andrew Cooper
2022-10-26 13:42   ` Jan Beulich
2022-10-26 19:22     ` Andrew Cooper
2022-10-26 21:24       ` Julien Grall
2022-10-27  6:56         ` Jan Beulich
2022-10-27  9:27           ` Julien Grall
2022-10-27  7:11       ` Jan Beulich
2022-10-28 15:27         ` George Dunlap [this message]
2022-10-31  9:26           ` Jan Beulich
2022-10-31 10:12             ` George Dunlap
2022-11-16  1:19           ` Stefano Stabellini
2022-11-16  8:26             ` Jan Beulich
2022-10-27  7:42   ` Jan Beulich
2022-10-26 10:20 ` [PATCH 2/4] tools/tests: Unit test for " Andrew Cooper
2022-10-26 14:24   ` Jan Beulich
2022-10-26 14:35     ` Andrew Cooper
2022-10-26 10:20 ` [PATCH 3/4] xen/arm, libxl: Revert XEN_DOMCTL_shadow_op; use p2m mempool hypercalls Andrew Cooper
2022-10-26 13:22   ` Jason Andryuk
2022-10-26 13:25     ` Andrew Cooper
2022-11-16  1:37   ` Stefano Stabellini
2022-11-16  1:48     ` Andrew Cooper
2022-11-16  2:00       ` Stefano Stabellini
2022-11-16  2:39         ` Henry Wang
2022-11-16  8:30         ` Jan Beulich
2022-11-16 23:41           ` Andrew Cooper
2022-11-16 23:44             ` Stefano Stabellini
2022-11-16 23:51               ` Julien Grall
2022-11-16 23:56                 ` Stefano Stabellini
2022-11-17  8:18             ` Jan Beulich
2022-10-26 10:20 ` [PATCH 4/4] xen/arm: Correct the p2m pool size calculations Andrew Cooper
2022-11-11 10:11   ` Henry Wang
2022-11-11 10:54     ` Julien Grall

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=CAFLBxZbWkLSMxXAYRGYc9Z3Vvj6bT+m7nvdiZgWRdr+_nF0BfQ@mail.gmail.com \
    --to=dunlapg@umich.edu \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Henry.Wang@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=anthony.perard@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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.