Repository navigation
kpb: protect data staged for draining + minor changes - #2688
Merged
Merged
Conversation
mrajwa
requested review from
dbaluta,
jajanusz,
lbetlej,
lgirdwood,
mmaka1,
plbossart and
tlauda
as code owners
April 1, 2020 16:31
This was referenced Apr 1, 2020
lgirdwood
reviewed
Apr 2, 2020
Member
There was a problem hiding this comment.
Can you explain why in the commit message. I assume it's putting items closer together that are used together for faster access / better cache perf ?
Contributor
Author
There was a problem hiding this comment.
Yes, that's it. The commit message has been updated.
This patch changes the name of the "hb" struct to more meaningfull "history_buffer". Therefore code is more readable. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes the name of "dd" structure to more meaningful "draining_data". Therefore code is more readable. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds new struct called "history_data" which contains all variables related to history buffer namely, its size, amount of free and available data as well as address of current write buffer (history buffer is a collection of smaller buffers) Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This additional variable says how much data can be written to history buffer and won't cause overwrite of data staged for draining. It is important to realize the history buffer is circular and its data gets overwrite all the time. So *free* in this case doesn't mean "amount of bytes before buffer is full". History buffer is *full* 99% of the time. However before the draining starts we "freeze" history buffer data so new samples can be written only if: HISTORY_BUFFER_SIZE - HISTORY_DEPTH > 0 The result of above subtraction is what we call "free" Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds the condition that if we are in draining or init draining state and pipeline_copy() appeared before we actually started the draining, plus the amount of new data can overwrite the data staged for draining then we should postpone buffering procedure for next period. At that time we assume draining task will have already drained some samples therefore making a space for new ones. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch reworks the calculation of buffered data. NOTE! We only keep record of buffered data up to the size of history buffer as there is no usecase beyond that. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes the error message caused by no bytes to be buffered from "error" to warning as this is not crirical error. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch moves the update of buffered data during draining from buffering function to the caller function. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes the order of members in comp_data struct to improve memory access for related data. So now data that are commonly used together like *state* and *state_log* are put next to each other so fewer cache reads are needed. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This updates the minimal host buffer size to the minimum value which enables sefe draining for all pcm parameters. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Member
|
CI known issues on Jenkins. |
lgirdwood
approved these changes
Apr 7, 2020
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.
This PR adds protection of history data so they won't get overwritten when pipeline_copy() task occurs during draining or init draining state.
Also, there is a change for the topology - minimal buffer size is raised so it enables safe draining for all formats.
Minor refactoring added too.
Signed-off-by: Marcin Rajwa marcin.rajwa@linux.intel.com