All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Clark <christopher.w.clark@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: Ping: [PATCH] Argo: don't obtain excess page references
Date: Wed, 23 Nov 2022 09:09:01 -0800	[thread overview]
Message-ID: <CACMJ4GY0eYPGN_hepOo__fu7D2pUnbzQ+GeqsWt_gk_7Mdtw+Q@mail.gmail.com> (raw)
In-Reply-To: <d03dc8b3-4c1f-2db0-4d97-944972dc6e06@suse.com>

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

On Mon, Nov 21, 2022 at 4:41 AM Jan Beulich <jbeulich@suse.com> wrote:

> On 11.10.2022 11:28, Jan Beulich wrote:
> > find_ring_mfn() already holds a page reference when trying to obtain a
> > writable type reference. We shouldn't make assumptions on the general
> > reference count limit being effectively "infinity". Obtain merely a type
> > ref, re-using the general ref by only dropping the previously acquired
> > one in the case of an error.
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Ping?
>

Message received -- I will look at this. Thanks.

Christopher


>
> > ---
> > I further question the log-dirty check there: The present P2M type of a
> > page doesn't really matter for writing to the page (plus it's stale by
> > the time it is looked at). Instead I think every write to such a page
> > needs to be accompanied by a call to paging_mark_dirty().
> >
> > --- a/xen/common/argo.c
> > +++ b/xen/common/argo.c
> > @@ -1429,10 +1429,11 @@ find_ring_mfn(struct domain *d, gfn_t gf
> >          ret = -EAGAIN;
> >  #endif
> >      else if ( (p2mt != p2m_ram_rw) ||
> > -              !get_page_and_type(page, d, PGT_writable_page) )
> > +              !get_page_type(page, PGT_writable_page) )
> >          ret = -EINVAL;
> >
> > -    put_page(page);
> > +    if ( unlikely(ret) )
> > +        put_page(page);
> >
> >      return ret;
> >  }
> >
>
>

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

  reply	other threads:[~2022-11-23 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  9:28 [PATCH] Argo: don't obtain excess page references Jan Beulich
2022-11-21 12:41 ` Ping: " Jan Beulich
2022-11-23 17:09   ` Christopher Clark [this message]
2023-01-30  4:35   ` Christopher Clark
2023-01-30  8:03     ` Jan Beulich
2023-02-13 10:55       ` 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=CACMJ4GY0eYPGN_hepOo__fu7D2pUnbzQ+GeqsWt_gk_7Mdtw+Q@mail.gmail.com \
    --to=christopher.w.clark@gmail.com \
    --cc=jbeulich@suse.com \
    --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.