search for: aio_

Displaying 20 results from an estimated 22 matches for "aio_".

Did you mean: aio
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...hed, but under a heavily-loaded system, it is conceivable that the libnbd state machine can manage to fire off our request and receive a server reply all before returning to the thread waiting on the semaphore, in which case the notify callback could set the cookie first. We still have to call nbd_aio_command_completed to retire the command, but now we can call it from the context of the thread that made the request rather than from the central reader thread, and we can check that the retired command has the same status as expected from the notify callback. Repeating a setup from commit e897ed70...
2023 Jul 05
1
Libnbd asynchronous API with epoll
Hello, As part of the Rust bindings for Libnbd, I try to integrate the asynchronous (aio_*) functions with Tokio <https://docs.rs/tokio/latest/tokio/>, the most used asynchronous runtime in Rust. However, in its eventloop, Tokio uses epoll(7) instead of poll(2) (which is used internally in Libnbd). The difference is that poll(2) uses level-triggered notifications as aposed to...
2022 Nov 14
3
[cross-project PATCH v2] NBD 64-bit extensions
This is a cover letter for a set of multi-project patch series all designed to implement 64-bit operations in NBD, and demonstrate interoperability of the new extension between projects. v1 of the project was attempted nearly a year ago: https://lists.nongnu.org/archive/html/qemu-devel/2021-12/msg00453.html Since then, I've addressed a lot of preliminary cleanups in libnbd to make it easier
2019 Jul 11
1
Re: [libnbd] Slight API inconsistency
...set_debug_callback. One more question then. For callbacks that get saved (i.e. `CallbackPersist`), should the caller take care of figuring out when it will not get called again any more? I am asking regarding the memory deallocation of the opaque pointer. Maybe it is guaranteed that: a) for `aio_*` functions the callback will be called only once and b) all the other functions (currently only `set_debug_callback`) need to be either deregistered or the data can be deregistered only after `nbd_close()` was called? I can't really see that handled in the bindings and I wanted to k...
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
...th NBD_EOVERFLOW if the chunk would be too large). As both nbdkit and qemu-nbd support this flag (the former only trivially, but the latter by not compressing holes over the wire), it is worth exposing to clients, if only for testing purposes. I chose to specifically reject the flag for plain nbd_[aio_]pread (about all it can do is cause a read to fail that would otherwise succeed) and only accept it for nbd_[aio_]pread_structured, but it would be easy enough to change the one to forward to the other if we wanted. --- generator/generator | 22 +++++++++++++++++++--- interop/structur...
2023 Jul 06
1
Libnbd asynchronous API with epoll
On Wed, Jul 5, 2023 at 3:38?PM Tage Johansson <tage.j.lists at posteo.net> wrote: > As part of the Rust bindings for Libnbd, I try to integrate the > asynchronous (aio_*) functions with Tokio > <https://docs.rs/tokio/latest/tokio/>, the most used asynchronous runtime > in Rust. However, in its eventloop, Tokio uses epoll(7) instead of poll(2) > (which is used internally in Libnbd). The difference is that poll(2) uses > level-triggered notificatio...
2007 Feb 08
0
security issues of aio
Hallo, in /sys/conf/NOTES there is a comment | # Use real implementations of the aio_* system calls. There are numerous | # stability and security issues in the current aio code that make it | # unsuitable for inclusion on machines with untrusted local users. | options VFS_AIO Are there still problems with aio? I only found http://xforce.iss.net/xforce/xfdb/7693, but no a...
2019 May 28
0
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
...5/28/19 4:26 AM, Richard W.M. Jones wrote: > On Mon, May 27, 2019 at 09:01:01PM -0500, Eric Blake wrote: >> diff --git a/lib/rw.c b/lib/rw.c >> index feaf468..343c340 100644 >> --- a/lib/rw.c >> +++ b/lib/rw.c >> @@ -234,11 +234,17 @@ int64_t >> nbd_unlocked_aio_pread (struct nbd_handle *h, void *buf, >> size_t count, uint64_t offset, uint32_t flags) >> { >> - if (flags != 0) { >> + if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) { >> set_error (EINVAL, "invalid flag: %" PRIu32, flags); &g...
2019 Jul 11
2
[libnbd] Slight API inconsistency
The callback (e.g. for `nbd_block_status`) now has a support for returning errors thanks to the last parameter (`int *error`), so it was switched to returning void. But that was not switched everywhere and some code expects it to return `int`. Yet another inconsistency is in the debug callback, which is supposed to return `void`, I guess, but due to the way the generator is implemented it's
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
...change for the same reason. (The OCaml API _does_ change but not significantly). I've run out of time on this patch today because I've got meetings for the rest of the day (and it's only 11am!) However if I did have more time there would be a 7th patch in the series which renames all aio_*_callback functions to simply aio_*. eg. nbd_aio_pread_callback is renamed to nbd_aio_pread (and old nbd_aio_pread is removed). That is obviously a somewhat large albeit it mechanical API change. Rich.
2019 Aug 13
7
[PATCH libnbd v2 0/3] Implement OClosures.
...troversial patches 1-4 v2: - The implementation of OClosure (new patch 1) in Python is fixed. - Patch 2 (old patch 5) is unchanged. - I added a new API for removing debug callbacks. I think this approach has some advantages over using OClosure. - I didn't yet do any work on changing the aio_*_callback functions to aio_*. Rich.
2019 May 30
2
Re: [nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...> Also, the standalone code was able to run read of command 1 in > parallel with write of command 2 via separate threads, whereas > libnbd's state machine is serializing everything (whether or not the > state machine spreads out the I/O to do writes from the thread calling > nbd_aio_FOO and reads from the reader thread, the two are never run at > once). Rich identified and fixed the culprit - libnbd was not setting TCP_NODELAY (disabling Nagle's algorithm) the way nbd-standalone.c did, which meant that any request that gets split over TCP windowing sizes waits to send t...
2019 May 28
2
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
On Mon, May 27, 2019 at 09:01:01PM -0500, Eric Blake wrote: > diff --git a/lib/rw.c b/lib/rw.c > index feaf468..343c340 100644 > --- a/lib/rw.c > +++ b/lib/rw.c > @@ -234,11 +234,17 @@ int64_t > nbd_unlocked_aio_pread (struct nbd_handle *h, void *buf, > size_t count, uint64_t offset, uint32_t flags) > { > - if (flags != 0) { > + if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) { > set_error (EINVAL, "invalid flag: %" PRIu32, flags); > return -1; &...
2019 May 31
0
[libnbd] Simultaneous read and write
...uests are not interleaved), then a separate reader thread to read responses from the server (with semaphores to learn which writer thread to wake up when the response is complete). The ideal division of labor that would permit reads to be in a separate thread from writes would require that the nbd_aio_pread() call (in the nbdkit thread) run until the entire request is out the door, even if it temporarily blocks on write() and has to wait for POLLOUT. Meanwhile, the reader thread would spin waiting for just POLLIN events, rather than having to service any of the POLLOUT of the writer thread(s) ru...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...locked_shutdown (struct nbd_handle *h) { - if (nbd_internal_is_state_ready (get_state (h)) || - nbd_internal_is_state_processing (get_state (h))) { + if (nbd_internal_is_state_ready (get_next_state (h)) || + nbd_internal_is_state_processing (get_next_state (h))) { if (nbd_unlocked_aio_disconnect (h, 0) == -1) return -1; } - while (!nbd_internal_is_state_closed (get_state (h)) && - !nbd_internal_is_state_dead (get_state (h))) { + while (!nbd_internal_is_state_closed (get_next_state (h)) && + !nbd_internal_is_state_dead (get_next_state...
2019 May 31
4
[libnbd] Simultaneous read and write
...he IRC discussion we gave these the preliminary names h->wstate and h->rstate. ---------------------------------------------------------------------- It's worth also saying how the current API works, although we might want to change it. You grab the underlying file descriptor using nbd_aio_get_fd, which is what you poll on. You also have to call nbd_aio_get_direction which returns READ, WRITE or BOTH (== READ|WRITE). You then set up some events mechanism (eg. poll, epoll, etc.), poll until the file descriptor is ready, and call one of nbd_aio_notify_read or nbd_aio_notify_write. Th...
2019 Jul 01
3
[nbdkit PATCH 0/2] Use new libnbd _notify functions
...ny noticeable performance differences, but I'm liking the diffstat. I can't push this patch until we release a new libnbd version with the _notify API addition, but am posting it now for playing with things. Eric Blake (2): nbd: Move transaction info from heap to stack nbd: Use nbdkit aio_*_notify variants plugins/nbd/nbd.c | 217 +++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 126 deletions(-) -- 2.20.1
2019 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1: - rebase to applied patches - split out support for Int in callbacks - sort of test that callbacks work in OCaml (see comment in patch 5) - rename API to nbd_pread_structured - expose error as explicit parameter to callback Eric Blake (5): generator: Allow Int in callbacks states: Wire in a read callback states: Add nbd_pread_structured API states: Add tests for
2006 Jun 20
18
RE: [PATCH] Blktap: Userspace file-based image support.(RFC)
> AW> This should be fixable though. I''m also not sure how carefully > AW> dm-u watches block completion responses to ensure safety of > AW> metadata updates relative to data writes. This too should be > AW> fixable -- i just don''t know if the user-level tools can currently > AW> request completion notifications on requests that they''ve
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after