Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944291AbcJaPk3 (ORCPT ); Mon, 31 Oct 2016 11:40:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56391 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944236AbcJaPkZ (ORCPT ); Mon, 31 Oct 2016 11:40:25 -0400 Date: Mon, 31 Oct 2016 08:40:21 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Kirill A . Shutemov" , Jens Axboe Subject: Re: [PATCH 46/60] block: deal with dirtying pages for multipage bvec Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477728600-12938-47-git-send-email-tom.leiming@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 569 Lines: 12 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.