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: [EMAIL PROTECTED] University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 > -----Original Message----- > From: chas williams [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 01, 2002 11:33 AM > To: Nickolai Zeldovich > Cc: [EMAIL PROTECTED] > Subject: Re: [OpenAFS-devel] reproducible problem during cache flush > > > just to beat this problem to death but as mentioned previously the > current fix provides somewhat poor performance on writes. > 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()? > > Index: src/afs/VNOPS/afs_vnop_write.c > =================================================================== > 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 = 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() > 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() > is called from > * the high-level write op. > Index: src/afs/LINUX/osi_vnodeops.c > =================================================================== > 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 > 1.29.2.16 > +++ src/afs/LINUX/osi_vnodeops.c 2002/08/01 16:26:16 > @@ -1391,7 +1391,7 @@ > struct vcache *vcp = ITOAFS(ip); > char *buffer; > loff_t base; > - int code = 0; > + int code = 0, code2 = 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, > AFS_UIOSYS); > > code = afs_write(vcp, &tuio, f_flags, credp, 0); > > vcache2inode(vcp); > > + if (!code && afs_stats_cmperf.cacheCurrDirtyChunks > > afs_stats_cmperf.cacheMaxDirtyChunks) { > + struct vrequest treq; > + int code2 = 0; > + > + ObtainWriteLock(&vcp->lock, 533); > + if (!afs_InitReq(&treq, credp)) > + code2 = afs_DoPartialWrite(vcp, &treq); > + ReleaseWriteLock(&vcp->lock); > + } > + if (code2) > + code = -code2; > + else > code = code ? -code : count - tuio.uio_resid; > + > afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, > ICL_TYPE_POINTER, vcp, > ICL_TYPE_POINTER, pp, > ICL_TYPE_INT32, atomic_read(&pp->count), > _______________________________________________ > OpenAFS-devel mailing list > [EMAIL PROTECTED] > https://lists.openafs.org/mailman/listinfo/openafs-devel > _______________________________________________ OpenAFS-devel mailing list [EMAIL PROTECTED] https://lists.openafs.org/mailman/listinfo/openafs-devel
