Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S948141AbcKAATK (ORCPT ); Mon, 31 Oct 2016 20:19:10 -0400 Received: from mail-vk0-f46.google.com ([209.85.213.46]:33234 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S948099AbcKAATI (ORCPT ); Mon, 31 Oct 2016 20:19:08 -0400 MIME-Version: 1.0 In-Reply-To: <20161031154021.GM30919@infradead.org> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> <1477728600-12938-47-git-send-email-tom.leiming@gmail.com> <20161031154021.GM30919@infradead.org> From: Ming Lei Date: Tue, 1 Nov 2016 08:19:06 +0800 Message-ID: Subject: Re: [PATCH 46/60] block: deal with dirtying pages for multipage bvec To: Christoph Hellwig Cc: Jens Axboe , Linux Kernel Mailing List , linux-block , Linux FS Devel , "Kirill A . Shutemov" , Jens Axboe Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 22 On Mon, Oct 31, 2016 at 11:40 PM, Christoph Hellwig wrote: > On Sat, Oct 29, 2016 at 04:08:45PM +0800, Ming Lei wrote: >> In bio_check_pages_dirty(), bvec->bv_page is used as flag >> for marking if the page has been dirtied & released, and if >> no, it will be dirtied in deferred workqueue. >> >> With multipage bvec, we can't do that any more, so change >> the logic into checking all pages in one mp bvec, and only >> release all these pages if all are dirtied, otherwise dirty >> them all in deferred wrokqueue. > > Just defer the whole bio to the workqueue if we need to redirty any, > that avoids having all these complex iteratations. For dio READ, it is always dirtied before submitting, so there should be little possibity that pages in the bio becomes non-dirty after completion, it should hurt performance if each direct-read bio is deferred to the block wq. thanks, Ming Lei