Return-Path: Received: from ipmail04.adl6.internode.on.net ([150.101.137.141]:64710 "EHLO ipmail04.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbcCVVfF (ORCPT ); Tue, 22 Mar 2016 17:35:05 -0400 Date: Wed, 23 Mar 2016 08:34:27 +1100 From: Dave Chinner To: Jens Axboe Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 2/6] writeback: wb_start_writeback() should use WB_SYNC_ALL for WB_REASON_SYNC Message-ID: <20160322213427.GR11812@dastard> References: <1458669320-6819-1-git-send-email-axboe@fb.com> <1458669320-6819-3-git-send-email-axboe@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458669320-6819-3-git-send-email-axboe@fb.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Mar 22, 2016 at 11:55:16AM -0600, Jens Axboe wrote: > If you call sync, the initial call to wakeup_flusher_threads() ends up > calling wb_start_writeback() with reason=WB_REASON_SYNC, but > wb_start_writeback() always uses WB_SYNC_NONE as the writeback mode. > Ensure that we use WB_SYNC_ALL for a sync operation. This seems wrong to me. We want background write to happen as quickly as possible and /not block/ when we first kick sync. The latter blocking passes of sync use WB_SYNC_ALL to ensure that we block waiting for all remaining IO to be issued and waited on, but the background writeback doesn't need to do this. Cheers, Dave. -- Dave Chinner david@fromorbit.com