<feed xmlns='http://www.w3.org/2005/Atom'>
<title>krb5.git/src/util/profile/prof_tree.c, branch master-mechdconf</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/'/>
<entry>
<title>Assume mutex locking cannot fail</title>
<updated>2013-05-14T17:31:41+00:00</updated>
<author>
<name>Greg Hudson</name>
<email>ghudson@mit.edu</email>
</author>
<published>2013-05-10T18:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=6350fd0c909d84c00200885e722cc902049ada05'/>
<id>6350fd0c909d84c00200885e722cc902049ada05</id>
<content type='text'>
Locking and unlocking a non-recursive mutex is a simple memory
operation and should not fail on any reasonable platform with correct
usage.  A pthread mutex can return EDEADLK on lock or EPERM on unlock,
or EINVAL if the mutex is uninitialized, but all of these conditions
would reflect serious bugs in the calling code.

Change the k5_mutex_lock and k5_mutex_unlock wrappers to return void
and adjust all call sites.  Propagate this change through
k5_cc_mutex_lock and k5_cc_mutex_unlock as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Locking and unlocking a non-recursive mutex is a simple memory
operation and should not fail on any reasonable platform with correct
usage.  A pthread mutex can return EDEADLK on lock or EPERM on unlock,
or EINVAL if the mutex is uninitialized, but all of these conditions
would reflect serious bugs in the calling code.

Change the k5_mutex_lock and k5_mutex_unlock wrappers to return void
and adjust all call sites.  Propagate this change through
k5_cc_mutex_lock and k5_cc_mutex_unlock as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for loadable profile modules</title>
<updated>2011-07-20T19:14:28+00:00</updated>
<author>
<name>Greg Hudson</name>
<email>ghudson@mit.edu</email>
</author>
<published>2011-07-20T19:14:28+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=6ea59e4695628ef53bf18ce2e837c2edc4879d0f'/>
<id>6ea59e4695628ef53bf18ce2e837c2edc4879d0f</id>
<content type='text'>
ticket: 6929

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25025 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ticket: 6929

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25025 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>Add libprofile support for vtable-backed profiles</title>
<updated>2011-07-20T19:14:20+00:00</updated>
<author>
<name>Greg Hudson</name>
<email>ghudson@mit.edu</email>
</author>
<published>2011-07-20T19:14:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=eeb43dd0f42f3f9cd93cf19dda0a303dbbca0909'/>
<id>eeb43dd0f42f3f9cd93cf19dda0a303dbbca0909</id>
<content type='text'>
ticket: 6929

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25024 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ticket: 6929

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25024 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>Mark and reindent util, with some exceptions</title>
<updated>2009-12-07T22:36:41+00:00</updated>
<author>
<name>Tom Yu</name>
<email>tlyu@mit.edu</email>
</author>
<published>2009-12-07T22:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=ac911f663389980be59a0f9ee98f062e6c627658'/>
<id>ac911f663389980be59a0f9ee98f062e6c627658</id>
<content type='text'>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23455 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23455 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>make mark-cstyle</title>
<updated>2009-10-31T00:48:38+00:00</updated>
<author>
<name>Tom Yu</name>
<email>tlyu@mit.edu</email>
</author>
<published>2009-10-31T00:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b'/>
<id>02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b</id>
<content type='text'>
make reindent

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
make reindent

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>reduce some mutex performance problems in profile library</title>
<updated>2009-06-18T23:25:25+00:00</updated>
<author>
<name>Ken Raeburn</name>
<email>raeburn@mit.edu</email>
</author>
<published>2009-06-18T23:25:25+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=eaa340d042d0d9439b707d6462cf74c7d9bb5e61'/>
<id>eaa340d042d0d9439b707d6462cf74c7d9bb5e61</id>
<content type='text'>
In profile_node_iterator we unlock a mutex in order to call
profile_update_file_data, which wants to lock that mutex itself, and
then when it returns we re-lock the mutex.  (We don't use recursive
mutexes, and I would continue to argue that we shouldn't.)  On the
Mac, when running multiple threads, it appears that this results in
very poor peformance, and much system and user CPU time is spent
working with the locks.  (Linux doesn't seem to suffer as much.)

So: Split profile_update_file_data into a locking wrapper, and an
inner routine that does the real work but requires that the lock be
held on entry.  Call the latter from profile_node_iterator *without*
unlocking first, and only unlock if there's an error.  This doesn't
move any significant amount of work into the locking region; it pretty
much just joins locking regions that were disjoint for no good reason.

On my tests on an 8-core Mac, in a test program running
gss_init_sec_context in a loop in 6 threads, this brought CPU usage
per call down by 40%, and improved wall-clock time even more.
Single-threaded performance improved very slightly, probably in the
noise.

Linux showed modest improvement (5% or less) in CPU usage in a
3-thread test on a 4-core system.

Similar tests with gss_accept_sec_context showed similar contention
around the profile-library mutexes, but I haven't analyzed the
performance changes there from this patch.

More work is needed, but this will help.

ticket: 6515
tags: pullup
target_version: 1.7.1
version_reported: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22418 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In profile_node_iterator we unlock a mutex in order to call
profile_update_file_data, which wants to lock that mutex itself, and
then when it returns we re-lock the mutex.  (We don't use recursive
mutexes, and I would continue to argue that we shouldn't.)  On the
Mac, when running multiple threads, it appears that this results in
very poor peformance, and much system and user CPU time is spent
working with the locks.  (Linux doesn't seem to suffer as much.)

So: Split profile_update_file_data into a locking wrapper, and an
inner routine that does the real work but requires that the lock be
held on entry.  Call the latter from profile_node_iterator *without*
unlocking first, and only unlock if there's an error.  This doesn't
move any significant amount of work into the locking region; it pretty
much just joins locking regions that were disjoint for no good reason.

On my tests on an 8-core Mac, in a test program running
gss_init_sec_context in a loop in 6 threads, this brought CPU usage
per call down by 40%, and improved wall-clock time even more.
Single-threaded performance improved very slightly, probably in the
noise.

Linux showed modest improvement (5% or less) in CPU usage in a
3-thread test on a 4-core system.

Similar tests with gss_accept_sec_context showed similar contention
around the profile-library mutexes, but I haven't analyzed the
performance changes there from this patch.

More work is needed, but this will help.

ticket: 6515
tags: pullup
target_version: 1.7.1
version_reported: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22418 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>Use strdup in place of malloc/strcpy in many places</title>
<updated>2008-10-20T18:18:49+00:00</updated>
<author>
<name>Greg Hudson</name>
<email>ghudson@mit.edu</email>
</author>
<published>2008-10-20T18:18:49+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=e4a2f122c3086c1179323c0e24edb3506d3f4758'/>
<id>e4a2f122c3086c1179323c0e24edb3506d3f4758</id>
<content type='text'>
ticket: 6200
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20898 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ticket: 6200
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20898 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>Always use unsigned for one-bit fields</title>
<updated>2008-08-06T00:10:43+00:00</updated>
<author>
<name>Ken Raeburn</name>
<email>raeburn@mit.edu</email>
</author>
<published>2008-08-06T00:10:43+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=45b9d1c277be779b256f78acfd9bde9a8b036604'/>
<id>45b9d1c277be779b256f78acfd9bde9a8b036604</id>
<content type='text'>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20609 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20609 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>profile library memory leaks introduced when malloc returns 0</title>
<updated>2007-09-26T15:15:33+00:00</updated>
<author>
<name>Ezra Peisach</name>
<email>epeisach@mit.edu</email>
</author>
<published>2007-09-26T15:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=cf3a311a561ade506913c4ba0e38b6e5adf9f9b4'/>
<id>cf3a311a561ade506913c4ba0e38b6e5adf9f9b4</id>
<content type='text'>
I have a modified version of valgrind that will allow me to have
malloc fail in a controlled way.  A number of memory leaks in error return
passes exist in the profile library.  They are essentially inconsequental - but
my goal is to eventually create a test harness that tries to cover all code - 
including error returns...

prof_parse.c: (profile_parse_file): Free node being created if
	      parse_line() fails.

prof_file.c (profile_open_file): free prf_data_t on malloc failure

prof_tree.c (profile_create_node): The magic element must be set
	    before calling profile_free_node for it to release memory.

ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19981 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I have a modified version of valgrind that will allow me to have
malloc fail in a controlled way.  A number of memory leaks in error return
passes exist in the profile library.  They are essentially inconsequental - but
my goal is to eventually create a test harness that tries to cover all code - 
including error returns...

prof_parse.c: (profile_parse_file): Free node being created if
	      parse_line() fails.

prof_file.c (profile_open_file): free prf_data_t on malloc failure

prof_tree.c (profile_create_node): The magic element must be set
	    before calling profile_free_node for it to release memory.

ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19981 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
<entry>
<title>profile_clear_relation doesn't work, iterator still sees deleted nodes</title>
<updated>2005-03-04T00:05:08+00:00</updated>
<author>
<name>Ken Raeburn</name>
<email>raeburn@mit.edu</email>
</author>
<published>2005-03-04T00:05:08+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/gd/public_git/krb5.git/commit/?id=a316a66d3e73df3cc89089ad01fc8673af6cc31e'/>
<id>a316a66d3e73df3cc89089ad01fc8673af6cc31e</id>
<content type='text'>
The "deleted" flag was being checked when writing out the file, but
not when iterating through using the profile handle being used to do
the deletions.

* prof_tree.c (profile_node_iterator): After checking skip_num counter, also
skip over deleted nodes.
* prof_test1 (test3): New proc.
(top level): Run it.

ticket: new
target_version: 1.4.1

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17111 dc483132-0cff-0310-8789-dd5450dbe970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "deleted" flag was being checked when writing out the file, but
not when iterating through using the profile handle being used to do
the deletions.

* prof_tree.c (profile_node_iterator): After checking skip_num counter, also
skip over deleted nodes.
* prof_test1 (test3): New proc.
(top level): Run it.

ticket: new
target_version: 1.4.1

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17111 dc483132-0cff-0310-8789-dd5450dbe970
</pre>
</div>
</content>
</entry>
</feed>
