<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/source3/profile, branch talloc-2.2.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>profiling: stop smbprofile from growing unnecessarily</title>
<updated>2019-01-16T01:01:55+00:00</updated>
<author>
<name>Dylan Stephano-Shachter</name>
<email>dshachter@nasuni.com</email>
</author>
<published>2019-01-14T18:42:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0b996afec2ba4a4ba4e492123ca03f3b877a9db0'/>
<id>0b996afec2ba4a4ba4e492123ca03f3b877a9db0</id>
<content type='text'>
Signed-off-by: Dylan Stephano-Shachter &lt;dshachter@nasuni.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Wed Jan 16 02:01:55 CET 2019 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Dylan Stephano-Shachter &lt;dshachter@nasuni.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Wed Jan 16 02:01:55 CET 2019 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Pass mem_ctx to cache_path()</title>
<updated>2018-08-17T12:28:51+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2018-08-16T08:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=6ca5ba5272cc6ff5fbada1b9a801ccc16861eb0e'/>
<id>6ca5ba5272cc6ff5fbada1b9a801ccc16861eb0e</id>
<content type='text'>
Fix a confusing API: Many places TALLOC_FREE the path where it's not
clear you have to do it.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Fri Aug 17 14:28:51 CEST 2018 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a confusing API: Many places TALLOC_FREE the path where it's not
clear you have to do it.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Fri Aug 17 14:28:51 CEST 2018 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-profile: reduce dependencies of smbprofile.h</title>
<updated>2016-03-28T18:45:16+00:00</updated>
<author>
<name>Uri Simchoni</name>
<email>uri@samba.org</email>
</author>
<published>2016-03-28T07:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=f1c84e49dbd3ba792dbc7386505b03a4545437fb'/>
<id>f1c84e49dbd3ba792dbc7386505b03a4545437fb</id>
<content type='text'>
Signed-off-by: Uri Simchoni &lt;uri@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Uri Simchoni &lt;uri@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smbprofile: Add dst pid to smbprofile_cleanup</title>
<updated>2015-11-16T13:51:33+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2015-11-06T13:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b4b4fd0ba0f838cc30d7c331dae33335015096f7'/>
<id>b4b4fd0ba0f838cc30d7c331dae33335015096f7</id>
<content type='text'>
The consolidation will soon be done by a separate process. We need to
avoid the getpid() call in smbprofile_cleanup().

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The consolidation will soon be done by a separate process. We need to
avoid the getpid() call in smbprofile_cleanup().

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert all uint32/16/8 to _t in a grab-bag of remaining files.</title>
<updated>2015-05-14T20:16:56+00:00</updated>
<author>
<name>Richard Sharpe</name>
<email>rsharpe@samba.org</email>
</author>
<published>2015-05-14T00:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=57568f1900152c4cb381e151049414086bada14b'/>
<id>57568f1900152c4cb381e151049414086bada14b</id>
<content type='text'>
I still need to fix the rpc stuff, but we are almost there.

Signed-off-by: Richard Sharpe &lt;rsharpe@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I still need to fix the rpc stuff, but we are almost there.

Signed-off-by: Richard Sharpe &lt;rsharpe@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: profile the system and user space cpu time</title>
<updated>2015-03-06T11:31:10+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-11-14T11:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b9f9869d1bec7cff6682d3cda774dcbb2464223b'/>
<id>b9f9869d1bec7cff6682d3cda774dcbb2464223b</id>
<content type='text'>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: Replace sysv shmem with tdb</title>
<updated>2015-03-06T11:31:10+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-29T16:08:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=74a16a1094278d2c5c8ac800a4f7ed4553d7ac85'/>
<id>74a16a1094278d2c5c8ac800a4f7ed4553d7ac85</id>
<content type='text'>
What?

This patch gets rid of the central shared memory segment referenced by
"profile_p". Instead, every smbd gets a static profile_area where it collects
profiling data. Once a second, every smbd writes this profiling data into a
record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this
database and sums up what it finds.

Why?

At least in my perception sysv IPC has not the best reputation on earth. The
code before this patch uses shmat(). Samba ages ago has developed a good
abstraction of shared memory: It's called tdb.

The main reason why I started this is that I have a request to become
more flexible with profiling data. Samba should be able to collect data
per share or per user, something which is almost impossible to do with
a fixed structure. My idea is to for example install a profile area per
share and every second marshall this into one tdb record indexed by share
name. smbstatus -P would then also collect the data and either aggregate
them or put them into individual per-share statistics. This flexibility
in the data model is not really possible with one fixed structure.

But isn't it slow?

Well, I don't think so. I can't really prove it, but I do believe that on large
boxes atomically incrementing a shared memory value for every SMB does show up
due to NUMA effects. With this patch the hot code path is completely
process-local. Once a second every smbd writes into a central tdb, this of
course does atomic operations. But it's once a second, not on every SMB2 read.

There's two places where I would like to improve things: With the current code
all smbds wake up once a second. With 10,000 potentially idle smbds this will
become noticable. That's why the current only starts the timer when something has
changed.

The second place is the tdb traverse: Right now traverse is blocking in the
sense that when it has to switch hash chains it will block. With mutexes, this
means a syscall. I have a traverse light in mind that works as follows: It
assumes a locked hash chain and then walks the complete chain in one run
without unlocking in between. This way the caller can do nonblocking locks in
the first round and only do blocking locks in a second round. Also, a lot of
syscall overhead will vanish. This way smbstatus -P will have almost zero
impact on normal operations.

Pair-Programmed-With: Stefan Metzmacher &lt;metze@samba.org&gt;

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
What?

This patch gets rid of the central shared memory segment referenced by
"profile_p". Instead, every smbd gets a static profile_area where it collects
profiling data. Once a second, every smbd writes this profiling data into a
record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this
database and sums up what it finds.

Why?

At least in my perception sysv IPC has not the best reputation on earth. The
code before this patch uses shmat(). Samba ages ago has developed a good
abstraction of shared memory: It's called tdb.

The main reason why I started this is that I have a request to become
more flexible with profiling data. Samba should be able to collect data
per share or per user, something which is almost impossible to do with
a fixed structure. My idea is to for example install a profile area per
share and every second marshall this into one tdb record indexed by share
name. smbstatus -P would then also collect the data and either aggregate
them or put them into individual per-share statistics. This flexibility
in the data model is not really possible with one fixed structure.

But isn't it slow?

Well, I don't think so. I can't really prove it, but I do believe that on large
boxes atomically incrementing a shared memory value for every SMB does show up
due to NUMA effects. With this patch the hot code path is completely
process-local. Once a second every smbd writes into a central tdb, this of
course does atomic operations. But it's once a second, not on every SMB2 read.

There's two places where I would like to improve things: With the current code
all smbds wake up once a second. With 10,000 potentially idle smbds this will
become noticable. That's why the current only starts the timer when something has
changed.

The second place is the tdb traverse: Right now traverse is blocking in the
sense that when it has to switch hash chains it will block. With mutexes, this
means a syscall. I have a traverse light in mind that works as follows: It
assumes a locked hash chain and then walks the complete chain in one run
without unlocking in between. This way the caller can do nonblocking locks in
the first round and only do blocking locks in a second round. Also, a lot of
syscall overhead will vanish. This way smbstatus -P will have almost zero
impact on normal operations.

Pair-Programmed-With: Stefan Metzmacher &lt;metze@samba.org&gt;

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: rewrite the internal macros</title>
<updated>2014-11-19T19:51:37+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-10-23T16:06:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=cee1b4b0532d6271c2fc90fc2f82e9693a43d8ad'/>
<id>cee1b4b0532d6271c2fc90fc2f82e9693a43d8ad</id>
<content type='text'>
We now autogenerate a lot of code using
SMBPROFILE_STATS_ALL_SECTIONS macro which expands to
different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros.

This also allows async profiling using:

   struct mystate {
       ...

       SMBPROFILE_BASIC_ASYNC_STATE(profile_state);
       ...
   };

   ...

   SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate-&gt;profile_state);

The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers.

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We now autogenerate a lot of code using
SMBPROFILE_STATS_ALL_SECTIONS macro which expands to
different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros.

This also allows async profiling using:

   struct mystate {
       ...

       SMBPROFILE_BASIC_ASYNC_STATE(profile_state);
       ...
   };

   ...

   SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate-&gt;profile_state);

The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers.

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: remove unused nmbd related counters</title>
<updated>2014-11-19T19:51:36+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-11-05T12:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=255ff0a9721207c119924a8730e9d00dc468a058'/>
<id>255ff0a9721207c119924a8730e9d00dc468a058</id>
<content type='text'>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smbd: Fix nonempty line endings</title>
<updated>2014-10-07T12:44:04+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-11T14:46:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0fa16895f12050987c086a9ee27d6cf1b5be7251'/>
<id>0fa16895f12050987c086a9ee27d6cf1b5be7251</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
