Andy Wingo: v8’s mark-sweep nursery

Today, a followup to yesterday’s note with some more details on V8’s new
young-generation implementation, minor mark-sweep or MinorMS.

A
caveat again: these observations are just from reading the code; I
haven’t run these past the MinorMS authors yet, so any of these details
might be misunderstandings.

The MinorMS nursery consists of pages, each of which is 256 kB, unless
huge-page mode is on, in which case they are 2 MB. The total default
size of the nursery is 72 MB by default, or 144 MB if pointer
compression
is off.

There can be multiple threads allocating into the nursery, but let’s
focus on the main
allocator
,
which is used on the main thread. Nursery allocation is bump-pointer,
whether in a MinorMS page or scavenger semi-space. Bump-pointer regions
are called linear allocation buffers, and often abbreviated as Lab
in the source, though the class is
LinearAllocationArea.

If the current bump-pointer region is too small for the current
allocation, the nursery implementation finds another one, or triggers a
collection. For the MinorMS nursery, each page collects the set of
allocatable spans in a free list; if the free-list is non-empty, it pops
off one entry as the current and tries again.

Otherwise, MinorMS needs another page, and specifically a swept page:
a page which has been visited since the last GC, and whose spans of
unused memory have been collected into a free-list. There is a
concurrent sweeping task which should usually run ahead of the mutator,
but if there is no swept page available, the allocator might need to
sweep some. This logic is in
MainAllocator::RefillLabMain.

Finally, if all pages are swept and there’s no Lab big enough for the
current allocation, we trigger collection from the roots. The initial
roots are the remembered set: pointers from old objects to new
objects. Most of the trace happens concurrently with the mutator; when
the nursery utilisation rises over 90%, V8 will kick off concurrent
marking tasks.

Then once the mutator actually runs out of space, it pauses, drains any pending marking work, marks
conservative roots, then drains again. I am not sure whether MinorMS
with conservative stack scanning visits the whole C/C++ stacks or
whether it manages to install some barriers (i.e. “don’t scan deeper
than 5 frames because we collected then, and so all older frames are
older”); dunno. All of this logic is in
MinorMarkSweepCollector::MarkLiveObjects.

Marking traces the object graph, setting object mark bits. It does not
trace pages. However, the MinorMS space promotes in units of pages. So
how to decide what pages to promote? The answer is that sweeping partitions the MinorMS pages into empty,
recycled, aging, and promoted pages.

Empty pages have no surviving
objects, and are very useful because they can be given back to the
operating system if needed or shuffled around elsewhere in the system. If they are re-used for allocation, they do not need to be swept.

Recycled pages have some survivors, but not many; MinorMS keeps the page
around for allocation in the next cycle, because it has enough empty
space. By default, a page is recyclable if it has 50% or more free
space after a minor collection, or 30% after a major collection.
MinorMS also promotes a page eagerly if in the last cycle, we only
managed to allocate into 30% or less of its empty space, probably due to
fragmentation. These pages need to be swept before re-use.

Finally, MinorMS doesn’t let pages be recycled indefinitely:
after 4 minor cycles, a page goes into the aging pool, in which it is
kept unavailable for allocation for one cycle, but is not yet promoted.
This allows any new allocations on that page in the previous cycle age
out and probably die, preventing premature tenuring.

And that’s it. Next time, a note on a way in which generational
collectors can run out of memory. Have a nice weekend, hackfolk!

Personal FreeBSD PKGBASE update server

FreeBSD UNIX system can be updated in many ways. You can use freebsd-update(8) command to fetch and install the official binary patches. You can download the FreeBSD sources and compile your new version. You can download and install base.txz and kernel.txz sets in a new ZFS Boot Environment along with copying over your config files there – Other FreeBSD Version in ZFS Boot Environment – as documented here. While for most users these three options will be more then enough – there is a small group or people that need something else. Companies. People that like to use custom FreeBSD version or enterprise corporate world that needs to fulfill many compliance regulations. For their multiple reasons – including but not limited to – security – they want to have their own trusted FreeBSD update infra under their control. ↫ vermaden It’s from vermaden, so if you’re a FreeBSD user, you know you’re getting good information. Their website is a treasure trove of incredibly detailed information about pretty much everything related to installing, running, and living with FreeBSD.

Lineage 2: Revolution Dünyada En Fazla Oynanan MMORPG Oyunu HanKanal’da !

Oyunu indirmek için: http://smarturl.it/4scv8h
Bugün Birlikte Lineage 2: Revolution Oyununu Oynuyoruz Handaşlar
Yılın en güzel grafikli Mobil MMORPG oyununu sizler için oynadım. Oyunda beni ekleyebilir ve bana selam gönderebilirsiniz; Oyun içi adım HanKraL ! Klanımızı kurduğumuzda tozu dumana katacağız, vaziyet alın!
Ayrıcalıklardan yararlanmak için bu kanala katılın:
https://www.youtube.com/channel/UCpcHFJwDFlrnbCw3yD-4Wzg/join

CANIM HANDAŞ AİLEM BİZLERİ DESTEKLEDİĞİNİZ HER GÜN GELEN VİDEOLARIMIZI İZLEYİP LİKE ve YORUM ATTIĞINI İÇİN HEPİNİZE SONSUZ TEŞEKKÜR EDİYORUM.
SİZLER SAYESİNDE BURADAYIZ VE SİZLER SAYESİNDE HEDEFİMİZE ULAŞACAĞIZ 10 MİLYON HANDAŞ AİLESİNE ULAŞMAK İÇİN ELİMİZDEN GELENİ YAPACAĞIZ.
SİZLERDE HANDAŞ AİLEMİZE KATILMAYI VE BİZLERE DESTEK VERMEYİ LÜTFEN UNUTMAYIN
—————————————————————————————————————————————-
– SOSYAL MEDYA HESAPLARIM –
-Discord : https://discord.gg/sttQ7WUJ
– Katılmak için: https://bit.ly/3w2a5TV
-İnstagram : https://bit.ly/37ftx50
-Tiktok : https://bit.ly/3CEky95
-2.Kanal : https://bit.ly/3hZrggC
– HAN KANAL DİĞER VİDEO SERİLERİM –
– PoppyPlayTime: https://bit.ly/3JdC9r1
– Roblox: https://bit.ly/3KC7kfZ
—————————————————————————————————————————————-

LostCarPark Drupal Blog: Drupal Advent Calendar day 8 – Disclosure Menu

LostCarPark Drupal Blog: Drupal Advent Calendar day 8 - Disclosure Menu
Drupal Advent Calendar day 8 – Disclosure Menu

james

Fri, 12/08/2023 – 07:00

LostCarPark Drupal Blog: Drupal Advent Calendar day 8 - Disclosure Menu

It’s time to open door number 8 of the Drupal Advent Calendar, and today we’re joined by Chris Wells (chrisfromredfin) to tell us about the Disclosure Menu module.

The importance of a seamless and inclusive website navigation cannot be overstated. Creating digital environments where everyone feels welcomed and capable is a central ethos in the Drupal community. And that’s why we were surprised that after spending so much time with menus over the years, there still wasn’t a truly accessible menu module available for Drupal.

Animation showing navigation of disclosure menu by keyboard
The disclosure menu in action (with minimum theming)

Our narrative begins with a standard website component: a hoverable menu…

Python 3.12.1 is now available

 

Python 3.12.1 is now available.

https://www.python.org/downloads/release/python-3121/

 

This is the first maintenance release of Python 3.12

Python 3.12 is the newest major release of the Python programming language, and it contains many new features and optimizations. 3.12.1 is the latest maintenance release, containing more than 400 bugfixes, build improvements and documentation changes since 3.12.0.

 

Major new features of the 3.12 series, compared to 3.11

 

New features

 

Type annotations

 

Deprecations

  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation
    for performance enhancements. (This should not affect most users as it
    is an internal detail, but it may cause problems for Cython-generated
    code.)

For more details on the changes to Python 3.12, see What’s new in Python 3.12.

 

More resources

 

Enjoy the new releases

Thanks to all of the many volunteers who help make Python Development
and these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the
Python Software Foundation.

Your release team,
Thomas Wouters
Ned Deily
Steve Dower
Łukasz Langa

Linux 6.8 To Drop The SLAB Allocator, SLUB Optimizations Coming Too

Following the SLOB allocator removal earlier this year, the Linux 6.8 kernel in the new year is now positioned to remove the SLAB allocator. Additionally, the lone good-for-everything SLUB allocator is set to receive further optimizations. Read more at phoronix

The post Linux 6.8 To Drop The SLAB Allocator, SLUB Optimizations Coming Too appeared first on Linux.com.