Displaying 20 results from an estimated 900 matches similar to: "[PATCH nbdkit] locks: Cache the plugin thread model."
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
Mostly code motion.
---
src/Makefile.am | 1 +
src/connections.c | 14 +++----
src/internal.h | 14 ++++---
src/locks.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/plugins.c | 77 +++++-------------------------------
5 files changed, 142 insertions(+), 79 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 12b9043..1f05eab 100644
---
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
Mostly code motion.
---
src/Makefile.am | 1 +
src/connections.c | 14 +++----
src/internal.h | 14 ++++---
src/locks.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/plugins.c | 77 +++++-------------------------------
5 files changed, 142 insertions(+), 79 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 12b9043..1f05eab 100644
---
2019 Apr 24
0
[nbdkit PATCH 1/4] server: Check for pthread lock failures
Low-level pthread locks should not fail except in extreme cases of
programmer bugs; we're better off calling attention to such bugs
rather than just assuming that they work and continuing on with
possibly inconsistent state.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
server/connections.c | 20 ++++++++++++--------
server/locks.c | 42
2018 Jun 06
0
[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
2020 Apr 28
2
[PATCH nbdkit] server/locks: Allow lock_request to be called when there is no current conn.
On Haiku tests/test-socket-activation failed with:
nbdkit: locks.c:96:lock_request: conn != NULL
called from server/sockets.c: accept_connection
in the fallback path which does:
lock_request ();
thread_data->sock = set_cloexec (accept (listen_sock, NULL, NULL));
unlock_request ()
Because there is no current connection in this thread this code fails.
However it should be possible to
2017 Nov 14
0
[PATCH 2/3] Avoid race conditions when nbdkit exits.
There are several race conditions where nbdkit exits (calling
plugin_cleanup() which unloads the plugin), while the plugin is either
in a callback or in plugin.close().
Avoid these by:
(1) Taking a shared lock around all plugin callbacks.
(2) Taking the same as an exclusive lock in plugin_cleanup.
This delays plugin_cleanup until all callbacks have finished.
(3) Removing a few unnecessary
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
Introduce the concept of a backend. Currently the only type of
backend is a plugin, and there can only be one of them. Instead of
calling functions like ‘plugin_pwrite’ you call the backend method
‘backend->pwrite (backend, ...)’.
The change is largely mechanical. I was able to remove ‘assert (dl)’
statements throughout since we can now prove they will never be
called.
Note this does not
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
Introduce the concept of a backend. Currently the only type of
backend is a plugin, and there can only be one of them. Instead of
calling functions like ‘plugin_pwrite’ you call the backend method
‘backend->pwrite (backend, ...)’.
The change is largely mechanical. I was able to remove ‘assert (dl)’
statements throughout since we can now prove they will never be
called.
Note this does not
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
Introduce the concept of a backend. Currently the only type of
backend is a plugin, and there can only be one of them. Instead of
calling functions like ‘plugin_pwrite’ you call the backend method
‘backend->pwrite (backend, ...)’.
The change is largely mechanical. I was able to remove ‘assert (dl)’
statements throughout since we can now prove they will never be
called.
Note this does not
2018 Jan 16
1
Re: [PATCH nbdkit 1/3] plugins: Move locking to a new file.
On 01/16/2018 08:11 AM, Richard W.M. Jones wrote:
> Mostly code motion.
> ---
> src/Makefile.am | 1 +
> src/connections.c | 14 +++----
> src/internal.h | 14 ++++---
> src/locks.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> src/plugins.c | 77 +++++-------------------------------
> 5 files changed, 142 insertions(+), 79
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
Annotate some function parameters with attribute((nonnull)). Only do
this for internal headers where we are sure that we will be using
sufficiently recent GCC or Clang. For the public header files
(ie. include/nbdkit-*.h) it may be that people building out of tree
plugins are using old GCC which had problems, or even other compilers
that don't support this extension at all.
Libvirt has an
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
It's confusing to use the same terminology for a single backend as for
the linked list of backends. In particular it's often not clear if
we're calling the next backend or the whole chain of backends.
---
server/internal.h | 14 ++++++++++--
server/connections.c | 20 ++++++++---------
server/locks.c | 2 +-
server/main.c
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
Since commit 86fdb48c6a5362d66865493d9d2172166f99722e we have stored
the connection object in thread-local storage.
In this very large, but mostly mechanical change we stop passing the
connection pointer around everywhere, and instead use the value stored
in thread-local storage.
This assumes a 1-1 mapping between the connection and the current
thread which is true in *most* places.
2018 Jun 06
2
[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
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
This fixes the long-standing crash on close when nbdkit exits.
I did try first to fix threads so we're using a proper thread pool,
but that's difficult to implement. So this does the minimal change
needed to fix the crash instead.
There are still two segfaults that happen during running the test
suite. One is deliberately caused (tests/test-captive.sh). The other
appears to be an
2020 Apr 14
0
[nbdkit PATCH v2 2/3] server: Sanitize stdin/out before running plugin code
As shown in the previous patch, plugins may choose to use stdin or
stdout during .config. But from .get_ready onwards, well-written
plugins shouldn't be needing any further use of stdin/out. We already
swapped stdin/out to /dev/null while daemonizing, but did not do do
during -f or --run, which leads to some surprising inconsistency when
trying to debug a plugin that works in the foreground
2020 Apr 04
0
[nbdkit PATCH 2/2] server: Sanitize stdin/out before running plugin code
As shown in the previous patch, plugins may choose to use stdin or
stdout during .config. But from .get_ready onwards, well-written
plugins shouldn't be needing any further use of stdin/out. We already
swapped stdin/out to /dev/null while daemonizing, but did not do do
during -f or --run, which leads to some surprising inconsistency when
trying to debug a plugin that works in the foreground
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are
called. This patch is in preparation for adding a second backend
subtype for filters.
Rich.
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2:
- Fixed everything mentioned in the review.
Rich.
2019 Sep 18
1
[PATCH nbdkit] server: Remove useless thread local sockaddr.
When accepting a connection on a TCP or Unix domain socket we recorded
the peer address in both the thread_data struct and thread-local
storage. But for no reason because it was never used anywhere. Since
we were only allocating a ‘struct sockaddr’ (rather than a ‘struct
sockaddr_storage’) it's likely that some peer addresses would have
been truncated.
Remove all this code, it had no