how to enable cache flushes for hard disk?

Denis Vlasenko vda.linux at googlemail.com
Tue May 22 20:43:21 UTC 2007


On Tuesday 22 May 2007 07:27, kaimi wrote:
> hi,all
>     I want to enable cache flushes for my hd on s3c2410 & linux-2.6.20,
> ide_id_has_flush_cache() return 0 because cfs_enable_2 is 0x201, while it
> needs 0x3000, I found out that 0x201 was from 512 bytes of id
> info,implemented in static void ata_input_data(ide_drive_t *drive, void
> *buffer, u32 wcount)
> the question is, does it mean my hd does not support cache flush on hw
> layer? if not, how to enable?
> thanks for the coming help!

"Cache flush" has nothing to do with hdparm -T.

hdparm -T measures reads done repeatedly at start of device:

                do {
                        ++iterations;
                        if (seek_to_zero(fd) || read_big_block(fd, buf))
                                goto quit;
                        getitimer(ITIMER_REAL, &e2);
                        elapsed = (e1.it_value.tv_sec - e2.it_value.tv_sec)
                                + ((e1.it_value.tv_usec - e2.it_value.tv_usec) / 1000000.0);
                } while (elapsed < 2.0);

[read_big_block is simply read(TIMING_BUF_BYTES) + dirty
each sector's first byte]

Any non-ancient disk and kernel will cache the data after
the first read. Subsequent reads depend on the speed
of IDE bus, CPU, and memory. Now imagine now vastly different
those are is your PC and your target machine.
--
vda



More information about the busybox mailing list