Re: Doing zero-copy stuff in drivers, or "is vm_fault_quick_hold_pages() enough" ?

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Mon, 2 Mar 2015 16:37:13 -0800
On 2 March 2015 at 16:25, Konstantin Belousov <kostikbel_at_gmail.com> wrote:

>> Ok, but is there a specific time length that this should be?
> Difference between hold and wire is effectively that held pages are
> still kept on the page queues, providing potentially uneccessary work
> for pagedaemon to find them and skip. Wired pages are removed from the
> queues.
>
> This means that holding a page is much cheaper, by the cost of leaving
> slightly more work to the system. Also, holding a page only requires the
> page lock, while wiring contend on the page queue lock, in addition to
> the page lock.

Thanks for the description - that makes things a lot clearer!

>>
>> A DMA operation to a slow device could be up to hundreds of
>> milliseconds; or seconds if things are really backed up.
>>
>> Using wire instead of hold definitely made things work without having
>> the page disappear from underneath it. Oleksander knows more about the
>> details of that.
>
> Page cannot 'disappear'. The only thing which could happen with the
> memory page is reuse, when the page is removed from the previous object
> and re-purposed for some other object, loosing old content.
>
> Your terminology suggests that something unrelated happen.

Yup, and that's what I'm worried about :(




-adrian
Received on Mon Mar 02 2015 - 23:37:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:56 UTC