From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 9 19:01:56 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AD8A16A401 for ; Fri, 9 Mar 2007 19:01:56 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 78ACA13C428 for ; Fri, 9 Mar 2007 19:01:56 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id DE5CE2C2AB6; Fri, 9 Mar 2007 12:37:51 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qGpXwbIH2vvx; Fri, 9 Mar 2007 12:37:51 -0600 (CST) Received: from [216.63.78.18] (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 27CDE2C2AAF; Fri, 9 Mar 2007 12:37:51 -0600 (CST) Message-ID: <45F1A97D.7090608@cs.rice.edu> Date: Fri, 09 Mar 2007 12:37:49 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061115 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Divacky Roman References: <20070309132851.GA52655@stud.fit.vutbr.cz> In-Reply-To: <20070309132851.GA52655@stud.fit.vutbr.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: alc@freebsd.org, hackers@freebsd.org Subject: Re: possibly missed wakeup in swap_pager_getpages() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2007 19:01:56 -0000 Divacky Roman wrote: >hi > > > [snip] >is my analysis correct? if so, can the race be mitigated by moving the flag setting (hence >also the locking) after the msleep()? > > > No. When the wakeup is performed, the VPO_SWAPINPROG flag is also cleared. Both operations occur in the I/O completion handler with the object locked. Thus, if the I/O completion handler runs first, the msleep on the page within the while loop will not occur because the page's VPO_SWAPINPROG flag is already cleared. Regards, Alan