[PATCHES] Issue fsync for SMB2 FLUSH asynchronously

Jeremy Allison jra at samba.org
Fri Nov 13 17:06:50 UTC 2015


On Fri, Nov 13, 2015 at 09:44:06AM -0700, Christof Schmitt wrote:
> > > > After some private conversations with Volker,
> > > > here is a follow-up patch that will apply
> > > > on top of the previous one and removes one
> > > > of the global varables completely.
> > > > 
> > > > Volker pointed out that we need to rethink
> > > > the aio_pending_size limit on outstanding
> > > > aio requests.
> > > > 
> > > > What happens when we reach this limit is
> > > > that we start processing SMB requests
> > > > synchronously, which slows down the system
> > > > further and we never get to see the replies
> > > > from the asys_results write to the internal
> > > > pipe as we're too busy reading and processing
> > > > incoming SMB requests.
> > > > 
> > > > So here is a patchset that does a few
> > > > things on top of the one you pushed !
> > > > 
> > > > a). Removes --with-aio-support. We no longer
> > > > need to run on systems that don't have
> > > > pthread support but use POSIX-RT aio_read()
> > > > aio_write() and friends. These days we
> > > > require pthreads.
> > > > 
> > > > This has the advantage that it removes
> > > > vfs_aio_posix as it's no longer used
> > > > (and indeed it was never even documented !).
> > > > 
> > > > Plus is removes a boatload of code and
> > > > options processing (as we no longer have
> > > > to check for POSIX-RT io calls).
> > > > 
> > > > b). Removes the fallback to processing SMB requests
> > > > synchronously which as Volker pointed out makes
> > > > the problem worse. Instead always put them onto
> > > > the internal pthreadpool queue, which will
> > > > dispatch them as a thread becomes free.
> > > > 
> > > > c). Change the internal aio_pending_size static variable
> > > > which is hard-coded at compile time to 100 to a
> > > > proper smb.conf global variable "aio max threads"
> > > > which is set to 100 by default but is now a
> > > > system-tunable.
> > > > 
> > > > It passes make test.
> > > 
> > > Reviewed-by: Me.
> 
> Also
> Reviewed-by: me
> 
> > > I have only one minor question: Should we explain in the
> > > manpage entry that the parameter is per smbd, not global?
> > 
> > Sounds like a good idea.
> > 
> > Like this?
> > 
> > s/threads Samba will create/threads one smbd process will create/
> 
> Yes, i think that would clarify it.
OK, I'll fixup the man page and push.

Thanks everyone !



More information about the samba-technical mailing list