Lines Matching +full:allow +full:- +full:set +full:- +full:time
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 Copyright (C) 2003-2008, LINBIT Information Technologies GmbH.
8 Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>.
9 Copyright (C) 2003-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
24 This header file (and its .c file; kernel-doc of functions see there)
26 and changes to an "active set" of objects, as well as pending transactions,
30 the active set before we can "heat" a previously unused region.
33 As it actually Tracks Objects in an Active SeT, we could also call it
42 we need to resync all regions that have been target of in-flight WRITE IO
48 This is known as "write intent log", and can be implemented as on-disk
53 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent
57 If we set a hard limit on the area that may be "hot" at any given time, we
62 in the mean time, or, if both replica have been changed independently [*],
63 all blocks that have been changed on either replica in the mean time.
64 [*] usually as a result of a cluster split-brain and insufficient protection.
68 Having it fine-grained reduces the amount of resync traffic.
69 It should also be persistent, to allow for reboots (or crashes)
76 The on-disk "dirty bitmap" may be re-used as "write-intent" bitmap as well.
77 To reduce the frequency of bitmap updates for write-intent log purposes,
78 one could dirty "chunks" (of some size) at a time of the (fine grained)
79 on-disk bitmap, while keeping the in-memory "dirty" bitmap as clean as
80 possible, flushing it to disk again when a previously "hot" (and on-disk
86 for write-intent log purposes, additionally to the fine grained dirty bitmap.
90 with an empty set, and writing down a journal of region numbers that have
94 set, we not only record the actual changes to that set, but also record the
95 not changing members of the set in a round robin fashion. To do so, we use a
98 For each transaction recording a change to the active set, we record the
99 change itself (index: -old_label, +new_label), and which index is associated
104 accurately reconstruct the active set.
121 /* this defines an element in a tracked set
124 * region number (label) easily. To do the label -> object lookup without a
134 * an element is said to be "in the active set",
142 * them, as the change "index: -old_label, +LC_FREE" would need a transaction
151 /* back "pointer" into lc_cache->element[index],
154 /* if we want to track a larger set of objects,
165 /* the least recently used item is kept at lru->prev */
171 /* the pre-created kmem cache to allocate the objects from */
188 /* allow to accumulate a few (index:label) changes,
198 /* see below: flag-bits for lru_cache */
210 /* flag-bits for lru_cache */
216 /* annotate that the set is "dirty", possibly accumulating further
224 /* if we need to change the set, but currently there is no free nor
228 * the set, writing the transaction.
259 * lc_try_lock_for_transaction - can be used to stop lc_get() from changing the tracked set
262 * Allows (expects) the set to be "dirty". Note that the reference counts and
268 return !test_and_set_bit(__LC_LOCKED, &lc->flags); in lc_try_lock_for_transaction()
272 * lc_try_lock - variant to stop lc_get() from changing the tracked set
276 * still change. Only works on a "clean" set. Returns true if we acquired the
278 * change the set will not succeed until the next lc_unlock().
283 * lc_unlock - unlock @lc, allow lc_get() to change the set again
288 clear_bit(__LC_DIRTY, &lc->flags); in lc_unlock()
289 clear_bit_unlock(__LC_LOCKED, &lc->flags); in lc_unlock()