[OpenAFS-devel] reproducible problem during cache flush

Neulinger, Nathan nneul@umr.edu
Thu, 1 Aug 2002 11:36:32 -0500


Since DoPartialWrite does that check already (short circuit at top of
func), does the "skip a function call" really have the much overhead
benefit?

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216


> -----Original Message-----
> From: chas williams [mailto:chas@cmf.nrl.navy.mil]=20
> Sent: Thursday, August 01, 2002 11:33 AM
> To: Nickolai Zeldovich
> Cc: openafs-devel@openafs.org
> Subject: Re: [OpenAFS-devel] reproducible problem during cache flush=20
>=20
>=20
> just to beat this problem to death but as mentioned previously the
> current fix provides somewhat poor performance on writes. =20
> the following
> should perform better.  its based on what the solaris client does.
> the writepage checks to see if there are too many dirty blocks and
> calls DoPartialWrite.  btw, should we grab avc->lock before the
> afs_write()?
>=20
> Index: src/afs/VNOPS/afs_vnop_write.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v
> retrieving revision 1.8.2.8
> diff -u -d -b -w -r1.8.2.8 afs_vnop_write.c
> --- src/afs/VNOPS/afs_vnop_write.c	2002/07/30 21:35:53	1.8.2.8
> +++ src/afs/VNOPS/afs_vnop_write.c	2002/08/01 16:26:16
> @@ -283,7 +283,7 @@
>  	if (filePos > avc->m.Length)
>  	    avc->m.Length =3D filePos;
>  #endif
> -#if !defined(AFS_VM_RDWR_ENV) || defined(AFS_LINUX22_ENV)
> +#if !defined(AFS_VM_RDWR_ENV)
>  	/*
>  	 * If write is implemented via VM, afs_DoPartialWrite()=20
> is called from
>  	 * the high-level write op.
> @@ -580,7 +580,7 @@
>  	}
>  #endif
>  	osi_UFSClose(tfile);
> -#if !defined(AFS_VM_RDWR_ENV) || defined(AFS_LINUX22_ENV)
> +#if !defined(AFS_VM_RDWR_ENV)
>  	/*
>  	 * If write is implemented via VM, afs_DoPartialWrite()=20
> is called from
>  	 * the high-level write op.
> Index: src/afs/LINUX/osi_vnodeops.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
> retrieving revision 1.29.2.16
> diff -u -d -b -w -r1.29.2.16 osi_vnodeops.c
> --- src/afs/LINUX/osi_vnodeops.c	2002/07/30 21:27:18=09
> 1.29.2.16
> +++ src/afs/LINUX/osi_vnodeops.c	2002/08/01 16:26:16
> @@ -1391,7 +1391,7 @@
>      struct vcache *vcp =3D ITOAFS(ip);
>      char *buffer;
>      loff_t base;
> -    int code =3D 0;
> +    int code =3D 0, code2 =3D 0;
>      cred_t *credp;
>      uio_t tuio;
>      struct iovec iovec;
> @@ -1405,13 +1405,27 @@
>                ICL_TYPE_POINTER, pp,
>                ICL_TYPE_INT32, atomic_read(&pp->count),
>                ICL_TYPE_INT32, 99999);
> +
>      setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE,=20
> AFS_UIOSYS);
> =20
>      code =3D afs_write(vcp, &tuio, f_flags, credp, 0);
> =20
>      vcache2inode(vcp);
> =20
> +    if (!code && afs_stats_cmperf.cacheCurrDirtyChunks >=20
> afs_stats_cmperf.cacheMaxDirtyChunks) {
> +	struct vrequest treq;
> +	int code2 =3D 0;
> +
> +        ObtainWriteLock(&vcp->lock, 533);
> +	if (!afs_InitReq(&treq, credp))
> +		code2 =3D afs_DoPartialWrite(vcp, &treq);
> +        ReleaseWriteLock(&vcp->lock);
> +    }
> +    if (code2)
> +	code =3D -code2;
> +    else
>      code =3D code ? -code : count - tuio.uio_resid;
> +
>      afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE,=20
> ICL_TYPE_POINTER, vcp,
>                ICL_TYPE_POINTER, pp,
>                ICL_TYPE_INT32, atomic_read(&pp->count),
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel
>=20