Skip to content

Commit

Permalink
[Wisp] retire Wisp1
Browse files Browse the repository at this point in the history
Summary:
Delete all Wisp1 related code based on the fact that Wisp2 is more
powerful and stable than Wisp1.

Revert listed file changes and keep consistent with openjdk:

- AbstractSelectableChannel
- AbstractSelector
- ScheduledThreadPoolExecutor
- ThreadPoolExecutor
- EPollSelectorProvider
Remove features:

- SleepSelector
- WispSelector
- ThreadAsWisp with wisp.properties
Remove tests:

Wisp2 do not have engine selector anymore:
 - ClearEventTest
 - SelectorLazyCreateTest
 - WispEngineCriticalSectionTest
 - WispSelectorUnixSocketLeakTest
 - EngineSelectorTest
 - SelectorRebuildTest
 - LockUninterruptiblyTest
Outdated features:
 - WorkerContainerTest
 - EnableSleepSelectorTest
 - SelectorTest(WispSelector)
 - SleepSelectorTest
 - SubmittedTaskLimitTest
 - ThreadAsWispTest
Wisp1 unique test:
 - YieldTest
 - WaitNotifyTest
Duplicate:
 - ShutdownAndCreateNewTask
 - ShutdownTest
Non-trivial changes:

- Remove eventloop mechanism (should use juc instead)
- WispTask.engine become volatile
- WispTask.staus is only used to test alive

Test Plan: run all jtreg

Reviewers: sanhong.lsh, yunyao.zxl, shiyue.xw, lei.yul

Issue: https://aone.alibaba-inc.com/task/24108494

CR: https://code.aone.alibaba-inc.com/xcode/jdk11/codereview/2241339
  • Loading branch information
joeylee.lz authored and Sere-Fu committed Aug 19, 2021
1 parent cd56863 commit 76d5257
Show file tree
Hide file tree
Showing 91 changed files with 823 additions and 3,264 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/share/prims/jvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,8 @@ JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
{
if (UseWisp2) {
PUTPROP(props, "com.alibaba.wisp.transparentWispSwitch", "true");
PUTPROP(props, "com.alibaba.wisp.enableThreadAsWisp", "true");
PUTPROP(props, "com.alibaba.wisp.version", "2");
if (Arguments::get_property("com.alibaba.wisp.allThreadAsWisp") == NULL) {
PUTPROP(props, "com.alibaba.wisp.enableThreadAsWisp", "true");
PUTPROP(props, "com.alibaba.wisp.allThreadAsWisp", "true");
}
}
Expand Down
13 changes: 0 additions & 13 deletions src/java.base/linux/classes/sun/nio/ch/EPollSelectorProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

package sun.nio.ch;

import com.alibaba.wisp.engine.WispEngine;
import com.alibaba.wisp.util.io.SleepSelector;
import jdk.internal.misc.SharedSecrets;

import java.io.IOException;
import java.nio.channels.*;
import java.nio.channels.spi.*;
Expand All @@ -37,15 +33,6 @@ public class EPollSelectorProvider
extends SelectorProviderImpl
{
public AbstractSelector openSelector() throws IOException {
AbstractSelector sel = new EPollSelectorImpl(this);
if (WispEngine.enableThreadAsWisp() &&
SharedSecrets.getWispEngineAccess().ifSpinSelector()) {
sel = new SleepSelector(sel);
}
return sel;
}

public AbstractSelector openSelector0() throws IOException {
return new EPollSelectorImpl(this);
}

Expand Down
Loading

0 comments on commit 76d5257

Please sign in to comment.