1. 23 Nov, 2022 9 commits
    • Alex Xu's avatar
      Add tor_mmap_random and use in geoip · 18ef89d2
      Alex Xu authored
      18ef89d2
    • Alex Xu's avatar
      Add tor_mmap_prefetch and use in geoip · 69521fb5
      Alex Xu authored
      69521fb5
    • Alex Xu's avatar
      mmap geoip databases, restrict countries to 2-alpha + ?? · c25827df
      Alex Xu authored
      Using mmap saves about 10 MB of anonymous memory. Using a binary format also
      cuts the uncompressed disk space of GeoIP databases in half (~5 MB) too;
      compressed size shrinks by 5-15% (since GeoIP databases are highly
      compressible, there is more benefit at lower compression levels). A B-tree
      would be more efficient but are too complicated to implement in C and aren't
      justified by the infrequent geoip lookup.
      
      Officially restricting countries to 2-alpha allows arrays to be statically
      instead of dynamically allocated, saving more RAM and reducing code complexity,
      in particular by removing routerset_refresh_countries and many smartlists.
      Additionally, IPFire has removed A1 country code, so we don't need to store or
      handle it anymore. Also, stop storing ?? country in GeoIP files, since Tor
      smushes "no data for this IP" and "no country for this IP" together anyways.
      
      A previous version of this change emitted binary GeoIP files directly from
      geoip-db-tool. While simpler, that approach does not work well with git; the
      default diff is useless, making it hard to see what is changing in the GeoIP
      database; additionally, git can potentially compress text deltas more
      efficiently than binary deltas. Awk was selected for convert_geoip because it
      is already a requirement for configure, and unlike C, does not interfere with
      cross-compilation.
      c25827df
    • Alex Xu's avatar
      geoip_stats: make some functions STATIC · 0a8f243d
      Alex Xu authored
      0a8f243d
    • Alex Xu's avatar
      Add tt_str_null and tt_want_str_null · 6f518f89
      Alex Xu authored
      Used for geoip-mmap tests, but could be useful elsewhere.
      6f518f89
    • Alex Xu's avatar
      Remove country argument from routerset_contains_router* · cc5366b6
      Alex Xu authored
      It is unnecessary for the public interface, only routerset_contains_node passes
      a legitimate country. Fixes TestingDirAuth* incorrectly ignoring country code
      options.
      cc5366b6
    • David Goulet's avatar
      Merge branch 'maint-0.4.7' · 04d87536
      David Goulet authored
      04d87536
    • David Goulet's avatar
      relay: Use the configured number of threads for worker work calculation · fbc9e92f
      David Goulet authored
      
      
      We cap our number of CPU worker threads to at least 2 even if we have a
      single core. But also, before we used to always add one extra thread
      regardless of the number of core.
      
      This meant that we were off when re-using the get_num_cpus() function
      when calculating our onionskin work overhead because we were always off
      by one.
      
      This commit makes it that we always use the number of thread our actual
      thread pool was configured with.
      
      Fixes #40719
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      fbc9e92f
    • David Goulet's avatar
      8713d976
  2. 10 Nov, 2022 11 commits
  3. 09 Nov, 2022 17 commits
  4. 08 Nov, 2022 3 commits