[Bug 200693] fsync() in the latest kernel (4.15.x ) Broken ????

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=200693

--- Comment #1 from caron.wills@xxxxxxxxx ---
4.15.0-29-generic - # time ./fsync
real 1m38.299s <-----
user 0m0.013s
sys 0m0.893s <-----


Source stolen from else where. ;-)

#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <unistd.h>


void withSync() {
int f = open( "/tmp/t8" , O_RDWR | O_CREAT );
lseek (f, 0, SEEK_SET );
int records = 10*1000;
clock_t ustart = clock();
for(int i = 0; i < records; i++) {
write(f, "012345678901234567890123456789" , 30);
fsync(f);
}
clock_t uend = clock();
close (f);
printf(" sync() seconds:%lf writes per second:%lf\n",
((double)(uend-ustart))/(CLOCKS_PER_SEC),
((double)records)/((double)(uend-ustart))/(CLOCKS_PER_SEC));
}


void withoutSync() {
int f = open( "/tmp/t10" , O_RDWR | O_CREAT );
lseek (f, 0, SEEK_SET );
int records = 10*1000;
clock_t ustart = clock();
for(int i = 0; i < records; i++) {
write(f, "012345678901234567890123456789" , 30 );
}
clock_t uend = clock();
close (f);
printf("no sync() seconds:%lf writes per second:%lf \n",
((double)(uend-ustart))/(CLOCKS_PER_SEC),
((double)records)/((double)(uend-ustart))/(CLOCKS_PER_SEC));
}


int main(int argc, const char * argv[])
{
/* withoutSync();*/
withSync();
return 0;
}

-- 
You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux