The attached programme demonstrates the point. With kernel 2.1.42 and
2.1.62 it generates steady disc activity, but with relatively little
head movement. Running with kernel 2.1.65 causes a lot of head
movement. The programme was run without arguments on a filesystem (1k
blocksize) with the following 'df' output:
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/sdd2 2203855 449139 1732602 21% /data
The disc is a FUJITSU Model: M2952S-512 connected to an NCR 53c857.
So, do those who know think that the new behaviour is correct (if so,
why?), or is it a bug or side-effect? I'm hoping the latter and that
it's fixable, because it really slows down latex2html (and I have a
few pretty big "living" documents).
Regards,
Richard....
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#define MAX_ITER 10000
int main (int argc, char **argv)
{
int count;
int max_iter = MAX_ITER;
FILE *fp;
if (argc > 1) max_iter = atoi (argv[1]);
while (1)
{
if ( ( fp = fopen ("a", "w") ) == NULL )
{
fprintf ( stderr, "Error opening: \"a\"\t%s\n", strerror (errno) );
exit (1);
}
for (count = 0; count < max_iter; ++count) fputs ("hi\n", fp);
fflush (fp);
fsync ( fileno (fp) );
fclose (fp);
if ( ( fp = fopen ("b", "w") ) == NULL )
{
fprintf ( stderr, "Error opening: \"b\"\t%s\n", strerror (errno) );
exit (1);
}
for (count = 0; count < max_iter; ++count) fputs ("bye\n", fp);
fflush (fp);
fsync ( fileno (fp) );
fclose (fp);
}
} /* End Function main */