30#ifdef IOMETHOD_IO_URING_ENABLED
48#define PGAIO_MAX_LOCAL_COMPLETED_IO 32
159#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
186 "mmap(%zu) to determine io_uring_queue_init_mem() support failed: %m",
195 "can use combined memory mapping for io_uring, each ring needs %d bytes",
211 "cannot use combined memory mapping for io_uring, ring creation failed: %m");
221 "can't use combined memory mapping for io_uring, kernel or liburing too old");
344#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
369 hint =
_(
"Check if io_uring is disabled via /proc/sys/kernel/io_uring_disabled.");
374 hint =
psprintf(
_(
"Consider increasing \"ulimit -n\" to at least %d."),
380 hint =
_(
"The kernel does not support io_uring.");
388 errmsg(
"could not setup io_uring queue: %m"),
412 for (
int i = 0;
i < num_staged_ios;
i++)
420 elog(
ERROR,
"io_uring submission queue is unexpectedly full");
458 "aio method uring: submit EINTR, nios: %d",
483 elog(
PANIC,
"io_uring submit failed: %m");
485 else if (ret != num_staged_ios)
488 elog(
PANIC,
"io_uring submit submitted only %d of %d",
489 ret, num_staged_ios);
494 "aio method uring: submitted %d IOs",
500 return num_staged_ios;
522 errcontext(
"completing I/O on behalf of process %d", owner_pid);
563 int result =
cqe->res;
576 "drained %d/%d, now expecting %d",
602 "wait_one io_gen: %" PRIu64 ", ref_gen: %" PRIu64 ", cycle %d",
655 "wait_one with %d sleeps",
668 if (
ioh->op_data.read.iov_length == 1)
671 ioh->op_data.read.fd,
674 ioh->op_data.read.offset);
679 ioh->op_data.read.fd,
681 ioh->op_data.read.iov_length,
682 ioh->op_data.read.offset);
689 if (
ioh->op_data.write.iov_length == 1)
692 ioh->op_data.write.fd,
695 ioh->op_data.write.offset);
700 ioh->op_data.write.fd,
702 ioh->op_data.write.iov_length,
703 ioh->op_data.write.offset);
708 elog(
ERROR,
"trying to prepare invalid IO operation for execution");
void pgaio_io_process_completion(PgAioHandle *ioh, int result)
PgAioBackend * pgaio_my_backend
bool pgaio_io_was_recycled(PgAioHandle *ioh, uint64 ref_generation, PgAioHandleState *state)
void pgaio_io_prepare_submit(PgAioHandle *ioh)
#define pgaio_debug(elevel, msg,...)
#define pgaio_debug_io(elevel, ioh, msg,...)
#define PGAIO_SUBMIT_BATCH_SIZE
#define TYPEALIGN(ALIGNVAL, LEN)
#define Assert(condition)
ErrorContextCallback * error_context_stack
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void err(int eval, const char *fmt,...)
int max_files_per_process
static uint32 dclist_count(const dclist_head *head)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
void LWLockInitialize(LWLock *lock, int tranche_id)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define NUM_AUXILIARY_PROCS
#define GetPGProcByNumber(n)
char * psprintf(const char *fmt,...)
Size add_size(Size s1, Size s2)
Size mul_size(Size s1, Size s2)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
struct ErrorContextCallback * previous
void(* callback)(void *arg)
bool wait_on_fd_before_close
dclist_head in_flight_ios
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)