Re: fadvise syscall?

Martin K. Petersen
2002-03-19T23:39:05Z

>>>>> "Eric" == Eric W Biederman <ebiederm@xmission.com> writes:

>> In the end, cloning the kiobuf from the above and adjusting
>> offset/length in the children turned out to be the best approach.

Eric> Unless I am mistaken this interacts very badly with the writing
Eric> data out to disk to free up memory, because you must allocate
Eric> memory to split the bio. Which is the last place you want to
Eric> allocate memory if you can avoid it.

Well. We have several places in the I/O path already where we need to
allocate memory in order to fulfill an I/O.

Think RAID1 where you need to turn one request from the filesystem
into several - one for each mirror. Or RAID5 where a write may cause
several reads/writes so you can mask and write the checksum out.

Also, with journaling filesystems you may very well be in a situation
where pushing a file to disk involves writing transactions to the log
before you can actually free up buffers.

In this case the clones come from the bio slab cache and are thus no
different from any other I/Os. Furthermore, the clones share the bulk
of their data with the parent, so the overhead isn't that big.

--
Martin K. Petersen, Principal Linux Consultant, Linuxcare, Inc.
mkp@linuxcare.com, http://www.linuxcare.com/
SGI XFS for Linux Developer, http://oss.sgi.com/projects/xfs/