Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Oct 1996 16:38:44 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        Doug Rabson <dfr@render.com>
Cc:        henrich@crh.cl.msu.edu, lite2@freebsd.org
Subject:   Re: Delayed write patch
Message-ID:  <1519.844933124@sat.t.u-tokyo.ac.jp>

next in thread | raw e-mail | index | archive | help
Hi, I got the problem!

dfr> If you change nfs_maxdelwri to zero using gdb or ddb, what write
dfr> performance do you see?  That ought to be the same as the nfs_dwrite==0
dfr> case.  I can't figure out why the other iods should get locked out.  Are
dfr> you sure that all the reqs are made by the same iod?

Yes, the problem was caused by..
1) the process processing DELWRT doesn't sleep.
(except when waiting packet, but at this point other iods are locked out)
2) normal iod will tsleep after processing one buffer.
3) if CPU is fast enough DELWRT process can get rcvlock after
rcvunlock without process switching.
(beause rcvunlock is sleep for waiting packet, it has enough time
until switching)

- results

1) -current (bwrite=1)
2) bwrite=0
3) bwrite=1 + my patch


client			 server
----------------------------------
A.               100M
FreeBSD          ------  Solaris 2.5  --- Fast Disk
Pentium Pro              Sun Ultra
1) 300KB/s write
2) 800KB/s write
3) 600KB/s write

B.		10M
FreeBSD         ------- FreeBSD  ------ Slow Disk
DX4 75MHz		Pentium 166MHz
1) 120KB/s write
2) 140KB/s write
3) 170KB/s write

I think it depends on an environment which is better bwrite=0 or
bwrite=1 and it should be able to be chosen by sysctl.

The following patch should fix the locking problem.
(I don't know which number I should return as error code,
please fix it.)
I think you should remove maxdelwri patch.
I would like to hear other results.

*** nfs_socket.c.orig   Sat Jul 27 07:08:43 1996
--- nfs_socket.c        Thu Oct 10 15:37:56 1996
***************
*** 682,695 ****
--- 682,700 ----
                 * Also necessary for connection based protocols to avoid
                 * race conditions during a reconnect.
                 */
+ #define ALREADY_RECEIVED      1
                error = nfs_rcvlock(myrep);
+               if (error == ALREADY_RECEIVED)
+                       return (0);
                if (error)
                        return (error);
+ #if 0
                /* Already received, bye bye */
                if (myrep->r_mrep != NULL) {
                        nfs_rcvunlock(&nmp->nm_flag);
                        return (0);
                }
+ #endif
                /*
                 * Get the next Rpc reply off the socket
                 */
***************
*** 1494,1499 ****
--- 1499,1506 ----
                *flagp |= NFSMNT_WANTRCV;
                (void) tsleep((caddr_t)flagp, slpflag | (PZERO - 1), "nfsrcvlk",
                        slptimeo);
+               if (rep->r_mrep != NULL)
+                       return(ALREADY_RECEIVED);
                if (slpflag == PCATCH) {
                        slpflag = 0;
                        slptimeo = 2 * hz;

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1519.844933124>