Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbcCVVvK (ORCPT ); Tue, 22 Mar 2016 17:51:10 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:60177 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbcCVVvG (ORCPT ); Tue, 22 Mar 2016 17:51:06 -0400 Subject: Re: [PATCH 2/6] writeback: wb_start_writeback() should use WB_SYNC_ALL for WB_REASON_SYNC To: Dave Chinner References: <1458669320-6819-1-git-send-email-axboe@fb.com> <1458669320-6819-3-git-send-email-axboe@fb.com> <20160322213427.GR11812@dastard> <56F1BBCC.8050004@fb.com> CC: , , From: Jens Axboe Message-ID: <56F1BE45.5040906@fb.com> Date: Tue, 22 Mar 2016 15:51:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F1BBCC.8050004@fb.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-22_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 28 On 03/22/2016 03:40 PM, Jens Axboe wrote: > On 03/22/2016 03:34 PM, Dave Chinner wrote: >> 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. > > It's not going to block. wakeup_flusher_threads() async queues writeback > work through wb_start_writeback(). For block here, you mean the async work ending up doing wait_on_page_writeback() because we're doing WB_SYNC_ALL instead of WB_SYNC_NONE? And if so: >> 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. why not have it do that? -- Jens Axboe