Lines Matching +full:atomic +full:- +full:threshold +full:- +full:us

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
74 * By covering, we mean changing the h_tail_lsn in the last on-disk
75 * log write such that no allocation transactions will be re-done during
76 * recovery after a system crash. Recovery starts at the last on-disk
80 * space allocation transactions which can undo non-transactional changes
93 * non-dummy transaction. The first dummy changes the h_tail_lsn to
102 * IDLE -- no logging has been done on the file system or
104 * NEED -- logging has occurred and we need a dummy transaction
106 * DONE -- we were in the NEED state and have committed a dummy
108 * NEED2 -- we detected that a dummy transaction has gone to the
110 * DONE2 -- we committed a dummy transaction when in the NEED2 state.
118 * 2.) When we finish writing the on-disk log (xlog_state_clean_log).
161 * - A log record header is 512 bytes. There is plenty of room to grow the
163 * - ic_data follows, so a write to disk can start at the beginning of
165 * - ic_forcewait is used to implement synchronous forcing of the iclog to disk.
166 * - ic_next is the pointer to the next iclog in the ring.
167 * - ic_log is a pointer back to the global log structure.
168 * - ic_size is the full size of the log buffer, minus the cycle headers.
169 * - ic_offset is the current number of bytes written to in this iclog.
170 * - ic_refcnt is bumped when someone is writing to the log.
171 * - ic_state is the state of the iclog.
178 * - ic_callbacks
179 * - ic_refcnt
180 * - fields protected by the global l_icloglock
183 * We'll put all the read-only and l_icloglock fields in the first cacheline,
202 #define ic_header ic_data->hic_header
213 * The CIL context is used to aggregate per-transaction details as well be
214 * passed to the iclog for checkpoint post-commit processing. After being
244 * Per-cpu CIL tracking items
336 * CIL is large enough to maintain sufficient in-memory relogging to avoid
340 * issues when we are running low on memory - pinned memory cannot be reclaimed,
346 * As such, the CIL push threshold ends up being the smaller of two thresholds:
347 * - a threshold large enough that it allows CIL to be pushed and progress to be
349 * defined to be 12.5% of the log space - half the 25% push threshold of the
351 * - small enough that it doesn't pin excessive amounts of memory but maintains
358 * new threshold at which we block committing transactions until the background
364 * twice the background push space threshold so we keep in line with the AIL
367 * Note: this is not a -hard- limit as blocking is applied after the transaction
374 * occurred. Hence the simple throttle, and an ASSERT check to tell us that
378 min_t(int, (log)->l_logsize >> 3, BBTOB(XLOG_TOTAL_REC_SHIFT(log)) << 4)
434 * l_tail_lsn is atomic so it can be set and read without needing to
465 return test_bit(XLOG_RECOVERY_NEEDED, &log->l_opstate); in xlog_recovery_needed()
471 return test_bit(XLOG_ACTIVE_RECOVERY, &log->l_opstate); in xlog_in_recovery()
477 return test_bit(XLOG_IO_ERROR, &log->l_opstate); in xlog_is_shutdown()
488 wait_var_event(&log->l_opstate, xlog_is_shutdown(log)); in xlog_shutdown_wait()
522 * When we crack an atomic LSN, we sample it first so that the value will not
525 * be used to sample and crack LSNs that are stored and updated in atomic
538 * Calculate and assign a value to an atomic LSN variable from component pieces.
568 xlog_cil_force_seq(log, log->l_cilp->xc_current_sequence); in xlog_cil_force()
592 __releases(iclog->ic_log->l_icloglock);
607 return BBTOB(hi_block - lo_block); in xlog_lsn_sub()
609 return (uint64_t)log->l_logsize - BBTOB(lo_block - hi_block); in xlog_lsn_sub()
642 cur_cycle = READ_ONCE(log->l_curr_cycle); in xlog_valid_lsn()
644 cur_block = READ_ONCE(log->l_curr_block); in xlog_valid_lsn()
653 spin_lock(&log->l_icloglock); in xlog_valid_lsn()
654 cur_cycle = log->l_curr_cycle; in xlog_valid_lsn()
655 cur_block = log->l_curr_block; in xlog_valid_lsn()
656 spin_unlock(&log->l_icloglock); in xlog_valid_lsn()