[comp.sys.atari.st] Expanding the GEMDOS buffer list - is it a good idea??

preston@felix.UUCP (Preston L. Bannister) (01/10/87)

Has anyone tried expanding GEMDOS's build-in buffer lists for data,
directory and FAT sectors?  The BIOS seems to allocate four 512 byte
buffers, two for each list (data sector list, FAT/directory sector
list).


The BIOS Technical Reference manual lists the following system variable:

_bufl (long) $4b4

  Two (GEMDOS) buffer-list headers.  The first list buffers data
  sectors, the second list buffers FAT and directory sectors.  Each of
  these pointers points to a BCB (Buffer Control Block), that looks
  like:

      struct BCB
      {
	      BCB	*b_link;	/* next BCB */
	      int	b_bufdrv;	/* drive#, or -1 */
	      int	b_buftyp;	/* buffer type */
	      int	b_bufrec;	/* record# cached here */
	      int	b_dirty;	/* dirty flag */
	      DMD	*d_dm;		/* -> Drive Media Descriptor */
	      char	*b_bufr;	/* -> buffer itself */
      };

To be slightly more explicit:

  BCB *data_sector_buffer_list		at $4b4
  BCB *FAT_directory_buffer_list	at $4b8


I wouldn't mind allocating a hundred buffers (or so) if it would reduce
the number of disk accesses.  File access is a _lot_ slower than it
should be on my hard disk, due to the large number of disk accesses for
even simple operations.  MS_DOS lets you do something similar by
putting a line like 'BUFFERS=100' to allocate 100 buffers for caching
disk sectors.

Is this a good idea with GEMDOS?  Is it safe?  Will it work?  (Anyone
at Atari or DRI listening?)

I'd be willing try the experiment, but it would be nice if someone
would take a look at the actual GEMDOS code to make sure it isn't a
waste of time.

========================================
Preston L. Bannister
USENET	   :	ucbvax!trwrb!felix!preston
BIX	   :	plb
CompuServe :	177000,176

dyer@atari.UUcp (Landon Dyer) (01/11/87)

in article <2135@felix.UUCP>, preston@felix.UUCP (Preston L. Bannister) says:
> 
> I wouldn't mind allocating a hundred buffers (or so) if it would reduce
> the number of disk accesses.  File access is a _lot_ slower than it
> should be on my hard disk, due to the large number of disk accesses for
> even simple operations.  MS_DOS lets you do something similar by
> putting a line like 'BUFFERS=100' to allocate 100 buffers for caching
> disk sectors.
> 
> Is this a good idea with GEMDOS?  Is it safe?  Will it work?  (Anyone
> at Atari or DRI listening?)
> 
> I'd be willing try the experiment, but it would be nice if someone
> would take a look at the actual GEMDOS code to make sure it isn't a
> waste of time.

Adding buffers will increase performance --- but adding 100 of them on
GEMDOS's buffer lists is probably a bad idea; GEMDOS does a linear
search on the list.  It also likes to invalidate perfectly good blocks,
so even if you add 10, there's no g'tee they'll all get used.

Adding blocks is probably best done at the Rwabs() level, with a good
disk block cache.  Should be easy.

Unfortunately, GEMDOS is slow because it has problems at the "genetic"
level, which can't be fixed with patches or small modifications.  We
*are* working on a new file system, it will be significantly faster,
and it's going to be a while yet....

-- 

-Landon Dyer, Atari Corp.		        {sun,lll-lcc,imagen}!atari!dyer

/-----------------------------------------------\
| The views represented here do not necessarily | "If Business is War, then
| reflect those of Atari Corp., or even my own. |  I'm a Prisoner of Business!"
\-----------------------------------------------/