LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-20-2014, 03:32 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 173

Rep: Reputation: 0
how to flush the file writes to SD more frequently ?


We read/write files in SD card a lot, basically keeping on doing file IO.
During power lost, we found a lot of times files lost the latest changes.
There're too many places to change in the code if we want to call sync().

So what's the linux config to shrink the file write buffer size, so that writes can be flushed into SD more often ?

Thanks !
 
Old 03-20-2014, 04:48 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
You could mount with the sync option, which means writes won't be buffered at all.
You could also lower vm.dirty_background_ratio and vm.dirty_ratio, or reduce vm.dirty_expire_centisecs either of which would affect all disk cache.
 
Old 03-20-2014, 05:24 PM   #3
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
we're using ext4 ordered mode now, if use the mount option (writeback mode) you mentioned, the problem is there won't be journaling, if kernel file etc. gets corrupted, no way for FS to fix it ?

will try the other options, thanks !

Quote:
Originally Posted by smallpond View Post
You could mount with the sync option, which means writes won't be buffered at all.
You could also lower vm.dirty_background_ratio and vm.dirty_ratio, or reduce vm.dirty_expire_centisecs either of which would affect all disk cache.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
99% cpu usage due to flush-8:0 & flush-8:16 propofol Debian 4 09-09-2011 03:03 PM
[SOLVED] trace writes to file BenCollver Linux - Server 4 12-05-2010 11:30 AM
pf flush persist file problem jack111 *BSD 8 02-04-2009 03:06 AM
Flush file system cache? bean66 Linux - General 5 03-14-2007 02:17 PM
flush or seek in file descriptor to a joystick/gamepad samel_tvom Programming 6 11-05-2006 06:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration