Date: Wed, 4 May 2016 14:22:55 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: kumara rathnavel <kumara.bsd@gmail.com> Cc: freebsd-drivers@freebsd.org Subject: Re: Device Pager Message-ID: <20160504112255.GB2422@kib.kiev.ua> In-Reply-To: <CA%2BNzLaNuqf3=i_Yq9f%2BY3zMXSbwYHe_JzN7Uf-t==GyEG-jwPQ@mail.gmail.com> References: <CA%2BNzLaNuqf3=i_Yq9f%2BY3zMXSbwYHe_JzN7Uf-t==GyEG-jwPQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 04, 2016 at 07:51:55AM +0530, kumara rathnavel wrote: > Hello All, > > I have written a character device pager. I have associated an object with > my device and I have mapped it to the kernel and I also have a virtual > address for it. So whenever the address is accessed first time I get a page > fault and i give the physical address to be associated in the fault > routine. Now how do I again get a page fault for the same virtual address. > I need to change the physical address periodically for a virtual address. This cannot be done with the device_pager, i.e. OBJT_DEVICE. VM system does not track mappings of the page into userspace processes, so it cannot invalidate existing mappings. What can be used for this purpose is OBJT_MGTDEVICE, which operates on managed fictitious pages. Such pages do track userspace mappings with the usual PV-lists mechanisms, so pmap_remove_all() works. This kind of pager is used by GEM and TTM. There is not much useful documentation about OBJT_MGTDEVICE, read the source to see how it is plumbed.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160504112255.GB2422>