Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752513AbbKPW24 (ORCPT ); Mon, 16 Nov 2015 17:28:56 -0500 Received: from mail-io0-f174.google.com ([209.85.223.174]:34797 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbbKPW2x (ORCPT ); Mon, 16 Nov 2015 17:28:53 -0500 Subject: Re: [PATCH] blk-flush: Queue through IO scheduler when flush not required To: Jan Kara References: <1447334752-31027-1-git-send-email-jack@suse.com> Cc: Jeff Moyer , LKML From: Jens Axboe Message-ID: <564A58A3.6020005@kernel.dk> Date: Mon, 16 Nov 2015 15:28:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447334752-31027-1-git-send-email-jack@suse.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1251 Lines: 27 On 11/12/2015 06:25 AM, Jan Kara wrote: > Currently blk_insert_flush() just adds flush request to q->queue_head > when flush is not required. That completely bypasses IO scheduler so > e.g. CFQ can be idling waiting for new request to arrive and will idle > through the whole window unnecessarily. Luckily this only happens in > rare cases as usually checks in generic_make_request_checks() clear > FLUSH and FUA flags early if they are not needed. > > When no flushing is actually required, we can easily fix the problem by > properly queueing the request through the IO scheduler. Ideally IO > scheduler should be also made aware of requests queued via > blk_flush_queue_rq(). However inserting flush request through IO > scheduler can have unwanted side-effects since due to flush batching > delaying the flush request in IO scheduler will delay all flush requests > possibly coming from other processes. So we keep adding the request > directly to q->queue_head. Applied, thanks Jan. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/