search for: cache_mod

Displaying 20 results from an estimated 40 matches for "cache_mod".

Did you mean: cache_mode
2020 Aug 07
2
[PATCH nbdkit] plugins: file: More standard cache mode names
...iles changed, 25 insertions(+), 18 deletions(-) diff --git a/plugins/file/file.c b/plugins/file/file.c index f6f91955..deac9b7f 100644 --- a/plugins/file/file.c +++ b/plugins/file/file.c @@ -76,7 +76,7 @@ static int fadvise_mode = ; /* cache mode */ -static enum { cache_default, cache_none } cache_mode = cache_default; +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; /* Any callbacks using lseek must be protected by this lock. */ static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER; @@ -140,10 +140,10 @@ file_config (const char *key, const char *val...
2020 Aug 08
0
Re: [PATCH nbdkit] plugins: file: More standard cache mode names
...t; > diff --git a/plugins/file/file.c b/plugins/file/file.c > index f6f91955..deac9b7f 100644 > --- a/plugins/file/file.c > +++ b/plugins/file/file.c > @@ -76,7 +76,7 @@ static int fadvise_mode = > ; > > /* cache mode */ > -static enum { cache_default, cache_none } cache_mode = cache_default; > +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; > > /* Any callbacks using lseek must be protected by this lock. */ > static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER; > @@ -140,10 +140,10 @@ file_config (const c...
2020 Aug 08
1
Re: [PATCH nbdkit] plugins: file: More standard cache mode names
...e.c b/plugins/file/file.c > > index f6f91955..deac9b7f 100644 > > --- a/plugins/file/file.c > > +++ b/plugins/file/file.c > > @@ -76,7 +76,7 @@ static int fadvise_mode = > > ; > > > > /* cache mode */ > > -static enum { cache_default, cache_none } cache_mode = cache_default; > > +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; > > > > /* Any callbacks using lseek must be protected by this lock. */ > > static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER; > > @@ -140,10 +140,10...
2020 Aug 07
3
[PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...ar *filename = NULL; +/* posix_fadvise mode: -1 = don't set it, or POSIX_FADV_*. */ +static int fadvise_mode = +#if defined (HAVE_POSIX_FADVISE) && defined (POSIX_FADV_NORMAL) + POSIX_FADV_NORMAL +#else + -1 +#endif + ; + +/* cache mode */ +static enum { cache_default, cache_none } cache_mode = cache_default; + /* Any callbacks using lseek must be protected by this lock. */ static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER; @@ -97,6 +109,46 @@ file_config (const char *key, const char *value) if (!filename) return -1; } + else if (strcmp (key, "fadvi...
2018 Jan 22
1
[PATCH nbdkit] filters: Add caching filter.
This adds a cache filter, which works like the COW filter in reverse. For realistic use it needs a bit more work, especially to add limits on the size of the cache, a more sensible cache replacement policy, and perhaps some kind of background worker to write dirty blocks out. 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.
2013 Oct 30
3
[PATCH 4/4] XSA-60 security hole: flush cache when vmentry back to UC guest
...tly hypervisor_access_uc_hvm_memory; unsigned int opt_hvm_debug_level __read_mostly; integer_param("hvm_debug", opt_hvm_debug_level); @@ -2483,6 +2484,9 @@ static enum hvm_copy_result __hvm_copy( return HVMCOPY_unhandleable; #endif + if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) ) + hypervisor_access_uc_hvm_memory = 1; + while ( todo > 0 ) { count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo); @@ -2596,6 +2600,9 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size) return HVMCOPY_unhandlea...
2018 Dec 28
0
[PATCH nbdkit 5/9] cache: Allow this filter to serve requests in parallel.
...-#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS +#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL + +/* In order to handle parallel requests safely, this lock must be held + * when calling any blk_* functions. + */ +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; enum cache_mode cache_mode = CACHE_MODE_WRITEBACK; bool cache_on_read = false; @@ -132,6 +138,7 @@ cache_get_size (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle) { int64_t size; + int r; size = next_ops->get_size (nxdata); if (size == -1) @@ -139,7 +146,10 @@ cache_g...
2018 Dec 28
0
[PATCH nbdkit 9/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
....) +Recently used dirty blocks are flushed to the plugin and discarded. + +=back + =head1 ENVIRONMENT VARIABLES =over 4 diff --git a/filters/cache/cache.h b/filters/cache/cache.h index 50416b1..889414b 100644 --- a/filters/cache/cache.h +++ b/filters/cache/cache.h @@ -48,7 +48,18 @@ extern enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode; +/* Maximum size of the cache and high/low thresholds. */ +extern int64_t max_size; +extern int hi_thresh, lo_thresh; + /* Cache read requests. */ extern bool cache_on_read; +/* Do we support reclaiming cache blocks? */ +#ifdef FALLOC_FL_PUNCH_HOLE +#de...
2019 Jan 04
0
[PATCH nbdkit v5 3/3] cache: Implement cache-max-size and cache space reclaim.
...that we need - * 64 MB of memory to store the bitmaps for a 1 TB underlying image. - * It is also smaller than the usual hole size for sparse files, which - * means we have no reason to call next_ops->zero. - */ -#define BLKSIZE 4096 +#include <fcntl.h> /* Caching mode. */ extern enum cache_mode { @@ -48,6 +43,13 @@ extern enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode; +/* Size of a block in the cache. */ +extern unsigned blksize; + +/* Maximum size of the cache and high/low thresholds. */ +extern int64_t max_size; +extern int hi_thresh, lo_thresh; + /* Cache read requests. */...
2019 Jan 01
0
[PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
..._H #define NBDKIT_CACHE_H +#include <fcntl.h> + /* Size of a block in the cache. A 4K block size means that we need * 64 MB of memory to store the bitmaps for a 1 TB underlying image. * It is also smaller than the usual hole size for sparse files, which @@ -48,7 +50,18 @@ extern enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode; +/* Maximum size of the cache and high/low thresholds. */ +extern int64_t max_size; +extern int hi_thresh, lo_thresh; + /* Cache read requests. */ extern bool cache_on_read; +/* Do we support reclaiming cache blocks? */ +#ifdef FALLOC_FL_PUNCH_HOLE +#de...
2020 Aug 07
3
Re: [PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
..._t orig_count = count; > >+ uint64_t orig_offset = offset; > >+ > >+ /* If cache=none we want to force pages we have just written to the > >+ * file to be flushed to disk so we can immediately evict them from > >+ * the page cache. > >+ */ > >+ if (cache_mode == cache_none) flags |= NBDKIT_FLAG_FUA; > >+#endif > >+ > > while (count > 0) { > > ssize_t r = pwrite (h->fd, buf, count, offset); > > if (r == -1) { > >@@ -369,6 +453,12 @@ file_pwrite (void *handle, const void *buf, uint32_t count, uint64_...
2019 Jan 03
0
[PATCH nbdkit v3 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
..._H #define NBDKIT_CACHE_H +#include <fcntl.h> + /* Size of a block in the cache. A 4K block size means that we need * 64 MB of memory to store the bitmaps for a 1 TB underlying image. * It is also smaller than the usual hole size for sparse files, which @@ -48,7 +50,18 @@ extern enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode; +/* Maximum size of the cache and high/low thresholds. */ +extern int64_t max_size; +extern int hi_thresh, lo_thresh; + /* Cache read requests. */ extern bool cache_on_read; +/* Do we support reclaiming cache blocks? */ +#ifdef FALLOC_FL_PUNCH_HOLE +#de...
2018 Dec 28
0
[PATCH nbdkit 2/9] cache: Add cache-on-read mode.
...m B<cache-on-read=false> + +Do not cache read requests (this is the default). + =back =head1 ENVIRONMENT VARIABLES diff --git a/filters/cache/cache.c b/filters/cache/cache.c index 1dc17fd..b1c3d53 100644 --- a/filters/cache/cache.c +++ b/filters/cache/cache.c @@ -90,6 +90,9 @@ static enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode = CACHE_MODE_WRITEBACK; +/* Cache read requests. */ +static bool cache_on_read = false; + static int cache_flush (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, uint32_t flags, int *err); static void @@ -156,6 +159,15 @@ cache_config (nbdk...
2020 Aug 07
0
Re: [PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...ADV_DONTNEED) > + uint32_t orig_count = count; > + uint64_t orig_offset = offset; > + > + /* If cache=none we want to force pages we have just written to the > + * file to be flushed to disk so we can immediately evict them from > + * the page cache. > + */ > + if (cache_mode == cache_none) flags |= NBDKIT_FLAG_FUA; > +#endif > + > while (count > 0) { > ssize_t r = pwrite (h->fd, buf, count, offset); > if (r == -1) { > @@ -369,6 +453,12 @@ file_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, > if ((...
2020 Aug 07
0
Re: [PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...t;+ uint64_t orig_offset = offset; > > >+ > > >+ /* If cache=none we want to force pages we have just written to the > > >+ * file to be flushed to disk so we can immediately evict them from > > >+ * the page cache. > > >+ */ > > >+ if (cache_mode == cache_none) flags |= NBDKIT_FLAG_FUA; > > >+#endif > > >+ > > > while (count > 0) { > > > ssize_t r = pwrite (h->fd, buf, count, offset); > > > if (r == -1) { > > >@@ -369,6 +453,12 @@ file_pwrite (void *handle, const void...
2019 Jan 03
0
[PATCH nbdkit v4 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
..._H #define NBDKIT_CACHE_H +#include <fcntl.h> + /* Size of a block in the cache. A 4K block size means that we need * 64 MB of memory to store the bitmaps for a 1 TB underlying image. * It is also smaller than the usual hole size for sparse files, which @@ -48,6 +50,10 @@ extern enum cache_mode { CACHE_MODE_UNSAFE, } cache_mode; +/* Maximum size of the cache and high/low thresholds. */ +extern int64_t max_size; +extern int hi_thresh, lo_thresh; + /* Cache read requests. */ extern bool cache_on_read; diff --git a/filters/cache/reclaim.h b/filters/cache/reclaim.h new file mode 10...
2013 Nov 25
14
[PATCH] VMX: wbinvd when vmentry under UC
....c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -642,10 +642,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v) __invept(INVEPT_SINGLE_CONTEXT, ept_get_eptp(ept_data), 0); } - /* For guest cr0.cd setting, do not use potentially polluted cache */ - if ( unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) ) - wbinvd(); - vmx_restore_guest_msrs(v); vmx_restore_dr(v); } @@ -2967,6 +2963,27 @@ out: nvmx_idtv_handling(); } +/* + * wbinvd is a _very_ time consuming operation, so + * 1. wbinvd ... timer has a good possibility to expire while + * irq...
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
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