From owner-freebsd-current@FreeBSD.ORG Thu Oct 6 14:56:53 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F3F106564A for ; Thu, 6 Oct 2011 14:56:52 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id AE49C8FC12 for ; Thu, 6 Oct 2011 14:56:52 +0000 (UTC) Received: by qyk4 with SMTP id 4so2974458qyk.13 for ; Thu, 06 Oct 2011 07:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=0Osh7VBqjeivd3OvATJrfLUKN2zPAZDKrkD520UlrDQ=; b=mVbGatdZgXT0oe6eQQYXp33wEc1ICR3JVLyoAGphceoW3sPHeN5c1fTwsIoQNwJMs2 um38xmiVSwKCL7wGElW1Yrv6iC162cQlyJdPOt9jMi0pthlYsTsi0EQ7QrqGwVS7cEat WGVZ+ERTBksXqQtQ3InIlKepgerYXeNhzORz4= MIME-Version: 1.0 Received: by 10.68.31.4 with SMTP id w4mr6420857pbh.20.1317912995056; Thu, 06 Oct 2011 07:56:35 -0700 (PDT) Received: by 10.142.131.21 with HTTP; Thu, 6 Oct 2011 07:56:34 -0700 (PDT) In-Reply-To: <20111006115252.GH1511@deviant.kiev.zoral.com.ua> References: <20111005145333.GD1511@deviant.kiev.zoral.com.ua> <20111006115252.GH1511@deviant.kiev.zoral.com.ua> Date: Thu, 6 Oct 2011 16:56:34 +0200 Message-ID: From: Svatopluk Kraus To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: pmap_qenter() - the page *must* be wired - is violated X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2011 14:56:53 -0000 2011/10/6 Kostik Belousov : > On Thu, Oct 06, 2011 at 01:45:16PM +0200, Svatopluk Kraus wrote: >> On Wed, Oct 5, 2011 at 4:53 PM, Kostik Belousov wr= ote: >> > On Wed, Oct 05, 2011 at 02:28:01PM +0200, Svatopluk Kraus wrote: >> >> Hi, >> >> >> >> =A0 I found out that on a few places pmap_qenter() is called on pages >> >> which are not wired. For example, in the following functions, when >> >> vm_pager_get_pages() is called, the pages are not wired: >> >> >> >> =A0 exec_map_first_page() in sys/kern/kern_exec.c >> >> =A0 vm_fault_hold() in sys/vm/vm_fault.c >> >> =A0 vm_imgact_hold_page() in sys/vm/vm_glue.c >> >> =A0 vm_object_populate() in sys/vm/vm_object.c >> >> =A0 mdstart_swap() in sys/dev/md/md.c >> >> >> >> =A0 Is the rule violated or the rule should be changed? >> > >> > Lets first discuss where did you found the calls to pmap_qenter(). >> > Can you point out exact line numbers of the calls to pmap_qenter() >> > that you consider problematic ? >> > >> > In fact, the requirement probably shall be 'no swapout allowed'. E.g., >> > the busy page is fully qualified to be used together with pmap_qenter(= ). >> >> Well, I just follow description above pmap_qenter() blindly and test for >> page wire_count inside the function. All function calls, I mentioned bef= ore, >> are OK as pages are VPO_BUSY'd. Thanks for your explanation. > Still, I am not aware of any (direct) calls to pmap_qenter in the mention= ed > functions. > The functions allocate page(s) and then call vm_pager_get_pages() which calling stack could be be following: vnode_pager_getpages() VOP_GETPAGES() vop_stdgetpages() vnode_pager_generic_getpages() pmap_qenter() or for fs/nfsclient: VOP_GETPAGES() ncl_getpages() pmap_qenter() Many file systems call pmap_qenter() in their .vop_getpages implementation.