Displaying 7 results from an estimated 7 matches for "60cf379".
[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 01
0
[PATCH nbdkit v2 3/4] cache: Implement LRU structure.
...}
@@ -222,6 +233,7 @@ blk_write (struct nbdkit_next_ops *next_ops, void *nxdata,
return -1;
}
bitmap_set_blk (&bm, blknum, BLOCK_DIRTY);
+ lru_set_recently_accessed (blknum);
return 0;
}
diff --git a/filters/cache/lru.c b/filters/cache/lru.c
new file mode 100644
index 0000000..60cf379
--- /dev/null
+++ b/filters/cache/lru.c
@@ -0,0 +1,150 @@
+/* nbdkit
+ * Copyright (C) 2018 Red Hat Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * *...
2018 Dec 28
0
[PATCH nbdkit 9/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
....unload = cache_unload,
.config = cache_config,
+ .config_complete = cache_config_complete,
.open = cache_open,
.prepare = cache_prepare,
.get_size = cache_get_size,
diff --git a/filters/cache/lru.c b/filters/cache/lru.c
index 60cf379..8159040 100644
--- a/filters/cache/lru.c
+++ b/filters/cache/lru.c
@@ -109,8 +109,11 @@ lru_set_size (uint64_t new_size)
if (bitmap_resize (&bm[1], new_size) == -1)
return -1;
- /* XXX Choose this better. */
- N = MAX (new_size / BLKSIZE / 4, 100);
+ if (max_size != -1)
+ /* Ma...
[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.
....unload = cache_unload,
.config = cache_config,
+ .config_complete = cache_config_complete,
.open = cache_open,
.prepare = cache_prepare,
.get_size = cache_get_size,
diff --git a/filters/cache/lru.c b/filters/cache/lru.c
index 60cf379..8159040 100644
--- a/filters/cache/lru.c
+++ b/filters/cache/lru.c
@@ -109,8 +109,11 @@ lru_set_size (uint64_t new_size)
if (bitmap_resize (&bm[1], new_size) == -1)
return -1;
- /* XXX Choose this better. */
- N = MAX (new_size / BLKSIZE / 4, 100);
+ if (max_size != -1)
+ /* Ma...
[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.
....unload = cache_unload,
.config = cache_config,
+ .config_complete = cache_config_complete,
.open = cache_open,
.prepare = cache_prepare,
.get_size = cache_get_size,
diff --git a/filters/cache/lru.c b/filters/cache/lru.c
index 60cf379..2f379d1 100644
--- a/filters/cache/lru.c
+++ b/filters/cache/lru.c
@@ -69,9 +69,10 @@
*
* To do this we keep two bitmaps.
*
- * When a block is accessed, we set the corresponding bit in bm[0] and
- * increment c0 (c0 counts the number of bits set in bm[0]). If c0 ==
- * N/2 then we swap the...
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.
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.