Tweak QSPI FIFO_THRESH - #2679
Merged
Merged
Conversation
Member
|
Sorry, just to clarify, are the second two runs in the PR description both with Edit: ah, after looking at the PR, i think i know the value lol: |
hawkw
approved these changes
Sep 10, 2026
|
|
||
| const FIFO_SIZE: usize = 32; | ||
| const FIFO_THRESH: usize = 16; | ||
| const FIFO_THRESH: usize = 1; |
Member
There was a problem hiding this comment.
a comment describing why we set this to 1 might be nice here, but i suppose it's in the commit history.
Collaborator
Author
There was a problem hiding this comment.
Added a brief comment
The QPSI hardware has an internal FIFO with a configurable threshold to generate an interrupt. We currently have it set to 16 (50%). This results in many context switches because we wait for an interrupt when it drops below that threshold. Turning it down improves performance at the cost of blocking for longer periods of time. Baseline laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ] real 0m7.480s user 0m3.315s sys 0m0.562s FIFO_THRESH 8 laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ] real 0m6.504s user 0m3.235s sys 0m0.498s FIFO_THRESH 4 laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ] real 0m6.480s user 0m3.242s sys 0m0.495s laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ] real 0m6.196s user 0m3.210s sys 0m0.485s
labbott
force-pushed
the
qspi_fifo_tweak
branch
from
September 11, 2026 14:58
465b42f to
3b22117
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The QPSI hardware has an internal FIFO with a configurable threshold to generate an interrupt. We currently have it set to 16 (50%). This results in many context switches because we wait for an interrupt when it drops below that threshold. Turning it down improves performance at the cost of blocking for longer periods of time.
Baseline
laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ]
real 0m7.480s
user 0m3.315s
sys 0m0.562s
FIFO_THRESH 8
laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ]
real 0m6.504s
user 0m3.235s
sys 0m0.498s
FIFO_THRESH 4
laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ]
real 0m6.480s
user 0m3.242s
sys 0m0.495s
laura@cadbury ~ $ time pfexec humility -t c71 -a ~/build-gimlet-c-lab-image-default.zip hiffy -c HostFlash.hash -aaddress=0,len=33554432 --timeout 1000000 humility: WARNING: archive on command-line overriding archive in environment file humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3 HostFlash.hash() => [ 0x9c, 0x41, 0xaf, 0x46, 0x10, 0xb8, 0x55, 0x1f, 0x28, 0x5a, 0xf6, 0xbe, 0xd7, 0x84, 0x2c, 0xab, 0xc6, 0xa4, 0x2a, 0xf4, 0x90, 0x93, 0x88, 0x8a, 0xc9, 0x61, 0x39, 0xf3, 0xde, 0xee, 0x86, 0x1d ]
real 0m6.196s
user 0m3.210s
sys 0m0.485s