From: Chris Friesen <chris.friesen@genband.com>
To: Rob Donovan <rob@proivrc.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: FCNTL Performance problem
Date: Mon, 09 Aug 2010 15:41:28 -0600 [thread overview]
Message-ID: <4C607608.8080305@genband.com> (raw)
In-Reply-To: <013501cb372f$912ce420$b386ac60$@proivrc.com>
On 08/08/2010 01:26 PM, Rob Donovan wrote:
> The problem is, when you have lots of F_RDLCK locks being created and
> released, then it slows down any F_WRLCK with F_SETLKW locks massively.
> Is there anything that can possibly be done in the kernel to help this, as I
> would have thought this could cause problems with other people?
>
> One possible solution would be that when the write lock tries to get a lock
> and cant, its actually puts its lock in a queue of some kind, so that the
> other reads that are about to start can see that, and they 'queue' and wait
> for the write lock first.. I'm obviously not a kernel coder, so I have no
> idea of the effects of something like that, hence this post.
What you're seeing is classical "reader priority" behaviour. The
alternative is "writer priority". I don't think POSIX specifies which
behaviour to use, so it's up to the various implementations.
If you really need writer priority, how about building your own lock
object in userspace on top of fcntl locks?
--
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com
next prev parent reply other threads:[~2010-08-09 21:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-08 19:26 FCNTL Performance problem Rob Donovan
2010-08-09 21:41 ` Chris Friesen [this message]
2010-08-11 16:19 ` Rob Donovan
2010-08-11 17:00 ` Chris Friesen
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=4C607608.8080305@genband.com \
--to=chris.friesen@genband.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rob@proivrc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox