NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-vax/41139: pipe(2) seems broken on VAX



On Apr 7,  9:25pm, mhitch%lightning.msu.montana.edu@localhost ("Michael L. 
Hitch") wrote:
-- Subject: Re: port-vax/41139: pipe(2) seems broken on VAX

| The following reply was made to PR port-vax/41139; it has been noted by GNATS.
| 
| From: "Michael L. Hitch" <mhitch%lightning.msu.montana.edu@localhost>
| To: gnats-bugs%NetBSD.org@localhost
| Cc: 
| Subject: Re: port-vax/41139: pipe(2) seems broken on VAX
| Date: Tue, 7 Apr 2009 14:48:39 -0600 (MDT)
| 
|     The problem appears to only occur when the requested transfer size is > 
|  PIPE_SIZE, and an additional buffer of BIG_PIPE_SIZE is allocated and 
|  used.  The defaults are 16KB and 64KB respectively.  Setting BIG_PIPE_SIZE 
|  to a smaller value (I've tested 63KB) seems to cure the problem.  The real 
|  root of the problem is that sys_pipe.c uses uiomove() to transfer the 
|  data, which uses copyin()/copyout().  On the vax, this is done with the 
|  movc3 instruction, which uses a 16-bit length, and will not transfer 
|  anything when the length is 0 (which it will be with a 64KB size).
|  
|     The simplest fix would be to set BIG_PIPE_SIZE in 
|  sys/arch/vax/include/param.h.  There does appear to be an improvment 
|  between using 32KB and 63KB in the one test I did.
|  
|     A better fix would be to make copyin()/copyout() work with 64KB or 
|  larger sizes.  I'm not sure what performance impact that might have 
|  though.  The quick test I just did shows that just fixing copyin/copyout 
|  to check for 64KB and transfer one byte with movb before doing the movc3 
|  seems to show that it was slightly slower than when I was using a 63KB 
|  BIG_PIPE_SIZE.
|  
|     One other note - this also appears to have been the problem with using 
|  scp on the vax to transfer files.  My scp copies no longer get corrupted 
|  data.  [Since scp does a pipe to run the remote ssh command and copies the 
|  data from the pipe, this makes sense.]


Can't we do?

        while (len >= 64K) {
                movc3 64K-1, ...
                len -= 64K-1;
        }
        movc3 len, ...

In kcopy, copyin and copyout?

christos


Home | Main Index | Thread Index | Old Index