OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:09 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: List of buffers instead of joing buffers + delayed flush
PostPosted: Mon Feb 24, 2020 12:49 pm 
Offline

Joined: Wed Nov 07, 2018 10:15 am
Posts: 23
I wonder if there exist OS using this technique to write to files or devices.
Instead of join buffers (allocating/moving) memory or switch context on each write, just providing list or array of pointer to buffers to write. Each thread will have one's structure. If we use array, then we have limited size.
Additionally, there must be call to flush this data and additionally to mark data as ready. If app flush data, we send data to system buffer/file or device. But data won't be copy to kernel automatically until data is market to be flushed. Flush operation will be made if application request or on context switch. On context switch kernel will only copy data marked as ready.
The idea was partially inspired on OpenGL/Vulcan.

Does any OS using this technique? What are benefits and disadvantages? How much slower/faster is this technique than others?


Top
 Profile  
 
 Post subject: Re: List of buffers instead of joing buffers + delayed flush
PostPosted: Mon Feb 24, 2020 3:11 pm 
Offline
Member
Member

Joined: Fri Oct 04, 2019 10:10 am
Posts: 48
You just described scatter/gather IO, https://en.wikipedia.org/wiki/Vectored_I/O for the obligatory pedia link.

The downside is that for hardware that doesn't support it directly, the kernel still has to memcpy things around, and for hardware that can, there's more buffer mapping involved.

The upside can be easier shuffling around on the application side, and sometimes the ability to reuse chunks that get shared across multiple IO operations, depending on the alignment and size restrictions. A particularly granular one could possibly reuse a lot of boilerplate packet header data, especially if there's hardware support for adjusting checksums and/or sequence values.


Top
 Profile  
 
 Post subject: Re: List of buffers instead of joing buffers + delayed flush
PostPosted: Tue Feb 25, 2020 10:09 am 
Offline

Joined: Wed Nov 07, 2018 10:15 am
Posts: 23
Ok.
I read about this mechanism in past on Unix programming for advanced users. Author is Marc J.Rochind. I just forgot about it. Of course - maybe that (mistake) was done, because is not a book about OS programming, but programming under Unix. After reading vectorized IO, I remind myself about this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group