[tor-bugs] #22704 [Core Tor/Tor]: Use mmaps to handle journalled microdesc/routerdesc files.

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jun 23 13:12:19 UTC 2017


#22704: Use mmaps to handle journalled microdesc/routerdesc files.
-------------------------------------------------+-------------------------
 Reporter:  nickm                                |          Owner:
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.2.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  sponsor8-maybe mmap review-group-18  |  Actual Points:
Parent ID:  #7176                                |         Points:  3
 Reviewer:  nickm                                |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by nickm):

 * status:  needs_review => new


Comment:

 Notes for revisions:
   * This patch kills off the "write to X.tmp, then rename to X" logic
 globally.  That's not okay to do.  If it turns out to be necessary on low-
 disk systems, then we should do it on those systems only, and we should do
 it for the cached-* files only.
   * The mmap-logic is unix-only.  We need to support Windows too.
   * I'm missing something, but I don't understand how anonymous memory
 maps actually help here.  Is it a memory fragmentation issue or something?
 An anonymous mmap is RAM-backed and swappable, right?
   * load_string_into_mmap should have a name like tor_mmap_append(); it
 should work on file mmaps too (maybe it does?), and it should do at most
 one increment and copy the data all at once.
   * likewise for load_file_into_mmap -- and why would you even do that
 when you can just mmap the file?
   * There  should be a wrapper function that does a nul-terminated memdup
 for a single microdesc/descriptor.
   * It may be a lower priority to do this for routerdescs and extrainfos:
 clients don't use those, after all.

 I think we can reuse some of the code from the original patch, but we
 should really write a completely new branch here if we decide to do this
 one.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22704#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list