Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbZG3LtD (ORCPT ); Thu, 30 Jul 2009 07:49:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753332AbZG3LtC (ORCPT ); Thu, 30 Jul 2009 07:49:02 -0400 Received: from mk-filter-2-a-1.mail.uk.tiscali.com ([212.74.100.53]:43340 "EHLO mk-filter-2-a-1.mail.uk.tiscali.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220AbZG3LtB (ORCPT ); Thu, 30 Jul 2009 07:49:01 -0400 X-Trace: 238028220/mk-filter-2.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/80.41.7.60/None/hugh.dickins@tiscali.co.uk X-SBRS: None X-RemoteIP: 80.41.7.60 X-IP-MAIL-FROM: hugh.dickins@tiscali.co.uk X-SMTP-AUTH: X-MUA: X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAMclcUpQKQc8/2dsb2JhbACBUtA9hBEF X-IronPort-AV: E=Sophos;i="4.43,295,1246834800"; d="scan'208";a="238028220" Date: Thu, 30 Jul 2009 12:48:56 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@sister.anvils To: Robin Holt cc: Laurent Pinchart , linux-kernel@vger.kernel.org, v4l2_linux Subject: Re: Is get_user_pages() enough to prevent pages from being swapped out ? In-Reply-To: <20090730113951.GA2763@sgi.com> Message-ID: References: <200907291123.12811.laurent.pinchart@skynet.be> <200907291741.52783.laurent.pinchart@skynet.be> <20090730113951.GA2763@sgi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1080 Lines: 23 On Thu, 30 Jul 2009, Robin Holt wrote: > > > On Wednesday 29 July 2009 17:26:11 Hugh Dickins wrote: > ... > > > > On the other hand, despite the raised reference count, under memory > > > > pressure that page might get unmapped from the user pagetable, and > > > > might even be written out to swap in its half-dirty state (though > > One thing you did not mention in the above description is that the page > is marked clean by the write-out to swap. I am not sure I recall the > method of mapping involved here, but it is necessary to ensure the page > is marked dirty again before the driver releases it. If the page is > not marked dirty as part of your method of releasing it, the changes > you have made between when the page was first written out and when you > are freeing it will get lost. Yes indeed: thanks, Robin. Hugh -- 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/