svn commit: r281644 - head/sys/dev/usb/video

Hans Petter Selasky hps at selasky.org
Fri Apr 17 21:16:45 UTC 2015


On 04/17/15 14:44, John Baldwin wrote:
> On Friday, April 17, 2015 07:07:07 AM Hans Petter Selasky wrote:
>> Author: hselasky
>> Date: Fri Apr 17 07:07:06 2015
>> New Revision: 281644
>> URL: https://svnweb.freebsd.org/changeset/base/281644
>>
>> Log:
>>    Buffers which can be memory mapped into userspace should never be
>>    freed. Recycle the buffers instead. This patch also fixes a panic at
>>    reboot issue when an UDL adapter is attached to the system.
>
> You can free them safely if you don't use malloc() / free().  Instead, you
> could create an OBJT_PHYS object that you wire when you map into the kernel
> and export that to userland via d_mmap_single.  In your driver you just
> need to unmap the kernel mapping to drop the reference count on the object.
> Once the userland processes exit or remove their mappings the pages would
> be freed.
>

Hi,

If you want to make a patch for UDL as a good example how to do this, 
please go ahead! I can test the driver is not broken afterwards.

--HPS


More information about the svn-src-all mailing list