RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Sep 15, 2019 11:01 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: fs crashes with ccom
PostPosted: Thu Dec 31, 2015 9:40 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
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.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: fs crashes with ccom
PostPosted: Tue Jan 05, 2016 8:23 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Looks like a timeout for READ_MULTIPLE operation is too small in the SD driver.


Top
 Profile  
 
 Post subject: Re: fs crashes with ccom
PostPosted: Fri Jan 08, 2016 12:40 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
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:

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: fs crashes with ccom
PostPosted: Fri Jan 08, 2016 7:54 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
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

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: fs crashes with ccom
PostPosted: Fri Jan 08, 2016 8:08 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Makes sense to look at how much paging is there. Try to compare "vmstat -s" counters before and after the compile.


Top
 Profile  
 
 Post subject: Re: fs crashes with ccom
PostPosted: Sat Jan 09, 2016 9:04 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Attachment:
vmstat.JPG
vmstat.JPG [ 165.15 KiB | Viewed 12989 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 12971 times ]

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

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission