On Fri, Sep 01, 2017 at 06:21:00PM +0300, Paul wrote:
> 
> It seems that a lot of CPU resources are spend when trying to get exclusive 
> lock on file from multiple processes concurrently. By multiple i mean 
> hundreds.
> It seems that there's an initial cost of fcntl() call. Each process that 
> tries to lock the file consumes some amount of CPU and cools down.
> However, each repeated fcntl() call will consume same amount of resources 
> again. It seems as if entering the "wait queue" is expensive.
Yes, our lockf is somewhat expensive, I believe it is because the
implementation tries to maintain the fairness. In other words, the lock
requesters are put on queue in order.

Another heavy feature is the deadlock detection.  POSIX seems to state that
the detection is optional, but perhaps it is required for reliable operations
of the network locking protocols for NFS.

Sure, there can be opportunities to optimize the current algorithms.
Somebody interested in such optimization should start with profiling
the kernel.
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to