The number of stat calls caused by a single CREATE request

Ralph Böhme slow at samba.org
Wed Aug 9 13:15:16 UTC 2017


Howdy Richard,

On Thu, Jul 27, 2017 at 05:37:45PM -0700, Richard Sharpe via samba-technical wrote:
> I have been looking at the performance of CREATE and am seeing as many
> as 15 stat-like requests for a single create.
> 
> Now, some of those are the result of our VFS module trying to get
> CREATE TIME, but I have the stack-trace info for 11 of them and it is
> not pretty:
> 
> 1. Four of them result from calls to smbd_check_access_rights (a
> couple it seems are for calculating the MxAc Extra Create Parameter.)
> 2. Two of them at least result from vfs_GetWd
> 3. The majority of them are for "." while two are for the actual path
> that is ".".
> 
> It is amazing to me that we do not use VALID_STAT to handle that, and
> I have a VALID_STAT use in the VFS module  but it seems Samba is
> creating fresh struct smb_filenames all over the place for ".".

yes, but can you check with perf or similar tools whether this still shows up in
profiles? Once the metadata is cached after the first access subsequent stat
calls shouldn't hurt too badly. When I worked on this last year I was able to
get rid of a few redundant stat calls, but I left some for you. ;)

Cheerio!
-slow



More information about the samba-technical mailing list