lkml.org 
[lkml]   [2014]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v5 13/14] locks: skip deadlock detection on FL_FILE_PVT locks
Date
> [grr, gmail -- I didn't actually intend to send that.]
>
> On Tue, Jan 14, 2014 at 1:24 PM, Andy Lutomirski <luto@amacapital.net>
> wrote:
> > On Tue, Jan 14, 2014 at 1:19 PM, Frank Filz <ffilzlnx@mindspring.com>
> wrote:
> >>> process 2 requests a write lock, gets -EDEADLK, unlocks and
> >>> requests a new read lock. That request succeeds because there
> >>> is no conflicting lock. (Note the lock manager had no
> >>> opportunity to upgrade 1's lock here thanks to the conflict with
> >>> 3's lock.)
> >>
> >> As I understand write lock priority, process 2 requesting a new read
> >> lock would block, once there is a write lock waiter, no further read
> >> locks would be granted that would conflict with that waiting write
lock.
> >
> > ...which reminds me -- if anyone implements writer priority, please
> > make it optional (either w/ a writer-priority-ignoring read lock or a
> > non-priority-granting write lock). I have an application for which
> > writer priority would be really annoying.
> >
> > Even better: Have read-lock-and-wait-for-pending-writers be an explicit
> new operation.
> >
> > (Writer priority a
>
> Writer priority can introduce new deadlocks. Suppose that a reader
(holding
> a read lock) starts a subprocess that takes a new read lock and waits for
that
> subprocess. Throw an unrelated process in that tries to take a write lock
and
> you have an instant deadlock.

Hmm, that's an interesting one.

With the new private locks, you could avoid that, because you can pass the
read lock you already hold to that sub-process, such that the sub-process
doesn't have to get it's own lock on the record in question.

Frank



\
 
 \ /
  Last update: 2014-01-15 03:41    [W:0.247 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site