All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dedupe_percentage should work even if compress_percentage is not set
@ 2015-01-27 19:24 Vasily Tarasov
  2015-01-28 16:11 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Vasily Tarasov @ 2015-01-27 19:24 UTC (permalink / raw)
  To: fio

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

[PATCH] dedupe_percentage should work even if compress_percentage is not set 

Currently dedupe_percentage option does not work properly if compress_percentage
is not set. This can be easily demonstrated using the following job file:

[job-/dev/dm-0]
filename=/dev/dm-0
rw=randwrite
blocksize=4096
direct=1
ioengine=libaio
iodepth=32
dedupe_percentage=50
time_based=1
runtime=5
numjobs=1

All writes will contain zeroes for the above job file.

The problem is in fill_io_buffer() function that switches dedupe random state
only if o->compress_percentage is set.                                                                                                                                                                         

This patch updates the condition appropriately in fill_io_buffer()
appropriately.

Signed-off-by: Vasily Tarasov <tarasov@vasily.name>

[-- Attachment #2: diff-dedupe.diff --]
[-- Type: text/x-diff, Size: 436 bytes --]

diff --git a/backend.c b/backend.c
index 9012140..25db74a 100644
--- a/backend.c
+++ b/backend.c
@@ -1866,7 +1867,7 @@ void fill_io_buffer(struct thread_data *td, void *buf, unsigned int min_write,
 {
 	struct thread_options *o = &td->o;
 
-	if (o->compress_percentage) {
+	if (o->compress_percentage || o->dedupe_percentage) {
 		unsigned int perc = td->o.compress_percentage;
 		struct frand_state *rs;
 		unsigned int left = max_bs;

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

* Re: [PATCH] dedupe_percentage should work even if compress_percentage is not set
  2015-01-27 19:24 [PATCH] dedupe_percentage should work even if compress_percentage is not set Vasily Tarasov
@ 2015-01-28 16:11 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-01-28 16:11 UTC (permalink / raw)
  To: Vasily Tarasov, fio

On 01/27/2015 12:24 PM, Vasily Tarasov wrote:
> [PATCH] dedupe_percentage should work even if compress_percentage is not set
>
> Currently dedupe_percentage option does not work properly if compress_percentage
> is not set. This can be easily demonstrated using the following job file:
>
> [job-/dev/dm-0]
> filename=/dev/dm-0
> rw=randwrite
> blocksize=4096
> direct=1
> ioengine=libaio
> iodepth=32
> dedupe_percentage=50
> time_based=1
> runtime=5
> numjobs=1
>
> All writes will contain zeroes for the above job file.
>
> The problem is in fill_io_buffer() function that switches dedupe random state
> only if o->compress_percentage is set.
>
> This patch updates the condition appropriately in fill_io_buffer()
> appropriately.

Thanks, looks good, applied.

-- 
Jens Axboe



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

end of thread, other threads:[~2015-01-28 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 19:24 [PATCH] dedupe_percentage should work even if compress_percentage is not set Vasily Tarasov
2015-01-28 16:11 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.