[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 11/13] block/mirror: remove block_job_sleep_n
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v2 11/13] block/mirror: remove block_job_sleep_ns calls |
Date: |
Wed, 7 Feb 2018 23:56:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 2018-02-07 23:46, Max Reitz wrote:
> On 2018-01-19 21:58, John Snow wrote:
>> We're attempting to slacken the mirror loop in three different places,
>> but we can combine these three attempts. Combine the early loop call to
>> block_job_pause_point with the two late-loop calls to block_job_sleep_ns.
>>
>> When delay_ns is 0 and it has not been SLICE_TIME since the last yield,
>> block_job_relax is merely a call to block_job_pause_point, so this should
>> be equivalent with the exception that if we have managed to not yield at
>> all in the last SLICE_TIME ns, we will now do so.
>>
>> I am not sure that condition was possible,
>> so this loop should be equivalent.
>
> Well, to me it even sounds like a positive change if it was a change.
> We want the job to yield after SLICE_TIME ns, after all, and I don't
> think it matters where that happens, exactly.
>
>>
>> Signed-off-by: John Snow <address@hidden>
>> ---
>> block/mirror.c | 22 +++++++++++-----------
>> block/trace-events | 2 +-
>> 2 files changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/block/mirror.c b/block/mirror.c
>> index a0e0044de2..192e03694f 100644
>> --- a/block/mirror.c
>> +++ b/block/mirror.c
>> @@ -761,7 +761,7 @@ static void coroutine_fn mirror_run(void *opaque)
>> assert(!s->dbi);
>> s->dbi = bdrv_dirty_iter_new(s->dirty_bitmap);
>> for (;;) {
>> - uint64_t delay_ns = 0;
>> + static uint64_t delay_ns = 0;
>
> Errr. Are you sure about that?
>
> Now every mirror job in the qeny process will share this single
> variable. Was that your intention?
("Errr" @myself for "qeny")
signature.asc
Description: OpenPGP digital signature