30#ifdef IOMETHOD_IO_URING_ENABLED
48#define PGAIO_MAX_LOCAL_COMPLETED_IO 32
163#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
190 "mmap(%zu) to determine io_uring_queue_init_mem() support failed: %m",
199 "can use combined memory mapping for io_uring, each ring needs %d bytes",
215 "cannot use combined memory mapping for io_uring, ring creation failed: %m");
225 "can't use combined memory mapping for io_uring, kernel or liburing too old");
354#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
379 hint =
_(
"Check if io_uring is disabled via /proc/sys/kernel/io_uring_disabled.");
384 hint =
psprintf(
_(
"Consider increasing \"ulimit -n\" to at least %d."),
390 hint =
_(
"The kernel does not support io_uring.");
398 errmsg(
"could not setup io_uring queue: %m"),
421 for (
int i = 0;
i < num_staged_ios;
i++)
429 elog(
ERROR,
"io_uring submission queue is unexpectedly full");
446 "aio method uring: submit EINTR, nios: %d",
471 elog(
PANIC,
"io_uring submit failed: %m");
473 else if (ret != num_staged_ios)
476 elog(
PANIC,
"io_uring submit submitted only %d of %d",
477 ret, num_staged_ios);
482 "aio method uring: submitted %d IOs",
488 return num_staged_ios;
510 errcontext(
"completing I/O on behalf of process %d", owner_pid);
564 "drained %d/%d, now expecting %d",
590 "wait_one io_gen: %" PRIu64 ", ref_gen: %" PRIu64 ", cycle %d",
643 "wait_one with %d sleeps",
752 if (
ioh->op_data.read.iov_length == 1)
755 ioh->op_data.read.fd,
758 ioh->op_data.read.offset);
765 ioh->op_data.read.fd,
767 ioh->op_data.read.iov_length,
768 ioh->op_data.read.offset);
770 for (
int i = 0;
i <
ioh->op_data.read.iov_length;
i++,
iov++)
781 if (
ioh->op_data.write.iov_length == 1)
784 ioh->op_data.write.fd,
787 ioh->op_data.write.offset);
792 ioh->op_data.write.fd,
794 ioh->op_data.write.iov_length,
795 ioh->op_data.write.offset);
806 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 errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
#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)
bool LWLockConditionalAcquire(LWLock *lock, LWLockMode mode)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define PG_CACHE_LINE_SIZE
#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)
#define ShmemRequestStruct(...)
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)