[PATCH] Update two optimisations that check for oplocks to the lease area

Ralph Böhme slow at samba.org
Sat May 6 16:55:54 UTC 2017


On Thu, May 04, 2017 at 11:29:21PM -0700, Jeremy Allison wrote:
> On Thu, May 04, 2017 at 12:26:48PM +0200, Ralph Böhme wrote:
> > Hi!
> > 
> > This is the one I talked about in my talk.
> > 
> > I took another look and found another plase where we need this.
> > 
> > Both combined eat 12%CPU in perf, not including syscalls.
> > 
> > Please review carefully and push if ok. Thanks!
> 
> OK, there were some flaws in the last patch in this set
> (found by the smb2.lease tests).
> 
> Can you try this version of your patch instead ? It changes
> the assertion in the last patch (num_oplocks one) to ensure
> that all existing leases in the array are exclusive (remember
> with leases the client can open multiple times with compatible
> leases so long as the client guid is the same - it's the multi-handle
> advantage leases have over oplocks).
> 
> The logic in the assertion now looks like:
> 
>         if (fsp_lease_type_is_exclusive(fsp)) {
>                 /*
>                  * If we're fully exclusive, we don't need a brlock entry
>                  */
>                 remove_stale_share_mode_entries(d);
> 
>                 for (i=0; i<d->num_share_modes; i++) {
>                         struct share_mode_entry *e = &d->share_modes[i];
>                         uint32_t e_lease_type = get_lease_type(d, e);
> 
>                         SMB_ASSERT(lease_type_is_exclusive(e_lease_type));
>                 }
>                 return true;
>         }
> 
> instead of checking for only one entry.
> 
> Please push if happy !

Pushed!

I'm really sorry for dumping half baked and not properly tested code on you. And
thanks for helping to get it right!

-slow



More information about the samba-technical mailing list