fcntl spinlock in Linux?

J. Bruce Fields bfields at fieldses.org
Wed Jan 30 07:18:53 MST 2013


On Wed, Jan 30, 2013 at 08:32:47AM +0100, Volker Lendecke wrote:
> On Tue, Jan 29, 2013 at 05:03:58PM -0500, J. Bruce Fields wrote:
> > On Tue, Jan 29, 2013 at 10:51:33PM +0100, Volker Lendecke wrote:
> > > On Tue, Jan 29, 2013 at 04:37:03PM -0500, J. Bruce Fields wrote:
> > > > It's probably also easiest to fix.
> > > 
> > > Including deadlock detection? I guess this would have to
> > > look at all locks held by a thread, possibly on different
> > > inodes.
> > 
> > As a way of at least testing whether this is your problem, we could rip
> > out the deadlock detection entirely.
> 
> Depending on the workload, this is partly Samba's problem.
> Some real-world workloads imposed upon Samba make thousands
> of smbds contend on a single lock.

By the way, do you have a way to boil any of these down into simple test
cases that we could use?  (If it didn't even require installing Samba
that would be ideal.)

--b.

> 
> In the past I had tried to throttle smbds by some ipc
> mechanisms, but I could not find a scalable and at the same
> time fast way to achieve this. One trick I have tried is to
> use a pipe as a token bucket. Whenever an smbd wants to work
> on a request, it has to read one byte from one central pipe.
> When it's done, it writes that byte back for consumption by
> others. This also created a thundering herd, all of the
> thousands of blocking readers are woken up when one byte was
> written. My creativity stopped there, I could not find
> another way to slow down thousands of processes to be nicer
> to the kernel.


More information about the samba-technical mailing list