Displaying 12 results from an estimated 12 matches for "reclaim_blk".
2019 Jan 03
2
Re: [PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
...threshold, we move to
> + * RECLAIMING_LRU. Once we have exhausted all LRU blocks, we move to
> + * RECLAIMING_ANY (reclaiming any blocks).
> + *
> + * If at any time the size of the cache goes below the low threshold
> + * we move back to the NOT_RECLAIMING state.
> + *
> + * reclaim_blk is the last block that we will looked at.
s/will //
> +
> +#ifdef HAVE_CACHE_RECLAIM
> +
> +static void reclaim_one (void);
> +static void reclaim_lru (void);
> +static void reclaim_any (void);
> +static void reclaim_block (void);
> +
> +/* See if we need to reclaim bl...
2019 Jan 03
1
Re: [PATCH nbdkit v4 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
...(int fd, struct bitmap *bm)
> +{
> + assert (reclaiming);
> +
> + if (reclaiming == RECLAIMING_LRU)
> + reclaim_lru (fd, bm);
> + else
> + reclaim_any (fd, bm);
> +}
> +
> +static void
> +reclaim_lru (int fd, struct bitmap *bm)
> +{
> + uint64_t old_reclaim_blk;
> +
> + /* Find the next block in the cache. */
> + reclaim_blk = bitmap_next (bm, reclaim_blk+1);
> + old_reclaim_blk = reclaim_blk;
> +
> + /* Search for an LRU block after this one. */
> + do {
> + if (! lru_has_been_recently_accessed (reclaim_blk)) {
> +...
2018 Dec 28
0
[PATCH nbdkit 9/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
...size of the cache exceeds the high threshold, we move to
+ * RECLAIMING_LRU. Once we have exhausted all LRU blocks, we move to
+ * RECLAIMING_ANY (reclaiming any blocks).
+ *
+ * If at any time the size of the cache goes below the low threshold
+ * we move back to the NOT_RECLAIMING state.
+ *
+ * reclaim_blk is the last block that we will looked at.
+ */
+enum reclaim_state {
+ NOT_RECLAIMING = 0,
+ RECLAIMING_LRU = 1,
+ RECLAIMING_ANY = 2,
+};
+
+static enum reclaim_state reclaiming = NOT_RECLAIMING;
+static uint64_t reclaim_blk;
+#endif
+
+static void reclaim (void);
+
int
blk_init (void)
{
@@...
2019 Jan 03
4
[PATCH nbdkit v4 0/2] cache: Implement cache-max-size and method of
v3 was broken by a bad rebase, so let's forget about that one.
Compared to v2:
- Patch 1 is the same except for a minor comment change.
- Patch 2 splits the reclaim code into a separate file
(filters/cache/reclaim.c)
- Addressed Eric's comments from his review of v2.
- Retested on Linux and FreeBSD.
[PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 01
0
[PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
...size of the cache exceeds the high threshold, we move to
+ * RECLAIMING_LRU. Once we have exhausted all LRU blocks, we move to
+ * RECLAIMING_ANY (reclaiming any blocks).
+ *
+ * If at any time the size of the cache goes below the low threshold
+ * we move back to the NOT_RECLAIMING state.
+ *
+ * reclaim_blk is the last block that we will looked at.
+ */
+enum reclaim_state {
+ NOT_RECLAIMING = 0,
+ RECLAIMING_LRU = 1,
+ RECLAIMING_ANY = 2,
+};
+
+static enum reclaim_state reclaiming = NOT_RECLAIMING;
+static uint64_t reclaim_blk;
+#endif
+
+static void reclaim (void);
+
int
blk_init (void)
{
@@...
[PATCH nbdkit v3 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 03
0
[PATCH nbdkit v3 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
...ove to
+ * RECLAIMING_ANY (reclaiming any blocks).
+ *
+ * If at any time the size of the cache goes below the low threshold
+ * we move back to the NOT_RECLAIMING state.
+ *
+ * A possible future enhancement is to add an extra state between LRU
+ * and ANY which reclaims blocks from bm[1].
+ *
+ * reclaim_blk is the last block that we looked at.
+ */
+enum reclaim_state {
+ NOT_RECLAIMING = 0,
+ RECLAIMING_LRU = 1,
+ RECLAIMING_ANY = 2,
+};
+
+static enum reclaim_state reclaiming = NOT_RECLAIMING;
+static uint64_t reclaim_blk;
+#endif
+
+static void reclaim (void);
+
int
blk_init (void)
{
@@ -146,...
[PATCH nbdkit v4 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 03
0
[PATCH nbdkit v4 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
...+ * RECLAIMING_ANY (reclaiming any blocks).
+ *
+ * If at any time the size of the cache goes below the low threshold
+ * we move back to the NOT_RECLAIMING state.
+ *
+ * A possible future enhancement is to add an extra state between LRU
+ * and ANY which reclaims blocks from lru.c:bm[1].
+ *
+ * reclaim_blk is the last block that we looked at.
+ */
+enum reclaim_state {
+ NOT_RECLAIMING = 0,
+ RECLAIMING_LRU = 1,
+ RECLAIMING_ANY = 2,
+};
+
+static enum reclaim_state reclaiming = NOT_RECLAIMING;
+static uint64_t reclaim_blk;
+
+static void reclaim_one (int fd, struct bitmap *bm);
+static void recla...
2019 Jan 01
7
[PATCH nbdkit v2 0/4] cache: Implement cache-max-size etc.
These are essentially identical to what was previously posted as
patches 6/9 through 9/9 here:
https://www.redhat.com/archives/libguestfs/2018-December/msg00145.html
except that it has been rebased onto the current git master and
retested thoroughly.
Rich.
[PATCH nbdkit v3 0/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 03
3
[PATCH nbdkit v3 0/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
Patch 1 is the same as last time, except for a minor comment fix.
Patch 2 should address everything that Eric mentioned in his review,
and has been retested.
Rich.
2019 Jan 04
0
[PATCH nbdkit v5 3/3] cache: Implement cache-max-size and cache space reclaim.
...+ * RECLAIMING_ANY (reclaiming any blocks).
+ *
+ * If at any time the size of the cache goes below the low threshold
+ * we move back to the NOT_RECLAIMING state.
+ *
+ * A possible future enhancement is to add an extra state between LRU
+ * and ANY which reclaims blocks from lru.c:bm[1].
+ *
+ * reclaim_blk is the last block that we looked at.
+ */
+enum reclaim_state {
+ NOT_RECLAIMING = 0,
+ RECLAIMING_LRU = 1,
+ RECLAIMING_ANY = 2,
+};
+
+static enum reclaim_state reclaiming = NOT_RECLAIMING;
+static uint64_t reclaim_blk;
+
+static void reclaim_one (int fd, struct bitmap *bm);
+static void recla...
2018 Dec 28
12
[PATCH nbdkit 0/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
This patch series enhances the cache filter in a few ways, primarily
adding a "cache-on-read" feature (similar to qemu's copyonread); and
adding the ability to limit the cache size and the antecedent of that
which is having a method to reclaim cache blocks.
As the cache is stored as a sparse temporary file, reclaiming cache
blocks simply means punching holes in the temporary file.
2019 Jan 04
5
[PATCH nbdkit v5 3/3] cache: Implement cache-max-size and cache space reclaim.
v4:
https://www.redhat.com/archives/libguestfs/2019-January/msg00032.html
v5:
- Now we set the block size at run time.
I'd like to say that I was able to test this change, but
unfortunately I couldn't find any easy way to create a filesystem
on x86-64 with a block size > 4K. Ext4 doesn't support it at all,
and XFS doesn't support block size > page size (and I