Path: utzoo!mnetor!uunet!munnari!goanna!ajk From: ajk@goanna.oz (Alan Kent) Newsgroups: comp.sys.amiga Subject: simple AmigaDos thrashing solution Message-ID: <1177@goanna.oz> Date: 17 Feb 88 22:43:31 GMT References: <8504@sunybcs.UUCP> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 44 > AmigaDos should sort disk requests by track. ... ... > This would eliminate thrashing, and would speed up disk accesses to boot! ... > How major a change in AmigaDog is this? The simplest way to stop AmigaDos thrashing would be to make the trackdisk.device cache more than one track. This should not be very difficult and would not involve touching AmigaDos. It would however require consume more memory. What happens now when accessing two files is that the trackdisk reads one track to get a single sector, but then has to go off somewhere else to get another single sector for the other file. This causes the first track to be lost forcing it to be reloaded to get the next sector for the first file. AmigaDos does seem to allocate contiguous sectors most of the time. Buffering say two tracks would cause thrashing at a track level rather than a sector level, but at least this is an order of magnitude better and still keeps good concurrency. Buffering multiple tracks also helps with directory listings. I wrote a harddisk driver which buffered 5 tracks with a bit of intelligence about which buffers to discard and it made a huge improvement. I dont think sorting disk seeks would help that much. Programs which cause a file to be read sector by sector (rather than doing read/writes which are multiple sectors long) would still thrash if you sorted the seeks due to the synchronous nature of the Read() and Write() calls. At any one time there would only be two read requests in the queue (if two separate processes are reading files). Due to the delay between requests for reads by the program to the same file, Dos would have already said "well, I've only got one thing left in the queue so I will go get that now". You would have to delay the actual disk access until you were sure that another request for the same file was not going to arrive. Tricky! So, anyone want to rewrite "trackdisk.device" and have a new command "settrack "? You could get rid of addbuffers if you wanted to. Perhaps it could be put in 1.3. Alan Kent (RMIT, Melbourne, AUSTRALIA) UUCP: {uunet,hplabs,mcvax,ukc,nttlab}!munnari!goanna.oz!ajk ARPA: munnari!goanna.oz!ajk@SEISMO.ARPA ACSnet: ajk@goanna.oz (is there a standard international way of doing addresses yet?)