mdbx: add reader_check_timestamp info LCK.

Change-Id: I2f53b5996def8ff1d87a011fc662b94e2be3c467
This commit is contained in:
Leonid Yuriev 2019-09-11 19:12:57 +03:00
parent 0d8b59fa3b
commit 6fc3b89f79
2 changed files with 8 additions and 1 deletions

View File

@ -13121,6 +13121,7 @@ int __cold mdbx_reader_check0(MDBX_env *env, int rdt_locked, int *dead) {
return MDBX_SUCCESS;
}
lck->mti_reader_check_timestamp = mdbx_osal_monotime();
const unsigned snap_nreaders = lck->mti_numreaders;
mdbx_pid_t pidsbuf_onstask[142];
mdbx_pid_t *const pids =

View File

@ -481,6 +481,9 @@ typedef struct MDBX_lockinfo {
/* Threshold of un-synced-with-disk pages for auto-sync feature,
* zero means no-threshold, i.e. auto-sync is disabled. */
volatile pgno_t mti_autosync_threshold;
uint32_t reserved_pad;
/* Period for timed auto-sync feature, i.e. at the every steady checkpoint
* the mti_unsynced_timeout sets to the current_time + mti_autosync_period.
* The time value is represented in a suitable system-dependent form, for
@ -491,7 +494,7 @@ typedef struct MDBX_lockinfo {
/* Marker to distinguish uniqueness of DB/CLK.*/
volatile uint64_t mti_bait_uniqueness;
/* /proc/sys/kernel/random/boot_id */
/* the hash of /proc/sys/kernel/random/boot_id or analogue */
volatile uint64_t mti_boot_id;
alignas(MDBX_CACHELINE_SIZE) /* cacheline ---------------------------------*/
@ -515,6 +518,9 @@ typedef struct MDBX_lockinfo {
/* Number of page which was discarded last time by madvise(MADV_FREE). */
volatile pgno_t mti_discarded_tail;
/* Timestamp of the last readers check. */
volatile uint64_t mti_reader_check_timestamp;
alignas(MDBX_CACHELINE_SIZE) /* cacheline ---------------------------------*/
#ifdef MDBX_OSAL_LOCK