diff mbox

[1/3] qcow2: Set MIN_L2_CACHE_SIZE to 2

Message ID 1433174959-7176-2-git-send-email-mreitz@redhat.com
State New
Headers show

Commit Message

Max Reitz June 1, 2015, 4:09 p.m. UTC
The L2 cache must cover at least two L2 tables, because during COW two
L2 tables are accessed simultaneously.

Reported-by: Alexander Graf <agraf@suse.de>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/qcow2.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Max Reitz June 1, 2015, 4:10 p.m. UTC | #1
On 01.06.2015 18:09, Max Reitz wrote:
> The L2 cache must cover at least two L2 tables, because during COW two
> L2 tables are accessed simultaneously.
>
> Reported-by: Alexander Graf <agraf@suse.de>
> Cc: qemu-stable <qemu-stable@nongnu.org>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   block/qcow2.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 0076512..aa20022 100644
> --- a/block/qcow2.h
> +++ b/block/qcow2.h
> @@ -62,7 +62,8 @@
>   #define MIN_CLUSTER_BITS 9
>   #define MAX_CLUSTER_BITS 21
>   
> -#define MIN_L2_CACHE_SIZE 1 /* cluster */
> +/* Must be at least 2 to cover COW */
> +#define MIN_L2_CACHE_SIZE 2 /* clusters */
>   
>   /* Must be at least 4 to cover all cases of refcount table growth */
>   #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */

Of course git send-email ignored the qemu-stable line... CC-ing manually.

Max
Alexander Graf June 1, 2015, 4:12 p.m. UTC | #2
On 01.06.15 18:09, Max Reitz wrote:
> The L2 cache must cover at least two L2 tables, because during COW two
> L2 tables are accessed simultaneously.
> 
> Reported-by: Alexander Graf <agraf@suse.de>
> Cc: qemu-stable <qemu-stable@nongnu.org>
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Tested-by: Alexander Graf <agraf@suse.de>


Alex

> ---
>  block/qcow2.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 0076512..aa20022 100644
> --- a/block/qcow2.h
> +++ b/block/qcow2.h
> @@ -62,7 +62,8 @@
>  #define MIN_CLUSTER_BITS 9
>  #define MAX_CLUSTER_BITS 21
>  
> -#define MIN_L2_CACHE_SIZE 1 /* cluster */
> +/* Must be at least 2 to cover COW */
> +#define MIN_L2_CACHE_SIZE 2 /* clusters */
>  
>  /* Must be at least 4 to cover all cases of refcount table growth */
>  #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */
>
Alberto Garcia June 1, 2015, 4:14 p.m. UTC | #3
On Mon 01 Jun 2015 06:09:17 PM CEST, Max Reitz <mreitz@redhat.com> wrote:

> The L2 cache must cover at least two L2 tables, because during COW two
> L2 tables are accessed simultaneously.
>
> Reported-by: Alexander Graf <agraf@suse.de>
> Cc: qemu-stable <qemu-stable@nongnu.org>
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto
diff mbox

Patch

diff --git a/block/qcow2.h b/block/qcow2.h
index 0076512..aa20022 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -62,7 +62,8 @@ 
 #define MIN_CLUSTER_BITS 9
 #define MAX_CLUSTER_BITS 21
 
-#define MIN_L2_CACHE_SIZE 1 /* cluster */
+/* Must be at least 2 to cover COW */
+#define MIN_L2_CACHE_SIZE 2 /* clusters */
 
 /* Must be at least 4 to cover all cases of refcount table growth */
 #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */