Author Topic: CONFIG_FS_SYNC in Sharp kernel source  (Read 8912 times)

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« on: February 09, 2004, 08:40:12 pm »
I noticed an option in the .config file in Sharp\'s 2.4.18 kernel source, \"CONFIG_FS_SYNC = y\".  It appears to force synchronous file i/o regardless of if you mount a filesystem with \"-o async\".  This option appears to be an addition by Sharp along with the #ifdefs that test for it in various source files in the ./fs kernel source directory.
So, as a test, I tried un-taring a few files on an SD card (which was mounted -o async), with the standard kernel, and with a kernel compiled with this flag turned off.  The results are that with CONFIG_FS_SYNC turned on (and SD card mounted -o async), the operation took 230 seconds, and running a kernel with it turned off, the test took only 19 seconds (average of several tries), more than a 10:1 speed increase.
Also, I tied it with someone elses SD card that was having problems under ext2, (a Sandisk card), and all the problems appeared to go away.

Can anyone else who\'s into compiling their own kernels try this out, and report back the results?
For the record, I\'m running with my /home on the SD card, and also lately have been dual-booting OpenZaurus from the SD card, and turning this compilation flag off has made a world of difference in speed.

Thanks,
--derek

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« Reply #1 on: March 02, 2004, 02:32:21 pm »
I just uploaded my kernel which is compiled with this option turned off.  I\'ve been running it for a month or so while running my system of the SD card, and it has made a big differnce in SD (and CF) write speeds.  About a 10:1 speedup in some of the timing tests I\'ve done.
It is upload as file name \"zImage-sl5500-2.4.18-asyncio-c1\" under the 5500 kernel section.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #2 on: March 02, 2004, 04:14:28 pm »
This sounds great and since I\'m about to redo my Z I\'d like to try this, but I can\'t find it in the downloads section.

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« Reply #3 on: March 02, 2004, 05:34:56 pm »
It should show up shortly, the admins of this site need to verify/approve all new uploads.  Check back later tonight.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #4 on: March 02, 2004, 05:59:28 pm »
Thought so.  Thanks.  Guess I was a little too quick.

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
CONFIG_FS_SYNC in Sharp kernel source
« Reply #5 on: March 03, 2004, 12:54:05 pm »
Awsome!   I\'ve bult a kernel with this options turned off and I get huge speed increase accessing SD card!  This will definitely be included in the next Cacko Qtopia ROM kernel!!

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #6 on: March 03, 2004, 01:32:18 pm »
I\'m still waiting.  =(  Guess the speed excitment is getting the best of me.

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« Reply #7 on: March 03, 2004, 02:13:03 pm »
Last time I uploaded something, it was available that evening.  If it doesn\'t show up by this evening, then send me your email address, and I\'ll mail it to you (my email\'s dspsz@needcaffeine.net).

:edit: just found out I can attach a file directly to a comment

:edit 2: removed attachment from this comment, as the file has showed up in the download section now.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #8 on: March 03, 2004, 05:26:50 pm »
What are the negative aspects of removing CONFIG_FS_SYNC?  I assume Sharp has it there for a reason.  I would be interested in doing this for the next TKC if the corrupt SD card problems go away and there is no negative side affect.  Anyone have something to say on this?

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« Reply #9 on: March 03, 2004, 06:04:26 pm »
I believe the main effect would be that if you change out your CF/SD cards frequently, then you might accidently pull it out without unmounting/ejecting it first, which will result in potential data loss.  However, if you use the \"-o sync\" mount option along with removing CONFIG_FS_SYNC, then it should have the same effect as leaving the flag turned on (not sure why Sharp didn\'t go this route in the first place).   My vote would be to turn this flag off, and set the mount options for removeable media to default to -o sync (one could always issue a \"remount -o async\"  on the device to change it on the fly).  My prep-home-sd.sh script ends up mounting the SD card -o async anyways.  (BTW, be sure to have proto grab the latest one, I uploaded it to this board as \"prep-home-sd_test5.zip\").

Unfortunately, Sharp didn\'t feel the need to add any comments to the code for this option.  But the only parts that this option touches is in fs/buffer.c, fs/namei.c and fs/open.c (look for the \"#ifdef CONFIG_FS_SYNC\" lines in these files).  I also did a google search on CONFIG_FS_SYNC, and the only thing that I came up with were a couple of pages that had someones .config file in them, and a japanese page that looked like someones journal.  Babelfish did a weird job on that page.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #10 on: March 03, 2004, 11:43:44 pm »
Thanks...I will look into building that into the TKC 3.0 kernel.  I will have a look at the code that references CONFIG_FS_SYNC and look at its implications before removing it.  I am concerned that removing it may have a bigger impact than we think.  Sharp clearly had it there for a reason and I want to verify its intentions.

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CONFIG_FS_SYNC in Sharp kernel source
« Reply #11 on: March 04, 2004, 12:04:27 am »
I\'d be interested to see what you find out.  For the record, I\'ve been running root off my SD card for a while with this and no ill effects.  However, this of course doesn\'t involve frequent card swaps, which is where any implications may show up.  But my CF card hasn\'t showed any filesystem problems yet.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #12 on: March 04, 2004, 10:04:00 am »
Derekp, can you try posting this again as nothing has shown up yet?  Thanks.

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #13 on: March 04, 2004, 10:25:15 am »
Quote
Thanks...I will look into building that into the TKC 3.0 kernel.  

asshole TKC still alive? hehe...

Anonymous

  • Guest
CONFIG_FS_SYNC in Sharp kernel source
« Reply #14 on: March 04, 2004, 01:28:33 pm »
Quote
asshole TKC still alive? hehe...

Hmmm...comment shows your IQ.  And I did what to offend you?