From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932524AbbELIyx (ORCPT ); Tue, 12 May 2015 04:54:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50337 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932131AbbELIyt (ORCPT ); Tue, 12 May 2015 04:54:49 -0400 MIME-Version: 1.0 In-Reply-To: <20150512072405.GB25438@infradead.org> References: <1430932106-17451-1-git-send-email-ming.lei@canonical.com> <1430932106-17451-2-git-send-email-ming.lei@canonical.com> <20150507071618.GA7595@infradead.org> <20150511071909.GA19488@infradead.org> <20150512072405.GB25438@infradead.org> Date: Tue, 12 May 2015 16:54:47 +0800 Message-ID: Subject: Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO From: Ming Lei To: Christoph Hellwig Cc: Linux Kernel Mailing List , Dave Kleikamp , Jens Axboe , Zach Brown , Maxim Patlasov , Andrew Morton , Alexander Viro , Tejun Heo Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2015 at 3:24 PM, Christoph Hellwig wrote: > On Mon, May 11, 2015 at 09:02:54PM +0800, Ming Lei wrote: >> > But those would be user pages. Anyone who passes a kernel page doesn't >> >> Inside kernel it is hard to say one page in page cache is kernel or >> user page, :-) > > Inside the kernel it's easy to say that it's the caller business to > make sure we don't need to carry through hacks like this. > >> > expect it do be dirtied for normal kernel interfaces. >> >> Currently the coming direct IO introduced for loop should be the 1st direct >> read inside kernel, so there isn't the case of passing kernel pages, and >> obviously ITER_BVEC/ITER_KVEC doesn't mean the page is 'kernel' page. >> >> Another direct IO inside kernel is __swap_writepage(), and it is still >> ITER_BVEC and user page. Maybe in the future swap_readpage() >> can use direct IO with BVEC too. > > > Swap will have very different rules to deal with page dirtying as it's > part of the VM subsystem. Again, the caller will now better. Yes, the caller knows better, that is why I introduce the flag, so the caller can set the flag if it need direct-io to bypass the dirtying, otherwise the caller can just clear the flag. Or I understand you wrong? Thanks, Ming Lei