qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
@ 2019-02-28  9:26 Andrey Shinkevich
  2019-02-28 10:26 ` Vladimir Sementsov-Ogievskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrey Shinkevich @ 2019-02-28  9:26 UTC (permalink / raw)
  To: qemu-devel, qemu-block; +Cc: mreitz, kwolf, den, vsementsov, andrey.shinkevich

When a bitmap is removed, we can clean some space on the disk. The size
of a cluster may be larger, so is the size of the bitmap that includes
many clusters. Some bitmaps can be as large as tens of megabytes.
The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
that does the actual cleaning of the image on disk, while with the flag
QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
v1: Discard old bitmap directories in QCOW2 image

In the first version of the patch, any call to qcow2_free_clusters() in
block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
cases when the cleaned space is insignificant, particularly, in case of
bitmap directories.
Discussed in the email thread with the message ID
<1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>

 block/qcow2-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 3ee524d..162744e 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -202,7 +202,7 @@ static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_table,
             continue;
         }
 
-        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER);
+        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_ALWAYS);
         bitmap_table[i] = 0;
     }
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
  2019-02-28  9:26 [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed Andrey Shinkevich
@ 2019-02-28 10:26 ` Vladimir Sementsov-Ogievskiy
       [not found] ` <28859adc-27c2-e2ed-3f24-ba620236970f@redhat.com>
  2019-04-08 19:03 ` [Qemu-devel] " Max Reitz
  2 siblings, 0 replies; 8+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2019-02-28 10:26 UTC (permalink / raw)
  To: Andrey Shinkevich, qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: mreitz@redhat.com, kwolf@redhat.com, Denis Lunev

28.02.2019 12:26, Andrey Shinkevich wrote:
> When a bitmap is removed, we can clean some space on the disk. The size
> of a cluster may be larger, so is the size of the bitmap that includes
> many clusters. Some bitmaps can be as large as tens of megabytes.
> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
> that does the actual cleaning of the image on disk, while with the flag
> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.

not quite right, as it depends on configuration.

So I'd reword the whole message to be simpler, like:

Bitmap data may take a lot of disk space, so it's better to discard it always.

> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>


Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

> ---
> v1: Discard old bitmap directories in QCOW2 image
> 
> In the first version of the patch, any call to qcow2_free_clusters() in
> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
> cases when the cleaned space is insignificant, particularly, in case of
> bitmap directories.
> Discussed in the email thread with the message ID
> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
> 
>   block/qcow2-bitmap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index 3ee524d..162744e 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -202,7 +202,7 @@ static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_table,
>               continue;
>           }
>   
> -        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER);
> +        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_ALWAYS);
>           bitmap_table[i] = 0;
>       }
>   }
> 


-- 
Best regards,
Vladimir

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2] qcow2: discard bitmap when removed
       [not found] ` <28859adc-27c2-e2ed-3f24-ba620236970f@redhat.com>
@ 2019-04-08  9:56   ` Andrey Shinkevich
  2019-04-08  9:56     ` Andrey Shinkevich
  0 siblings, 1 reply; 8+ messages in thread
From: Andrey Shinkevich @ 2019-04-08  9:56 UTC (permalink / raw)
  To: John Snow, qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: kwolf@redhat.com, Denis Lunev, Vladimir Sementsov-Ogievskiy,
	mreitz@redhat.com

PINGING

I kindly remind you about this small patch for QEMU 4.1.
I am going to be away for vacation from April, 10th to May, 15th.
-- 
With the best regards,
Andrey Shinkevich


On 19/03/2019 01:18, John Snow wrote:
> 
> 
> On 2/28/19 4:26 AM, Andrey Shinkevich wrote:
>> When a bitmap is removed, we can clean some space on the disk. The size
>> of a cluster may be larger, so is the size of the bitmap that includes
>> many clusters. Some bitmaps can be as large as tens of megabytes.
>> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
>> that does the actual cleaning of the image on disk, while with the flag
>> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>> v1: Discard old bitmap directories in QCOW2 image
>>
>> In the first version of the patch, any call to qcow2_free_clusters() in
>> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
>> cases when the cleaned space is insignificant, particularly, in case of
>> bitmap directories.
>> Discussed in the email thread with the message ID
>> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
>>
>>   block/qcow2-bitmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
>> index 3ee524d..162744e 100644
>> --- a/block/qcow2-bitmap.c
>> +++ b/block/qcow2-bitmap.c
>> @@ -202,7 +202,7 @@ static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_table,
>>               continue;
>>           }
>>   
>> -        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER);
>> +        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_ALWAYS);
>>           bitmap_table[i] = 0;
>>       }
>>   }
>>
> Looks like 4.1 material now. Kevin may have been expecting me to engage
> with this, even though I do not maintain the qcow2-bitmap.c file. (And
> I'm very behind on reading mail that was not directly addressed to me,
> sorry...!)
> 
> Please resend when the 4.1 window opens and we'll address this then.
> 
> --js
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2] qcow2: discard bitmap when removed
  2019-04-08  9:56   ` [Qemu-devel] [Qemu-block] " Andrey Shinkevich
@ 2019-04-08  9:56     ` Andrey Shinkevich
  0 siblings, 0 replies; 8+ messages in thread
From: Andrey Shinkevich @ 2019-04-08  9:56 UTC (permalink / raw)
  To: John Snow, qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: kwolf@redhat.com, Vladimir Sementsov-Ogievskiy, Denis Lunev,
	mreitz@redhat.com

PINGING

I kindly remind you about this small patch for QEMU 4.1.
I am going to be away for vacation from April, 10th to May, 15th.
-- 
With the best regards,
Andrey Shinkevich


On 19/03/2019 01:18, John Snow wrote:
> 
> 
> On 2/28/19 4:26 AM, Andrey Shinkevich wrote:
>> When a bitmap is removed, we can clean some space on the disk. The size
>> of a cluster may be larger, so is the size of the bitmap that includes
>> many clusters. Some bitmaps can be as large as tens of megabytes.
>> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
>> that does the actual cleaning of the image on disk, while with the flag
>> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>> v1: Discard old bitmap directories in QCOW2 image
>>
>> In the first version of the patch, any call to qcow2_free_clusters() in
>> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
>> cases when the cleaned space is insignificant, particularly, in case of
>> bitmap directories.
>> Discussed in the email thread with the message ID
>> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
>>
>>   block/qcow2-bitmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
>> index 3ee524d..162744e 100644
>> --- a/block/qcow2-bitmap.c
>> +++ b/block/qcow2-bitmap.c
>> @@ -202,7 +202,7 @@ static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_table,
>>               continue;
>>           }
>>   
>> -        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER);
>> +        qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_ALWAYS);
>>           bitmap_table[i] = 0;
>>       }
>>   }
>>
> Looks like 4.1 material now. Kevin may have been expecting me to engage
> with this, even though I do not maintain the qcow2-bitmap.c file. (And
> I'm very behind on reading mail that was not directly addressed to me,
> sorry...!)
> 
> Please resend when the 4.1 window opens and we'll address this then.
> 
> --js
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
  2019-02-28  9:26 [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed Andrey Shinkevich
  2019-02-28 10:26 ` Vladimir Sementsov-Ogievskiy
       [not found] ` <28859adc-27c2-e2ed-3f24-ba620236970f@redhat.com>
@ 2019-04-08 19:03 ` Max Reitz
  2019-04-08 19:03   ` Max Reitz
  2019-04-09 13:18   ` Andrey Shinkevich
  2 siblings, 2 replies; 8+ messages in thread
From: Max Reitz @ 2019-04-08 19:03 UTC (permalink / raw)
  To: Andrey Shinkevich, qemu-devel, qemu-block; +Cc: kwolf, den, vsementsov

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

On 28.02.19 10:26, Andrey Shinkevich wrote:
> When a bitmap is removed, we can clean some space on the disk. The size
> of a cluster may be larger, so is the size of the bitmap that includes
> many clusters. Some bitmaps can be as large as tens of megabytes.
> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
> that does the actual cleaning of the image on disk, while with the flag
> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
> v1: Discard old bitmap directories in QCOW2 image
> 
> In the first version of the patch, any call to qcow2_free_clusters() in
> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
> cases when the cleaned space is insignificant, particularly, in case of
> bitmap directories.
> Discussed in the email thread with the message ID
> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
> 
>  block/qcow2-bitmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, changed the commit message to Vladimir’s proposal and applied to
my block-next branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block-next

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
  2019-04-08 19:03 ` [Qemu-devel] " Max Reitz
@ 2019-04-08 19:03   ` Max Reitz
  2019-04-09 13:18   ` Andrey Shinkevich
  1 sibling, 0 replies; 8+ messages in thread
From: Max Reitz @ 2019-04-08 19:03 UTC (permalink / raw)
  To: Andrey Shinkevich, qemu-devel, qemu-block; +Cc: kwolf, den, vsementsov

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

On 28.02.19 10:26, Andrey Shinkevich wrote:
> When a bitmap is removed, we can clean some space on the disk. The size
> of a cluster may be larger, so is the size of the bitmap that includes
> many clusters. Some bitmaps can be as large as tens of megabytes.
> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
> that does the actual cleaning of the image on disk, while with the flag
> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
> v1: Discard old bitmap directories in QCOW2 image
> 
> In the first version of the patch, any call to qcow2_free_clusters() in
> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
> cases when the cleaned space is insignificant, particularly, in case of
> bitmap directories.
> Discussed in the email thread with the message ID
> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
> 
>  block/qcow2-bitmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, changed the commit message to Vladimir’s proposal and applied to
my block-next branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block-next

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
  2019-04-08 19:03 ` [Qemu-devel] " Max Reitz
  2019-04-08 19:03   ` Max Reitz
@ 2019-04-09 13:18   ` Andrey Shinkevich
  2019-04-09 13:18     ` Andrey Shinkevich
  1 sibling, 1 reply; 8+ messages in thread
From: Andrey Shinkevich @ 2019-04-09 13:18 UTC (permalink / raw)
  To: Max Reitz, qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: kwolf@redhat.com, Denis Lunev, Vladimir Sementsov-Ogievskiy



On 08/04/2019 22:03, Max Reitz wrote:
> On 28.02.19 10:26, Andrey Shinkevich wrote:
>> When a bitmap is removed, we can clean some space on the disk. The size
>> of a cluster may be larger, so is the size of the bitmap that includes
>> many clusters. Some bitmaps can be as large as tens of megabytes.
>> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
>> that does the actual cleaning of the image on disk, while with the flag
>> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>> v1: Discard old bitmap directories in QCOW2 image
>>
>> In the first version of the patch, any call to qcow2_free_clusters() in
>> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
>> cases when the cleaned space is insignificant, particularly, in case of
>> bitmap directories.
>> Discussed in the email thread with the message ID
>> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
>>
>>   block/qcow2-bitmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thanks, changed the commit message to Vladimir’s proposal and applied to
> my block-next branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block-next
> 
> Max
> 

Thank you, Max!
-- 
With the best regards,
Andrey Shinkevich


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed
  2019-04-09 13:18   ` Andrey Shinkevich
@ 2019-04-09 13:18     ` Andrey Shinkevich
  0 siblings, 0 replies; 8+ messages in thread
From: Andrey Shinkevich @ 2019-04-09 13:18 UTC (permalink / raw)
  To: Max Reitz, qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: kwolf@redhat.com, Vladimir Sementsov-Ogievskiy, Denis Lunev



On 08/04/2019 22:03, Max Reitz wrote:
> On 28.02.19 10:26, Andrey Shinkevich wrote:
>> When a bitmap is removed, we can clean some space on the disk. The size
>> of a cluster may be larger, so is the size of the bitmap that includes
>> many clusters. Some bitmaps can be as large as tens of megabytes.
>> The flag QCOW2_DISCARD_ALWAYS allows a call to the raw_co_pdiscard()
>> that does the actual cleaning of the image on disk, while with the flag
>> QCOW2_DISCARD_OTHER, a reference count of the cluster is updated only.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>> v1: Discard old bitmap directories in QCOW2 image
>>
>> In the first version of the patch, any call to qcow2_free_clusters() in
>> block/qcow2-bitmap.c was with the flag QCOW2_DISCARD_ALWAYS, even in the
>> cases when the cleaned space is insignificant, particularly, in case of
>> bitmap directories.
>> Discussed in the email thread with the message ID
>> <1549974951-731285-1-git-send-email-andrey.shinkevich@virtuozzo.com>
>>
>>   block/qcow2-bitmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thanks, changed the commit message to Vladimir’s proposal and applied to
> my block-next branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block-next
> 
> Max
> 

Thank you, Max!
-- 
With the best regards,
Andrey Shinkevich


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-09 13:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28  9:26 [Qemu-devel] [PATCH v2] qcow2: discard bitmap when removed Andrey Shinkevich
2019-02-28 10:26 ` Vladimir Sementsov-Ogievskiy
     [not found] ` <28859adc-27c2-e2ed-3f24-ba620236970f@redhat.com>
2019-04-08  9:56   ` [Qemu-devel] [Qemu-block] " Andrey Shinkevich
2019-04-08  9:56     ` Andrey Shinkevich
2019-04-08 19:03 ` [Qemu-devel] " Max Reitz
2019-04-08 19:03   ` Max Reitz
2019-04-09 13:18   ` Andrey Shinkevich
2019-04-09 13:18     ` Andrey Shinkevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).