All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 09/11] gnttab: avoid spurious maptrack handle allocation failures
Date: Thu, 22 Jun 2017 08:16:07 -0600	[thread overview]
Message-ID: <594BED470200007800165CF4@prv-mh.provo.novell.com> (raw)
In-Reply-To: <7222befd-aaf6-a609-18b2-70b4a376393b@citrix.com>

>>> On 21.06.17 at 14:02, <andrew.cooper3@citrix.com> wrote:
> On 21/06/17 10:37, Jan Beulich wrote:
>> @@ -408,8 +408,13 @@ get_maptrack_handle(
>>      /*
>>       * If we've run out of frames, try stealing an entry from another
>>       * VCPU (in case the guest isn't mapping across its VCPUs evenly).
>> +     * Also use this path in case we're out of memory, to avoid spurious
>> +     * failures.
>>       */
>> -    if ( nr_maptrack_frames(lgt) >= max_maptrack_frames )
>> +    if ( nr_maptrack_frames(lgt) < max_maptrack_frames )
>> +        new_mt = alloc_xenheap_page();
>> +
>> +    if ( !new_mt )
>>      {
>>          /*
>>           * Can drop the lock since no other VCPU can be adding a new
> 
> * frame once they've run out.
> */
> 
> It doesn't look like this comment is true any more, which brings the
> locking correctness into question.

The whole function acts on current only, so races aren't possible
at all. The comment therefore is misleading, and I now think the
maptrack_lock is pointless altogether.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-06-22 14:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21  9:25 [PATCH 00/11] assorted follow-ups to recent XSAs Jan Beulich
2017-06-21  9:30 ` [PATCH 01/11] public: adjust documentation following XSA-217 Jan Beulich
2017-06-21 11:26   ` Andrew Cooper
2017-06-21 15:44   ` George Dunlap
2017-06-21 15:54     ` Jan Beulich
2017-06-21 16:53       ` George Dunlap
2017-06-21 17:55         ` Stefano Stabellini
2017-06-22  6:59         ` Jan Beulich
2017-06-22  9:52           ` George Dunlap
2017-06-21  9:31 ` [PATCH 02/11] gnttab: remove redundant xenheap check from gnttab_transfer() Jan Beulich
2017-06-21 11:28   ` Andrew Cooper
2017-06-21  9:32 ` [PATCH 03/11] make steal_page() return a proper error value Jan Beulich
2017-06-21 11:39   ` Andrew Cooper
2017-06-22 10:01   ` Julien Grall
2017-06-21  9:33 ` [PATCH 04/11] domctl: restrict DOMCTL_set_target to HVM domains Jan Beulich
2017-06-21 11:41   ` Andrew Cooper
2017-06-21  9:34 ` [PATCH 05/11] evtchn: convert evtchn_port_is_*() to plain bool Jan Beulich
2017-06-21 11:46   ` Andrew Cooper
2017-06-21  9:35 ` [PATCH 06/11] ARM: simplify page type handling Jan Beulich
2017-06-21 23:53   ` Stefano Stabellini
2017-06-21  9:36 ` [PATCH 07/11] x86: fold identical error paths in xenmem_add_to_physmap_one() Jan Beulich
2017-06-21 11:53   ` Andrew Cooper
2017-06-21  9:36 ` [PATCH 08/11] gnttab: remove host map in the event of a grant_map failure Jan Beulich
2017-06-21  9:37 ` [PATCH 09/11] gnttab: avoid spurious maptrack handle allocation failures Jan Beulich
2017-06-21 12:02   ` Andrew Cooper
2017-06-21 12:19     ` Jan Beulich
2017-06-22 14:16     ` Jan Beulich [this message]
2017-06-21  9:38 ` [PATCH 10/11] gnttab: limit mapkind()'s iteration count Jan Beulich
2017-06-21 12:13   ` Andrew Cooper
2017-06-21  9:38 ` [PATCH 11/11] gnttab: drop useless locking Jan Beulich
2017-07-14 12:34   ` Ping: " 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=594BED470200007800165CF4@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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.