Skip to content

Commit

Permalink
8292995: improve the SA page cache
Browse files Browse the repository at this point in the history
Reviewed-by: kevinw, sspitsyn
  • Loading branch information
plummercj committed Aug 30, 2022
1 parent 1cf245d commit c3380c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,8 @@ public void checkAlignment(long address, long alignment) {
};

if (useCache) {
// FIXME: re-test necessity of cache on Bsd, where data
// fetching is faster
// Cache portion of the remote process's address space.
// Fetching data over the socket connection to dbx is slow.
// Might be faster if we were using a binary protocol to talk to
// dbx, but would have to test. For now, this cache works best
// if it covers the entire heap of the remote process. FIXME: at
// least should make this tunable from the outside, i.e., via
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
// size must be adjusted to be the hardware's page size.
// (FIXME: should pick this up from the debugger.)
initCache(4096, parseCacheNumPagesProperty(4096));
// This is a cache of 64k of 4K pages, or 256 MB.
initCache(4096, parseCacheNumPagesProperty(1024 * 64));
}

isDarwin = getOS().equals("darwin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,8 @@ public void checkAlignment(long address, long alignment) {
};

if (useCache) {
// FIXME: re-test necessity of cache on Linux, where data
// fetching is faster
// Cache portion of the remote process's address space.
// Fetching data over the socket connection to dbx is slow.
// Might be faster if we were using a binary protocol to talk to
// dbx, but would have to test. For now, this cache works best
// if it covers the entire heap of the remote process. FIXME: at
// least should make this tunable from the outside, i.e., via
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
// size must be adjusted to be the hardware's page size.
// (FIXME: should pick this up from the debugger.)
initCache(4096, parseCacheNumPagesProperty(4096));
// This is a cache of 64k of 4K pages, or 256 MB.
initCache(4096, parseCacheNumPagesProperty(1024 * 64));
}

workerThread = new LinuxDebuggerLocalWorkerThread(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,25 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
private RemoteDebugger remoteDebugger;
private RemoteThreadFactory threadFactory;
private boolean unalignedAccessesOkay = false;
private static final int cacheSize = 16 * 1024 * 1024; // 16 MB
private static final int cacheSize = 256 * 1024 * 1024; // 256 MB

public RemoteDebuggerClient(RemoteDebugger remoteDebugger) throws DebuggerException {
super();
try {
this.remoteDebugger = remoteDebugger;
machDesc = remoteDebugger.getMachineDescription();
utils = new DebuggerUtilities(machDesc.getAddressSize(), machDesc.isBigEndian());
int cacheNumPages;
int cachePageSize;
int cachePageSize = 4096;
int cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
String cpu = remoteDebugger.getCPU();
// page size. (FIXME: should pick this up from the remoteDebugger.)
if (cpu.equals("x86")) {
threadFactory = new RemoteX86ThreadFactory(this);
cachePageSize = 4096;
cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
unalignedAccessesOkay = true;
} else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
threadFactory = new RemoteAMD64ThreadFactory(this);
cachePageSize = 4096;
cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
unalignedAccessesOkay = true;
} else if (cpu.equals("ppc64")) {
threadFactory = new RemotePPC64ThreadFactory(this);
cachePageSize = 4096;
cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
unalignedAccessesOkay = true;
} else {
try {
Expand All @@ -81,8 +74,6 @@ public RemoteDebuggerClient(RemoteDebugger remoteDebugger) throws DebuggerExcept
} catch (Exception e) {
throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported");
}
cachePageSize = 4096;
cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
unalignedAccessesOkay = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,8 @@ public void checkAlignment(long address, long alignment) {
}

if (useCache) {
// Cache portion of the remote process's address space.
// Fetching data over the socket connection to dbx is slow.
// Might be faster if we were using a binary protocol to talk to
// dbx, but would have to test. For now, this cache works best
// if it covers the entire heap of the remote process. FIXME: at
// least should make this tunable from the outside, i.e., via
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
// size must be adjusted to be the hardware's page size.
// (FIXME: should pick this up from the debugger.)
initCache(4096, 4096);
initCache(4096, parseCacheNumPagesProperty(1024 * 64));
}
// FIXME: add instantiation of thread factory

}

/** From the Debugger interface via JVMDebugger */
Expand Down

1 comment on commit c3380c0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.