All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCHv9 1/4] gnttab: per-active entry locking
Date: Thu, 21 May 2015 15:11:00 +0100	[thread overview]
Message-ID: <555DE774.1080504@citrix.com> (raw)
In-Reply-To: <555DA97F020000780007C91C@mail.emea.novell.com>

On 21/05/15 08:46, Jan Beulich wrote:
>>>> On 20.05.15 at 17:54, <david.vrabel@citrix.com> wrote:
>> @@ -702,6 +729,7 @@ __gnttab_map_grant_ref(
>>  
>>      cache_flags = (shah->flags & (GTF_PAT | GTF_PWT | GTF_PCD) );
>>  
>> +    active_entry_release(act);
>>      spin_unlock(&rgt->lock);
> 
> Just for my understanding: The lock isn't meant to also cover *shah?
> I.e. it could be dropped ahead of the cache_flags assignment?

I think so, but I think it's preferable (for now) to keep the locked
regions as-is where possible.

There are few other places where it looked like the locked regions can
be reduced.  It won't really make much difference though since the read
lock and active entry locks are not contented.

>> @@ -978,7 +1009,7 @@ __gnttab_unmap_common(
>>          if ( (rc = replace_grant_host_mapping(op->host_addr,
>>                                                op->frame, op->new_addr, 
>>                                                op->flags)) < 0 )
>> -            goto unmap_out;
>> +            goto act_release_out;
>>  
>>          ASSERT(act->pin & (GNTPIN_hstw_mask | GNTPIN_hstr_mask));
>>          op->map->flags &= ~GNTMAP_host_map;
> 
> act doesn't look to be accessed anymore after the if() this is
> contained in - why don't you drop the lock as early as possible?
> Or wait - do we need act->pin to remain stable until after that
> subsequent if() (in which case dropping the lock before the
> final if() in the function would mainly make error handling more
> cumbersome without bying us much)?

See comment above.

David

  reply	other threads:[~2015-05-21 14:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 15:54 [PATCHv9 0/3] gnttab: Improve scaleability David Vrabel
2015-05-20 15:54 ` [PATCHv9 1/4] gnttab: per-active entry locking David Vrabel
2015-05-21  7:46   ` Jan Beulich
2015-05-21 14:11     ` David Vrabel [this message]
2015-05-20 15:54 ` [PATCHv9 2/4] gnttab: introduce maptrack lock David Vrabel
2015-05-20 15:54 ` [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock David Vrabel
2015-05-21 10:32   ` Jan Beulich
2015-05-21 13:36     ` David Vrabel
2015-05-21 14:20       ` David Vrabel
2015-05-21 14:53       ` Jan Beulich
2015-05-21 15:16         ` David Vrabel
2015-05-22  6:37           ` Jan Beulich
2015-05-22  8:54             ` David Vrabel
2015-05-20 15:54 ` [PATCHv9 4/4] gnttab: use per-VCPU maptrack free lists David Vrabel
2015-05-21 10:42   ` 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=555DE774.1080504@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=tim@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.