Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper implementation of the treadmill algorithm #517

Open
caizixian opened this issue Jan 11, 2022 · 1 comment
Open

Proper implementation of the treadmill algorithm #517

caizixian opened this issue Jan 11, 2022 · 1 comment
Labels
A-allocator Area: Allocator A-utils Area: Utilities C-cleanup Category: Cleanup C-enhancement Category: Enhancement P-normal Priority: Normal.

Comments

@caizixian
Copy link
Member

The current TreadMill is a misnomer, as it uses HashSets rather than linked lists.
It was used during our prototyping phase as a "drop-in" replacement of a real treadmill.

So,

  1. We should implement the actual treadmill algorithm with linked lists
  2. Evaluate the best approach as to scalability of large object allocation. @wenyuzhao has found that our page allocator doesn't scale well with the increasing parallelism on modern CPUs. For certain workload, the scalability of large object allocation might matter, and a simple lock protecting the whole treadmill might not be the best solution

cc @steveblackburn

@caizixian caizixian added A-allocator Area: Allocator A-utils Area: Utilities C-cleanup Category: Cleanup C-enhancement Category: Enhancement labels Jan 11, 2022
@qinsoon
Copy link
Member

qinsoon commented Jan 12, 2022

  1. We should implement the actual treadmill algorithm with linked lists

What do you mean by 'the actual treadmill algorithm'? Are you referring the treadmill in Java MMTk/JikesRVM, or the Baker's treadmill in his paper?

To my understanding, treadmill in MMTk core approximately equals treadmill in JikesRVM, and they both are different from the Baker's treadmill. They both use multiple lists/sets to mimic a 'logical' treadmill rather than using an actual cyclic doubly linked list (Baker's). They both allow objects of different sizes in the same treadmill, and allocation is done by actually allocating memory rather than reusing free nodes in the treadmill (Baker's). The differences between MMTk core and JikesRVM are: 1. JikesRVM uses doubly linked list, and mmtk-core uses hashset, and 2. JikesRVM stores links along with payload, and mmtk-core only puts object references in the set (payload is separated from the metadata).

  1. Evaluate the best approach as to scalability of large object allocation. @wenyuzhao has found that our page allocator doesn't scale well with the increasing parallelism on modern CPUs. For certain workload, the scalability of large object allocation might matter, and a simple lock protecting the whole treadmill might not be the best solution

The page allocator is in the page resource implementation, rather than the treadmill. If we have scalability issue with page allocator, fixing treadmill won't directly help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocator Area: Allocator A-utils Area: Utilities C-cleanup Category: Cleanup C-enhancement Category: Enhancement P-normal Priority: Normal.
Projects
None yet
Development

No branches or pull requests

3 participants