RetroBSD
http://retrobsd.org/

fs crashes with ccom
http://retrobsd.org/viewtopic.php?f=16&t=37464
Page 1 of 1

Author:  Pito [ Thu Dec 31, 2015 9:40 am ]
Post subject:  fs crashes with ccom

Even the pcc is "unstable as of today" - for the record - I see following issue when running ccom:
Code:
# pcc -v -E rct.c > rct.i
PCC preprocessor version Portable C Compiler 1.2.0.DEVEL 20151220 for mipsel-unk
nown-litebsd0.1
# /usr/libexec/ccom rct.i > rct.s
rct.c, line 46: invalid function definition
rct.c, line 46: syntax error
rct.c, line 46: invalid function definition
rct.c, line 46: invalid function definition
rct.c, line 46: invalid function definition
rct.c, line 46: invalid function definition
rct.c, line 46: invalid function definition
sd0: card_read: READ_MULTIPLE timed out, reply = 255
PID -1072591661 (kernel fault 0x2 at pc=9d00e440, badvaddr=0000003d
panic: trap
syncing disks... sd0: card_write: data rejected, reply = ff
sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff
sd0: card_cmd timeout, cmd=17, addr=00000008, reply=ff
sd0: card_write: bad SET_WBECNT reply = ff, count = 8
sd0: card_cmd timeout, cmd=12, addr=0003014a, reply=ff
sd0: card_read: bad READ_MULTIPLE reply = 255, offset = 0003014a
sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff
sd0: card_cmd timeout, cmd=17, addr=00000008, reply=ff
sd0: card_write: bad SET_WBECNT reply = ff, count = 8
done
dumping to dev 2, offset 64512
dump device bad
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

Running the sdcard at fastest speed. No issues with the sdcard seen otherwise.

Author:  vak [ Tue Jan 05, 2016 8:23 am ]
Post subject:  Re: fs crashes with ccom

Looks like a timeout for READ_MULTIPLE operation is too small in the SD driver.

Author:  Pito [ Fri Jan 08, 2016 12:40 pm ]
Post subject:  Re: fs crashes with ccom

I've changed in sd.c
Code:
#define TIMO_READ       90000

to
Code:
#define TIMO_READ       300000

and it seems it helps:
Code:
# ls
rc4.c   rc4.s
# ksh
# cc -O2 -S -c rc4.c
# time cc -O2 -S -c rc4.c
    1m20.99s real     1m2.83s user     0m-1.104s system
# time cc -O2 -S -c rc4.c
    1m22.99s real     1m3.163s user     0m-1.99s system
# time cc -O2 -S -c rc4.c
    1m20.39s real     1m2.74s user     0m-1.101s system
# time cc -O2 -S -c rc4.c
    1m19.129s real     1m1.149s user     0m-1.107s system
# time cc -O2 -S -c rc4.c
    1m21.97s real     1m3.70s user     0m-1.100s system
#

The only issue I see is the compile time - it is quite close to a "computer collaps" :)
With the pipe:
Code:
# time cc -pipe -O2 -S -c rc4.c
    1m19.52s real     1m1.110s user     0m-1.99s system
# time cc -pipe -O2 -S -c rc4.c
    1m21.128s real     1m3.104s user     0m-1.103s system
# time cc -pipe -O2 -S -c rc4.c
    1m19.123s real     1m1.151s user     0m-1.99s system
#

and yes, I run at 50MHz SPI
Code:
# diskspeed
Testing 4-kbyte block size.
Write speed: 8 Mbytes in 3.702 seconds = 2212 kbytes/sec
 Read speed: 8 Mbytes in 2.434 seconds = 3365 kbytes/sec
#

:twisted: the current clock2clock compile performance (exclusive "as") is 285.7 times worse than the same done w/ SmallerC under RetroBSD (and yes, I do understand the complexity of LiteBSD stuff is much bigger) :)
PS: Waiting desperately on the "as" availability. Hopefully, the binary will be in turn 285x faster (after such optimization effort) :lol:

Author:  Pito [ Fri Jan 08, 2016 7:54 pm ]
Post subject:  Re: fs crashes with ccom

Code:
# time cc -O2 -S -c rc4.c &
[1] 68
# ps
  PID TT  STAT      TIME COMMAND
   37  2  IWs    0:00.96 -sh (sh)
   51  2  S      0:05.88 ksh
   68  2  SW     0:00.16 ksh
   69  2  S      0:00.13 cc -O2 -S -c rc4.c
   71  2  R      0:02.66 /usr/libexec/ccom -xtemps -xdeljumps -xinline -xdce /t
   72  2  R+     0:00.08 (ps)
#     1m50.53s real     1m22.139s user     0m-1.101s system

Author:  vak [ Fri Jan 08, 2016 8:08 pm ]
Post subject:  Re: fs crashes with ccom

Makes sense to look at how much paging is there. Try to compare "vmstat -s" counters before and after the compile.

Author:  Pito [ Sat Jan 09, 2016 9:04 am ]
Post subject:  Re: fs crashes with ccom

Attachment:
vmstat.JPG
vmstat.JPG [ 165.15 KiB | Viewed 18832 times ]

All above in ~78secs.
CLOCK-Pro may help
http://web.cse.ohio-state.edu/hpcs/WWW/ ... R-05-3.pdf
Attachment:
clockpro.JPG
clockpro.JPG [ 97.26 KiB | Viewed 18814 times ]

Attachment:
cpro cpp.JPG
cpro cpp.JPG [ 53.88 KiB | Viewed 18814 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/