cvs commit: src/sys/vm uma_core.c

Bosko Milekic bmilekic at FreeBSD.org
Wed Jul 30 11:55:17 PDT 2003


bmilekic    2003/07/30 11:55:15 PDT

  FreeBSD src repository

  Modified files:
    sys/vm               uma_core.c 
  Log:
  Plug a race and a leak in UMA.
  
  1) The race has to do with zone destruction.  From the zone destructor we
     would lock the zone, set the working set size to 0, then unlock the zone,
     drain it, and then free the structure.  Within the window following the
     working-set-size set to 0 and unlocking of the zone and the point where
     in zone_drain we re-acquire the zone lock, the uma timer routine could
     have fired off and changed the working set size to something non-zero,
     thereby potentially preventing us from completely freeing slabs before
     destroying the zone (and thus leaking them).
  
  2) The leak has to do with zone destruction as well.  When destroying a
     zone we would take care to free all the buckets cached in the zone, but
     although we would drain the pcpu cache buckets, we would not free them.
     This resulted in leaking a couple of bucket structures (512 bytes each)
     per cpu on SMP during zone destruction.
  
  While I'm here, also silence GCC warnings by turning uma_slab_alloc()
  from inline to real function.  It's too big to be an inline.
  
  Reviewed by: JeffR
  
  Revision  Changes    Path
  1.69      +29 -13    src/sys/vm/uma_core.c


More information about the cvs-src mailing list