Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Oct 2011 16:56:34 +0200
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: pmap_qenter() - the page *must* be wired - is violated
Message-ID:  <CAFHCsPWOCJfzd0oTdGH47bZYSah4hdSCrv_aCk7yfHhxpNXcKg@mail.gmail.com>
In-Reply-To: <20111006115252.GH1511@deviant.kiev.zoral.com.ua>
References:  <CAFHCsPX2dzv9Hk-WM_%2BQj%2BovihQZs17y=Guouj8t-3T_nQtLXw@mail.gmail.com> <20111005145333.GD1511@deviant.kiev.zoral.com.ua> <CAFHCsPUjdxW2w%2BN2hyS8FTOEKFFXjyLHxV47-iW9WdQMK1NRqg@mail.gmail.com> <20111006115252.GH1511@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/10/6 Kostik Belousov <kostikbel@gmail.com>:
> On Thu, Oct 06, 2011 at 01:45:16PM +0200, Svatopluk Kraus wrote:
>> On Wed, Oct 5, 2011 at 4:53 PM, Kostik Belousov <kostikbel@gmail.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPWOCJfzd0oTdGH47bZYSah4hdSCrv_aCk7yfHhxpNXcKg>