Richard W.M. Jones
2018-Jun-06 10:44 UTC
[Libguestfs] [PATCH nbdkit] locks: Remove debugging messages about
The messages are not really useful to us, but they do bloat the debugging output of virt-v2v massively: nbdkit: python[1]: debug: acquire global request lock nbdkit: python[1]: debug: acquire per-connection request lock nbdkit: python[1]: debug: acquire unload prevention lock nbdkit: python[1]: debug: pwrite count=2097152 offset=4628414464 fua=0 nbdkit: python[1]: debug: release unload prevention lock nbdkit: python[1]: debug: release per-connection request lock nbdkit: python[1]: debug: release global request lock We probably need some kind of level of verbosity to deal with this sort of thing, but that's quite a large change. Rich.
Richard W.M. Jones
2018-Jun-06 10:44 UTC
[Libguestfs] [PATCH nbdkit] locks: Remove debugging messages about acquiring/releasing locks.
--- src/locks.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/locks.c b/src/locks.c index bd8fd99..1724b5a 100644 --- a/src/locks.c +++ b/src/locks.c @@ -56,53 +56,39 @@ lock_init_thread_model (void) void lock_connection (void) { - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) { - debug ("acquire connection lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) pthread_mutex_lock (&connection_lock); - } } void unlock_connection (void) { - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) { - debug ("release connection lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) pthread_mutex_unlock (&connection_lock); - } } void lock_request (struct connection *conn) { - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { - debug ("acquire global request lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) pthread_mutex_lock (&all_requests_lock); - } - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) { - debug ("acquire per-connection request lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) pthread_mutex_lock (connection_get_request_lock (conn)); - } - debug ("acquire unload prevention lock"); pthread_rwlock_rdlock (&unload_prevention_lock); } void unlock_request (struct connection *conn) { - debug ("release unload prevention lock"); pthread_rwlock_unlock (&unload_prevention_lock); - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) { - debug ("release per-connection request lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) pthread_mutex_unlock (connection_get_request_lock (conn)); - } - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { - debug ("release global request lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) pthread_mutex_unlock (&all_requests_lock); - } } void -- 2.16.2
Eric Blake
2018-Jun-06 11:45 UTC
Re: [Libguestfs] [PATCH nbdkit] locks: Remove debugging messages about acquiring/releasing locks.
On 06/06/2018 05:44 AM, Richard W.M. Jones wrote:> --- > src/locks.c | 26 ++++++-------------------- > 1 file changed, 6 insertions(+), 20 deletions(-)Might be worth reusing part of your 0/1 cover letter in the actual commit message; but looks reasonable to me. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Seemingly Similar Threads
- [PATCH 1/9] plugins: Move locking to a new file.
- [PATCH nbdkit 1/3] plugins: Move locking to a new file.
- [PATCH 2/3] Avoid race conditions when nbdkit exits.
- [nbdkit PATCH 1/4] server: Check for pthread lock failures
- [PATCH nbdkit] locks: Cache the plugin thread model.