From: Prashant Shah Subject: Re: Fwd: block level cow operation Date: Fri, 10 May 2013 18:44:16 +0530 Message-ID: References: <87txnfrcbp.fsf@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: linux-ext4@vger.kernel.org To: Dmitry Monakhov Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:50228 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187Ab3EJNOh (ORCPT ); Fri, 10 May 2013 09:14:37 -0400 Received: by mail-ee0-f46.google.com with SMTP id e49so223152eek.33 for ; Fri, 10 May 2013 06:14:36 -0700 (PDT) In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org List-ID: Hi, On Thu, Apr 25, 2013 at 6:30 PM, Prashant Shah wrote: > Hi, > > On Tue, Apr 9, 2013 at 8:16 PM, Dmitry Monakhov wrote: >> >> you should not block bio/requests handling, but simply deffer original >> bio. Some things like that: >> >> OUR_MAIN_ENTERING_POINT { >> if (bio->bi_rw == WRITE) { >> if (cow_required(bio)) >> cow_bio = create_cow_copy(bio) >> submit_bio(cow_bio); >> } >> /* Cow is not required */ >> submit_bio(bio); >> } > >> This approach gives us reasonable performance ~3 times slower than disk >> throughput. >> For a reference implementation you may look at driver/dm/dm-snap or to >> Acronis snapapi module (AFAIR it is opensource) >> } Is this scenario possible ? If a write bio (bio1) for a particular sector is under cow and waiting for the read of the original block to complete. At the same time there is another write bio (bio2) for the same sector. The original order is bio1 then bio2. Now since bio1 is delayed due to cow and the new order becomes bio2 followed by bio1 that goes in the queue. This will cause the final on-disk write to be bio1. Regards.