LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-22-2012, 06:41 AM   #1
zishan.shaikh
LQ Newbie
 
Registered: Dec 2011
Location: Pune, India
Distribution: Fedora 17
Posts: 6

Rep: Reputation: Disabled
Separation into 4K buffers to be written to the disk


Hi,

I was recently working on a project in my college where i had modified the write system call. What i observed was that the data buffer that was to be written to the disk, is of size 32K at the max. Kernel version: 2.6.35

The block size on the file system (EXT3) which i was working on was 4K. When i traced the call, i could not find a point where the buffer is actually split into 4K chunks. Is it done when the 4k pages (that would be written) are flushed to the disk? Kindly help me with this.

P.S.
Would be great if anyone could tell me about the secret behind the 32K sized buffer. I mean why 32K?

Thanks in advance,
Zishan Shaikh.
 
Old 10-22-2012, 08:58 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,668
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
This magic is in the "buffer pool" and for further on that I direct you to the source-code.

32K is a fairly typical block-size for most things, and a common filesystem magic-number. Ultimately, though, it doesn't matter, and your apps should not be concerned with it. They should simply read and write data in whatever sizes make sense to them.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data written to unformatted disk peterlowrie Linux - General 1 01-14-2011 06:32 PM
How can I mount a removable hard disk and make it can be written? spychan Linux - Newbie 2 04-12-2009 07:36 PM
sync and Disk Buffers LinuxGeek Linux - General 3 01-12-2005 10:18 AM
Possible to make filesystem on disk with data written to it? redhatman Linux - Newbie 3 08-28-2004 10:49 AM
Raster separation in E0.16 bznutz Linux - Software 0 05-29-2003 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:58 PM.

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