8292995: improve the SA page cache

Reviewed-by: kevinw, sspitsyn
This commit is contained in:
Chris Plummer 2022-08-30 23:13:49 +00:00
parent 1cf245d77c
commit c3380c03b1
4 changed files with 8 additions and 48 deletions

View File

@ -204,18 +204,8 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
};
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");

View File

@ -223,18 +223,8 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
};
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);

View File

@ -44,7 +44,7 @@ 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();
@ -52,24 +52,17 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
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 {
@ -81,8 +74,6 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
} catch (Exception e) {
throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported");
}
cachePageSize = 4096;
cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
unalignedAccessesOkay = false;
}

View File

@ -120,19 +120,8 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
}
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 */