xfs
[Top] [All Lists]

Re: mrlocks vs. rw_semaphores

To: Alexander Kabaev <ak03@xxxxxxx>
Subject: Re: mrlocks vs. rw_semaphores
From: Stephen Lord <lord@xxxxxxx>
Date: 31 Dec 2002 07:01:01 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20021224114016.133029de.ak03@xxxxxxx>
References: <20021224114016.133029de.ak03@xxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Tue, 2002-12-24 at 10:40, Alexander Kabaev wrote:
> Looking through XFS change history, I noticed that several uses of mrlocks in
> the tree have been replaced with Linux's native rw_semaphores. What was the
> reason for this? Are rw_semaphores performing significantly better than
> mrlocks, or is there a subtle difference in their semantics which make
> rw_semaphores more suitable for the places they are used in now?
> 

rw_semaphores are lighter weight than mrlocks, and suitable for use
as a replacement for them in some cases. In other cases we use semantics
not available with rw_semaphores, we have also found that if we add
these semantics, we run into starvation problems with the locks. This
is why mrlocks still exist in the linux code.

Steve



<Prev in Thread] Current Thread [Next in Thread>