Hi Srinivasa. I still got page cache increasing even when I used those option. Here is output without those option: fio --filename=/opt/test --size=1G --direct=1 --sync=1 --rw=randrw --bs=4k --numjobs=1 --iodepth=8 --runtime=60 --time_based --group_reporting --name=journal-test --invalidate=1 --gtod_reduce=1 --ioengine=libaio HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB 337 0 0 100.0% 0 95 411 0 89005 100.0% 0 664 337 0 38526 100.0% 0 816 337 0 26605 100.0% 0 920 591 0 19906 100.0% 0 998 337 0 12283 100.0% 0 1046 457 0 11351 100.0% 0 1090 337 0 12398 100.0% 0 1138 337 0 13252 100.0% 0 1190 337 0 11876 100.0% 0 1237 337 0 8723 100.0% 0 1271 337 0 12844 100.0% 0 1321 337 0 4612 100.0% 0 1340 457 0 0 100.0% 0 1340 337 0 3 100.0% 0 1340 457 0 0 100.0% 0 1340 457 0 0 100.0% 0 1340 337 0 0 100.0% 0 1340 336 1 0 99.7% 0 316 And here is output with those option: fio --filename=/opt/test --size=1G --direct=1 --sync=1 --rw=randrw --bs=4k --numjobs=1 --iodepth=8 --runtime=60 --time_based --group_reporting --name=journal-test --invalidate=1 --gtod_reduce=1 --ioengine=libaio --create_on_open=1 --fallocate=none HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB 337 0 0 100.0% 0 95 337 0 0 100.0% 0 95 337 0 0 100.0% 0 95 410 1 0 99.8% 0 316 337 0 9 100.0% 0 316 337 0 0 100.0% 0 316 337 0 3 100.0% 0 316 337 0 0 100.0% 0 316 337 0 0 100.0% 0 316 1828 0 10 100.0% 0 316 337 0 0 100.0% 0 316 337 0 0 100.0% 0 316 337 0 0 100.0% 0 316 As you can see the page cache still increase from 95 to 316 when using those option. I don't understand why the dd command with option oflag=direct gave no page cache increasing while fio increased page cache. Could you help me please? Thanks a lot in advance. Regards, Son -----Original Message----- From: Srinivasa Chamarthy [mailto:chamarthy.raju@xxxxxxxxx] Sent: Friday, April 21, 2017 12:07 PM To: Son Chu <son.ct@xxxxxxxxxxxxx> Cc: Sitsofe Wheeler <sitsofe@xxxxxxxxx>; fio@xxxxxxxxxxxxxxx Subject: Re: Does fio really bypass page cache with option direct=1? You may use options --create_on_open=1 --fallocate=none. By default FIO will prepare the file of the size (creates a sparse file) and then performs IO. The options --create_on_open=1 and --fallocate=none should skip the step. -- Srinivasa R Chamarthy On Fri, Apr 21, 2017 at 9:54 AM, Son Chu <son.ct@xxxxxxxxxxxxx> wrote: > Hi Sitsofe, > > Sorry if this email troubled you but I could not find any useful > information for this. I am getting the question with fio page cache > bypass option (direct=1 ioengine=libaio) > > I am using fio version 2.19 with command: > > fio --filename=/opt/test --direct=1 --rw=randrw --randrepeat=0 > --ioengine=libaio --bs=4k --rwmixread=75 --iodepth=16 --numjobs=1 > --name=4ktest --size=1G > > and i used cachestat tool from here to monitor: > https://github.com/brendangregg/perf-tools > > The output was: > > Counting cache functions... Output every 1 seconds. > > HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB > > 1399 42 0 97.1% 2 31 > > 1408 0 0 100.0% 2 31 > > -68699 39 71478 100.1% 3 532 > > -21325 0 22886 100.0% 3 621 > > -19956 0 21492 100.0% 3 705 > > -13739 0 15254 100.0% 3 765 > > As far as i know the buffer cache and page cache was unified from Linux kernel version 2.4. So i wondered why fio with option direct=1 that didn’t bypass page cache as it should? > > I didn’t see page cache increasing when using dd with oflag=direct to copy or write file to disk. > > Please correct me if i am wrong. > > Thanks a lot in advance. > > Regards, > Son > > -- > To unsubscribe from this list: send the line "unsubscribe fio" in the > body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at > http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html