GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 1 apply review comment · netty/netty@57135f5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-classes-io_uring/src/main/java/io/netty/channel/uring
    • IoUringIoHandler.java
    • IoUringIoOps.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java‎

Copy file name to clipboardExpand all lines: transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java
+15-14Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ private static void handleLoopException(Throwable throwable) {
277277

278278
private void handle(int res, int flags, long udata, ByteBuffer extraCqeData) {
279279
try {
280+
if (udata == EVENTFD_TOKEN) {
281+
handleEventFdRead();
282+
return;
283+
}
284+
if (udata == RINGFD_TOKEN) {
285+
return;
286+
}
280287
// Only remove from pendingOps if IORING_CQE_F_MORE is not set, as otherwise we know
281288
// that we will receive more completions for the initial request.
282289
boolean oneshotOp = (flags & Native.IORING_CQE_F_MORE) == 0;
@@ -294,25 +301,13 @@ private void handle(int res, int flags, long udata, ByteBuffer extraCqeData) {
294301
return;
295302
}
296303
}
297-
if (udata == EVENTFD_TOKEN) {
298-
handleEventFdRead();
299-
return;
300-
}
301-
if (udata == RINGFD_TOKEN) {
302-
return;
303-
}
304304
int slot = pendingOps.findSlot(udata);
305305
if (slot != -1) {
306306
int registrationId = pendingOps.registrationId(slot);
307307
DefaultIoUringIoRegistration registration = registrations.get(registrationId);
308308
byte op = pendingOps.op(slot);
309309
long userData = pendingOps.userData(slot);
310310

311-
if (logger.isTraceEnabled()) {
312-
logger.trace("completed(ring {}): {}(userData={}, res={})",
313-
ringBuffer.fd(), Native.opToStr(op), userData, res);
314-
}
315-
316311
// Recycle if this completion is terminal (no more CQEs expected for this SQE).
317312
if (oneshotOp) {
318313
pendingOps.release(slot);
@@ -322,6 +317,11 @@ private void handle(int res, int flags, long udata, ByteBuffer extraCqeData) {
322317
if (registration != null) {
323318
registration.handle(res, flags, op, userData, extraCqeData);
324319
}
320+
321+
if (logger.isTraceEnabled()) {
322+
logger.trace("completed(ring {}): {}(userData={}, res={})",
323+
ringBuffer.fd(), Native.opToStr(op), userData, res);
324+
}
325325
return;
326326
}
327327
if (logger.isDebugEnabled()) {
@@ -577,11 +577,10 @@ public long submit(IoOps ops) {
577577
long token = pendingOps.nextToken();
578578
if (executor.isExecutorThread(Thread.currentThread())) {
579579
submitSlowPath0(ioOps, token, userData);
580-
return token;
581580
} else {
582581
executor.execute(() -> submitSlowPath0(ioOps, token, userData));
583-
return token;
584582
}
583+
return token;
585584
}
586585

587586
private void submitFastPath0(IoUringIoOps ioOps, long seq) {
@@ -690,6 +689,8 @@ private static final class PendingOpSlots {
690689
long nextToken() {
691690
long sequence = nextSequence.getAndIncrement();
692691
if (sequence <= 0) {
692+
// Monotonic sequence starting at 3; ~29k years to exhaust positive long space at 10M/s,
693+
// so overflow is purely theoretical.
693694
throw new IllegalStateException("slow path sequence overflow");
694695
}
695696
return token(sequence);
Collapse file

‎transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoOps.java‎

Copy file name to clipboardExpand all lines: transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoOps.java
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ public final class IoUringIoOps implements IoOps {
3737
private final int union5;
3838
private final long union6;
3939

40+
/**
41+
* Create a new instance which represents the {@code io_uring_sqe} struct.
42+
* @deprecated use
43+
* {@link #IoUringIoOps(byte, byte, short, int, long, long, int, int, long, short, short, int, long)} instead.
44+
*/
45+
@Deprecated
46+
public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3,
47+
short data, short union4, short personality, int union5, long union6) {
48+
this(opcode, flags, ioPrio, fd, union1, union2, len, union3, (long) data, union4, personality, union5, union6);
49+
}
50+
4051
/**
4152
* Create a new instance which represents the {@code io_uring_sqe} struct.
4253
*
@@ -131,14 +142,6 @@ public final class IoUringIoOps implements IoOps {
131142
* }
132143
* </pre>
133144
*/
134-
public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3,
135-
short data, short union4, short personality, int union5, long union6) {
136-
this(opcode, flags, ioPrio, fd, union1, union2, len, union3, (long) data, union4, personality, union5, union6);
137-
}
138-
139-
/**
140-
* Create a new instance which represents the {@code io_uring_sqe} struct with a full long user data.
141-
*/
142145
public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3,
143146
long data, short union4, short personality, int union5, long union6) {
144147
this.opcode = opcode;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.