Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use preadv/pwritev to efficiently handle multiple mappings at once. #40

Merged
merged 3 commits into from Sep 3, 2021

Conversation

luqmana
Copy link
Contributor

@luqmana luqmana commented Sep 2, 2021

Illumos, like linux, has vectored versions of pread/pwrite which we can use here instead of calling pread/pwrite in a loop. Using preadv/pwritev saves us a couple of roundtrips.

In fact, with #39 we can see the improvement in latency just simply booting/shutting down a guest off an file-backed nvme storage:

Before:
  write (us)                                            
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@                                  25       
              32 |@@@@@@                                   21       
              64 |@@@@@@@@@@@@@@@@@@@@@@                   73       
             128 |@@@@                                     13       
             256 |@                                        3        
             512 |                                         0        

  read (us)                                            
           value  ------------- Distribution ------------- count    
               4 |                                         0        
               8 |@@@@@                                    197      
              16 |@@@@@@@@@@@                              405      
              32 |@@@@@@@@@@@@@@@@@@@                      713      
              64 |@@                                       96       
             128 |@@                                       77       
             256 |@                                        39       
             512 |                                         11       
            1024 |                                         1        
            2048 |                                         0        
            4096 |                                         2        
            8192 |                                         0
After:
  write (us)                                            
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@               89       
              32 |@@@@@@                                   20       
              64 |@@@@@@@                                  24       
             128 |@                                        3        
             256 |                                         0        

  read (us)                                             
           value  ------------- Distribution ------------- count    
               4 |                                         0        
               8 |@@@@@@@@@@@@@@@                          570      
              16 |@@@@@@@@@@@@@@@@@                        659      
              32 |@@@@@                                    180      
              64 |@@@                                      105      
             128 |                                         19       
             256 |                                         6        
             512 |                                         1        
            1024 |                                         1        
            2048 |                                         0

propolis/Cargo.toml Outdated Show resolved Hide resolved
@luqmana luqmana merged commit f8fd93c into master Sep 3, 2021
@luqmana luqmana deleted the multi-mappings branch September 3, 2021 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants