Can small writes generate a lot of faults?

Daniel Hilst Selli danielhilst at gmail.com
Tue Apr 23 11:19:17 EDT 2013


Em 22/04/2013 10:20, Greg Freemyer escreveu:
>
> Mulyadi Santosa <mulyadi.santosa at gmail.com> wrote:
>
>> Hi :)
>>
>> On Sat, Apr 20, 2013 at 4:42 AM, Daniel Hilst Selli
>> <danielhilst at gmail.com> wrote:
>>> AFAIK, major page faults are generated when data that is not yet
>> present
>>> on RAM is loaded from disk, but in this case data is being write do
>>> disk, I can't
>>> see how writes can generate faults, but still, it seems that is
>>> happening, ... !?
>>>
>>> Is that possible?
>> I never pay close attention on these kind of stuffs, but IMHO there is
>> a chance that this "write" is actually "update"
> I missed the original email, but the kernel filesystem logic typically works with 4 KB pages.  If a write lands on page boundaries then the file system will do pure writes, but if it doesn't then the filesystem will typically read the original page from disk then update it and write it back out.
>
> Small writes of 4 kb as an example that are not page aligned will cause 2 pages to read, both to be updated and both to be written.
>
> Adding raid 5/6 below the file system layer greatly accelerates the problem.  Now you need to ensure your writes are the full size of a stripe and stripe aligned to avoid the read/update/write sequence.  Some filesystems build knowledge of stripes into them to try and optimize this process, some don't.
>
> Greg
>
>
>
Thanks for your answer Greg, I have never been presented to this 
"read/update/write" logic, now makes a lot of sens, Thanks!



More information about the Kernelnewbies mailing list