Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5650f77
remove duplicated reference
adamsitnik Feb 11, 2020
51b6a36
add basic AIO methods
adamsitnik Feb 11, 2020
6cd0d74
setup & destroy aio ring
adamsitnik Feb 11, 2020
08181a9
make it compile after switching to actual Linux machine
adamsitnik Feb 11, 2020
656c4c7
implement a very simple batching
adamsitnik Feb 13, 2020
6d5bffc
remove unnecesary unsafe
adamsitnik Feb 14, 2020
f9d4de7
can I handle empty reads like this?
adamsitnik Feb 14, 2020
f6f219f
move TrySetRUnning to TryAsBatch to avoid memory unpinning issues
adamsitnik Feb 15, 2020
13a95bc
something works, but very slow
adamsitnik Feb 16, 2020
771a169
Merge remote-tracking branch 'upstream/master' into bufferSocketReads
adamsitnik Feb 17, 2020
f652825
move batching to context, make sure the lock is taken
adamsitnik Feb 17, 2020
f5a6acb
change the way io events are handled
adamsitnik Feb 18, 2020
bfad248
commit what I have to be able to see nice diff on GH
adamsitnik Feb 18, 2020
f16c0af
revert some changes to make reading the diff easier
adamsitnik Feb 18, 2020
a446329
all tests pass!
adamsitnik Feb 20, 2020
0ba4dec
native AIO API improvements
adamsitnik Feb 21, 2020
8e4ed97
aioContext must be initialized before sending to iosetup
adamsitnik Feb 22, 2020
7352277
11 is EAGAIN
adamsitnik Feb 22, 2020
fb60f59
IOCB_CMD_NOOP is not ignored by AIO as stated in the docs, we can't h…
adamsitnik Feb 23, 2020
9cf5405
executing callback on epoll thread was a very bad idea
adamsitnik Feb 23, 2020
98214a1
take advantage of data locality and initialize the fields in the orde…
adamsitnik Feb 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make it compile after switching to actual Linux machine
  • Loading branch information
adamsitnik committed Feb 11, 2020
commit 08181a95e83e60464117df1d62cc4b31466af9d8
8 changes: 4 additions & 4 deletions src/libraries/Native/Unix/System.Native/pal_networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,7 @@ uint32_t SystemNative_InterfaceNameToIndex(char* interfaceName)
int32_t SystemNative_IoSetup(uint32_t eventsCount, AioContext* context)
{
#if HAVE_LINUX_AIO
return syscall(__NR_io_setup, eventsCount, context);
return (int32_t)syscall(__NR_io_setup, eventsCount, context);
#else
errno = ENOTSUP;
return -1;
Expand All @@ -2901,7 +2901,7 @@ int32_t SystemNative_IoSetup(uint32_t eventsCount, AioContext* context)
int32_t SystemNative_IoDestroy(AioContext context)
{
#if HAVE_LINUX_AIO
return syscall(__NR_io_destroy, context);
return (int32_t)syscall(__NR_io_destroy, context.Ring);
#else
errno = ENOTSUP;
return -1;
Expand All @@ -2911,7 +2911,7 @@ int32_t SystemNative_IoDestroy(AioContext context)
int32_t SystemNative_IoSubmit(AioContext context, int64_t count, IoControlBlock** ioControlBlocks)
{
#if HAVE_LINUX_AIO
return syscall(__NR_io_submit, context, count, ioControlBlocks);
return (int32_t)syscall(__NR_io_submit, context.Ring, count, ioControlBlocks);
#else
errno = ENOTSUP;
return -1;
Expand All @@ -2921,7 +2921,7 @@ int32_t SystemNative_IoSubmit(AioContext context, int64_t count, IoControlBlock*
int32_t SystemNative_IoGetEvents(AioContext context, int64_t minNr, int64_t nr, IoEvent* ioEvents)
{
#if HAVE_LINUX_AIO
return syscall(__NR_io_getevents, context, minNr, nr, NULL); // NULL is the timeout
return (int32_t)syscall(__NR_io_getevents, context.Ring, minNr, nr, ioEvents, NULL); // NULL is the timeout
#else
errno = ENOTSUP;
return -1;
Expand Down
16 changes: 8 additions & 8 deletions src/libraries/Native/Unix/System.Native/pal_networking.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ typedef struct

typedef struct
{
uint32_t32_t Id;
uint32_t32_t Nr;
uint32_t32_t Head;
uint32_t32_t Tail;
uint32_t32_t Magic;
uint32_t32_t CompatFeatures;
uint32_t32_t IncompatFeatures;
uint32_t32_t HeaderLength;
uint32_t Id;
uint32_t Nr;
uint32_t Head;
uint32_t Tail;
uint32_t Magic;
uint32_t CompatFeatures;
uint32_t IncompatFeatures;
uint32_t HeaderLength;
} AioRing;

typedef struct
Expand Down