How to disable devhb-eide read-ahead feature?

I want to disable the devb-eide read-ahead feature to bypass ide driver read ahead cache and get ‘truely’ flash read benchmark (synchronous read).

What argument can I use to achieve this purpose?

read-ahead of what?

If you mean block I/O support, use “noraâ€

I tried “devb-eide blk nora” and read/write() function call with no luck. For both 6.3.0 and 6.3.2, all kinds of flash chip (ATA IDE interface) has the same read speed. I did not use fread() which might have buffer inside.

I also set both ‘alloc’ and ‘cache’ to zero (devb-eide blk commit=high, alloc=0, cache=0, nora) . In this case, both 6.3.0 and 6.3.2, all kinds of flash chip also has the same read speed, but write speed was different .

Result :
CASE 1 : devb-eide blk nora :
read() can’t work.
CASE 2 :devb-eide blk commit=high, alloc=0, cache=0, nora :
write() can work ,but read() can’t.

I have same problem too in my testing case. For write speed, PIO4 is 1.9MB/s and UltraATA2 is 5MB/s for same device under different mode.
However, the reading speed is the same for both PIO4 and UltraATA2.
Where it appears impossible, due to PIO and UltraATA read speed should be different for same device.

It looks like QNX 6.3.x ‘nora’ is not working…

How do you measure the read speed?

As below is my source code:

[code]
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>

#include <time.h>

#define BILLION 1000000000L;

char buffer[3145728] = { };

int main( int argc ,char *argv[] )
{
int fd_w;
int size_written;

int fd_r;
int size_read;
     
struct timespec start, stop;
double accum;



switch( atoi( argv[1]) ){
	case 0: //read
 	
 	    /* Open a file for input */
        fd_r = open( "myfile.dat", O_RDONLY );
	  
	    if( clock_gettime( CLOCK_REALTIME, &start) == -1 ) {
      	   perror( "clock gettime" );
     	   return EXIT_FAILURE;
     	}
	  
	    /***************** Read the data **********************/
	    size_read = read( fd_r, buffer,sizeof( buffer ) );
        /******************************************************/
	    
	    if( clock_gettime( CLOCK_REALTIME, &stop) == -1 ) {
     	   perror( "clock gettime" );
     	   return EXIT_FAILURE;
     	}

        if( size_read == -1 ) {
           perror( "Error reading myfile.dat" );
           return EXIT_FAILURE;
        }

     	
     	/*time caculator*/
     	accum = ( stop.tv_sec - start.tv_sec )
      	   + (double)( stop.tv_nsec - start.tv_nsec )
       	    / (double)BILLION;

         printf( "%lf sec \n", accum );

     	 accum = 3 / accum ;
    
     	 printf( "Read Speed : %lf MB/sec \n", accum );
	  
	     close( fd_r );


	  
	 break;
	
    case 1: //write
	  	printf("write test\n");



	  	/* open a file for output          */
      	/* replace existing file if it exists */
      	fd_w = creat( "myfile.dat", S_IRUSR | S_IWUSR );
	  
	  	
	  	if( clock_gettime( CLOCK_REALTIME, &start) == -1 ) {
      	    perror( "clock gettime" );
     	    return EXIT_FAILURE;
     	}
      
     	/***************** Write the data ***************************/
     	size_written = write( fd_w, buffer,sizeof( buffer ) );
	    /************************************************************/
	     
	  	
	  	if( clock_gettime( CLOCK_REALTIME, &stop) == -1 ) {
     	     perror( "clock gettime" );
     	    return EXIT_FAILURE;
     	}

		/*time caculator*/
     	accum = ( stop.tv_sec - start.tv_sec )
      	   + (double)( stop.tv_nsec - start.tv_nsec )
       	    / (double)BILLION;

        printf( "%lf sec \n", accum );

     	accum = 3 / accum ;
    
     	printf( "Write Speed : %lf MB/sec \n", accum );
      
     	 
     	 /* close the file              */
    	 close( fd_w );

	   
	  break;
	  
	default :
	 
	 break; 
}	


return EXIT_SUCCESS;

}[/code]

Try to checking size_read against -1 but sizeof( buffer ). Also check the sloginfo to see if your devices have DMA enable or not. If it’s running in PIO mode then actual device speed is somewhat irrelevant as PIO is very slow.

I did not quitely understand the meaning of "Try to checking size_read against -1 but sizeof( buffer ). "
Can you explain in more detail?

Of course sloginfo had checked that DMA enabled for UDMA mode. As the result show that for writng speed, the PIO mode is 1.9MB/s and UDMA mode 5MB/s . The windows HD bench tool had the same write speed result as QNX, therefore it proves that PIO and DMA mode was correctly set.

I did not quitely understand the meaning of "Try to checking size_read against -1 but sizeof( buffer ). "
Can you explain in more detail?

Of course sloginfo had checked that DMA enabled for UDMA mode. As the result show that for writng speed, the PIO mode is 1.9MB/s and UDMA mode 5MB/s . The windows HD bench tool had the same write speed result as QNX, therefore it proves that PIO and DMA mode was correctly set.

You check size_read against -1 but there is no guaranty read() will read the size you requested, it might read less (although it’s very unlikely for block device).

UDMA at 5 MB/s that seems low?