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

Hiccup/Lag every X seconds #179

Closed
Tony322 opened this issue May 2, 2023 · 3 comments
Closed

Hiccup/Lag every X seconds #179

Tony322 opened this issue May 2, 2023 · 3 comments

Comments

@Tony322
Copy link

Tony322 commented May 2, 2023

Hello!
The software is great, works really good. But I do have an annoying issue.
I use a Lamda Project Squirrel, latest firmware of PCI LEECH FPGA (4.10)
I have usermode application running on WIN10, with the target being another WIN10 machine. I can read live memory from an application fine. BUT, I do have an issue were every X-seconds (I timed it to every 12th or 13th second) it "lags out" for a bit, and then continuing. I do 90% scatter reads without issue. This lag that happens every 12-13 seconds is enough to make me suffer in a certain application due to the read memory not being read for a while.
I figured out the other day that setting the -norefresh flag, makes this issue go away. It NEVER hiccups. But instead, another issue appeared. This is probably user error (me), but maybe you have an idea on what is going on.

Since I enabled this -norefresh flag (I read from a single and same process), some entities read from memory doesnt show up anymore. Its like its not getting read anymore. I feel like there is some other type of caching going on.

Lets say there are 10 entities in a table im reading. Since this -norefresh flag, there might be an update in the target program, that makes it 15 entities. And now my user mode application isnt reading them. It never "hiccups" anymore, but now I never know of these 5 new entities due some cache. This is JUST A HUNCH. If I remove the -norefresh flag, the hiccups are back, but the issue with missing entities goes away.

Do you have any idea on why this is happening, and if there are any workarounds? Maybe not having the -norefresh flag, but increasing the cache flushing timer not to be so often? Or is there any other way to have the "hiccups" gone by disabling cache, but yet always read fresh data from memory?

I have the no cache flag set, so I never read from cache. So I assume I really never need a cache, nor cache flushing. But I dont know much about the internals (firmware) on PCILEECH FPGA firmware to say for sure.

Do you have any suggestions or ideas, to get the best of both worlds? It's critical that the data is read in near real-time, without any cached memory.

I did try other algorithms, but netiher did any difference with the "hiccups" when the -norefresh param wasnt present.

I know its very hard for you to debug or come up with a solution, but It's worth a shot.

Thanks

@Tony322
Copy link
Author

Tony322 commented May 2, 2023

Worth noting that my user mode PC is connected via USB 2, maybe that is some kind of bottleneck causing the issue? I wouldn't think so since the cache is flushed on the hardware itself?

@ufrisk
Copy link
Owner

ufrisk commented May 2, 2023

The latest firmware is v4.11 and it fixes a few issues, but this is not your issue.

Your issue is that the application allocates memory, updates the page tables (used to translate virtual to physical memory addresses) and other memory housekeeping structures.

But since you disabled refreshing the old page tables, vads etc are kept being read from the cache.

I'm sorry about this, but you just can't have it both ways.

If you're using the API, which I assume you are, you can manually issue refreshs for certain parts with VMMDLL_OPT_REFRESH_* options and the ``VMMDLL_ConfigSet()` function.

Also, if using USB2 it will slow down PCILeech horribly much. Latency will be super high and peak transfer will be around 35MB/s instead of close to 200MB/s. Connecting with USB3 will vastly improve your timings, and the "hiccups" will be about 90% shorter time (when running with refreshes enabled) - i.e. 2-300ms instead of over a second, but they will still be there. Unless you go with the manual approach described above.

@Tony322
Copy link
Author

Tony322 commented May 2, 2023

Thank you very much! I'd use USB 3 if I could, but my crappy laptop doesn't have it. I might try another machine. That would probably make it good enough then. Thank you very much for the quick response. I will try the other method meanwhile. Thanks!

@Tony322 Tony322 closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants