]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
o Move zone limit from keg level up to zone level. This means that now
authorglebius <glebius@FreeBSD.org>
Tue, 15 Jan 2019 00:02:06 +0000 (00:02 +0000)
committerglebius <glebius@FreeBSD.org>
Tue, 15 Jan 2019 00:02:06 +0000 (00:02 +0000)
commitf1a8621cf2e06ef5bedaf9eef7d33c3383321fc2
treee32945886083e02d02d7c65d6a69a5de8ad6b5c4
parente1660f9ead17dab5ae08e4a36e989573123a2f52
o Move zone limit from keg level up to zone level. This means that now
  two zones sharing a keg may have different limits. Now this is going
  to work:

  zone = uma_zcreate();
  uma_zone_set_max(zone, limit);
  zone2 = uma_zsecond_create(zone);
  uma_zone_set_max(zone2, limit2);

  Kegs no longer have uk_maxpages field, but zones have uz_items. When
  set, it may be rounded up to minimum possible CPU bucket cache size.
  For small limits bucket cache can also be reconfigured to be smaller.
  Counter uz_items is updated whenever items transition from keg to a
  bucket cache or directly to a consumer. If zone has uz_maxitems set and
  it is reached, then we are going to sleep.

o Since new limits don't play well with multi-keg zones, remove them. The
  idea of multi-keg zones was introduced exactly 10 years ago, and never
  have had a practical usage. In discussion with Jeff we came to a wild
  agreement that if we ever want to reintroduce the idea of a smart allocator
  that would be able to choose between two (or more) totally different
  backing stores, that choice should be made one level higher than UMA,
  e.g. in malloc(9) or in mget(), or whatever and choice should be controlled
  by the caller.

o Sleeping code is improved to account number of sleepers and wake them one
  by one, to avoid thundering herd problem.

o Flag UMA_ZONE_NOBUCKETCACHE removed, instead uma_zone_set_maxcache()
  KPI added. Having no bucket cache basically means setting maxcache to 0.

o Now with many fields added and many removed (no multi-keg zones!) make
  sure that struct uma_zone is perfectly aligned.

Reviewed by: markj, jeff
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D17773
lib/libmemstat/memstat_uma.c
sys/vm/uma.h
sys/vm/uma_core.c
sys/vm/uma_int.h
sys/vm/vm_page.c