1. 20 Nov, 2015 1 commit
  2. 08 Jun, 2015 1 commit
    • Mike Hibler's avatar
      The latest installment of Mike's Fine Mountd Hackary (MFMH). · 89fe803f
      Mike Hibler authored
      Previously on MFMH:
      
       * Our hero added incremental kernel export updates to mountd so
         that a single update would finish within his lifetime,
      
       * Hero subsequently discovers that an incremental update still
         takes 8 seconds on the Emulab Mothership,
      
       * Hero discovers that remaining time is spent NOT in kernel operations
         or even complex calculations of orbital mechanics, but rather in simple
         parsing of text from a 1300 line file.
      
       * Hero gives up in despair.
      
      This week on MFMH:
      
       * Our revitalized hero applies gprof-fu to the problem and
         discovers that 7.9 seconds of the 8 second /etc/exports parse time
         is spent stat()ing /etc/nsswitch.conf 2,392,057 times.
      
       * "WtF!", exclaims our hero, "that is 27.3 stats for every text
         character in the file!"
      
       * Problem is traced to the fact that we do "-maproot=root" for each
         of the 1344 exports and every parse of that option looks up root
         in the password file and determines which of the 1784 groups in
         /etc/group root belongs to. Each of those 1344 * 1784 "get group
         entry" calls, stats /etc/nsswitch.conf to see if the file has
         changed.
      
       * "Bite me!", sez Mike, and he adds a CACHE_ROOT_CREDS option to
         mountd so that the lookup is only done on the very first instance
         of -maproot=root.
      
      A single incremental update of exports now takes 0.75 seconds.
      89fe803f
  3. 24 Mar, 2015 1 commit
    • Mike Hibler's avatar
      Hopefully eliminate race in exports_setup when waiting for mountd to finish. · 031b174c
      Mike Hibler authored
      Changed mountd to write the current timestamp into /var/run/mountd.ts
      whenever it has finished processing all exports files. So someone who
      HUPs/USR1s mountd can check and see when the timestamp changes.
      
      We use this in exports_setup.proxy to ensure we do not return before
      mountd has completed parsing and effecting changes. Since I am too lazy
      to check the before and after values of the timestamp, I just remove that
      file just before signalling, and then wait for it to reappear to signify
      that mountd is done.
      031b174c
  4. 13 Jan, 2015 1 commit