Tmpfs elimination of double-copy

John Baldwin jhb at freebsd.org
Mon Jun 21 15:43:46 UTC 2010


On Monday 21 June 2010 8:58:25 am Kostik Belousov wrote:
> Hi,
> Below is the patch that eliminates second copy of the data kept by tmpfs
> in case a file is mapped. Also, it removes potential deadlocks due to
> tmpfs doing copyin/out while page is busy. It is possible that patch
> also fixes known issue with sendfile(2) of tmpfs file, but I did not
> verified this.
> 
> Patch essentially consists of three parts:
> - move of vm_object' vnp_size from the type-discriminated union to the
>   vm_object proper;
> - making vm not choke when vm object held in the struct vnode' v_object
>   is default or swap object instead of vnode object;
> - use of the swap object that keeps data for tmpfs VREG file, also as
>   v_object.
> 
> Peter Holm helped me with the patch, apparently we survive fsx and stress2.

Why did you have to move vnp_size out of the union?  Is tmpfs using a non-
OBJT_VNODE object to hold file data?

-- 
John Baldwin


More information about the freebsd-fs mailing list