From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932745Ab3BKWMl (ORCPT ); Mon, 11 Feb 2013 17:12:41 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41093 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932253Ab3BKWMk (ORCPT ); Mon, 11 Feb 2013 17:12:40 -0500 Date: Mon, 11 Feb 2013 14:12:39 -0800 From: Andrew Morton To: Johannes Weiner Cc: Rusty Russell , LKML , Nick Piggin , Stewart Smith Subject: Re: RFC: mincore: add a bit to indicate a page is dirty. Message-Id: <20130211141239.f4decf03.akpm@linux-foundation.org> In-Reply-To: <20130211162701.GB13218@cmpxchg.org> References: <87a9rbh7b4.fsf@rustcorp.com.au> <20130211162701.GB13218@cmpxchg.org> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Feb 2013 11:27:01 -0500 Johannes Weiner wrote: > > Is PG_dirty the right choice? Is that right for huge pages? Should I > > assume is_migration_entry(entry) means it's not dirty, or is there some > > other check here? > > If your only consequence of finding dirty pages is to sync, would you > be better off using fsync/fdatasync maybe? Yes, if the data is all on disk then an fsync() will be a no-op. IOW, if (I need to fsync) fsync(); is equivalent to fsync(); Methinks we need to understand the requirement better. Also, having to mmap the file to be able to query pagecache state is a hack. Whatever happened to the fincore() patch?