summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorRyujiro Shibuya <ryujiro.shibuya@owmobility.com>2019-10-16 06:30:02 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-10-16 15:28:44 +0000
commit8e20fe7ab445e2de80caabb298aef8a658f6d4ab (patch)
treed125ae13ab94d9abe8a2d233e0258c858fa931fa /src/svm/svm_fifo.h
parenta9f1e7d4fd764b4f68e830528dbd296921050293 (diff)
svm: immediate fifo growth even when wrapped
Type: fix - when the fifo is wrapped, and if applicable, insert a new chunk after the tail-chunk and rebuild the rb_tree. - make sure that this new algorithm can be applied only when the fifo is used by a single thread (master-thread of the fifo). Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: I3fc187bc496ea537ca24381e4abc08d2906c9e03
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 64ed53bf827..ce4c53d9abe 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -70,6 +70,7 @@ typedef enum svm_fifo_flag_
SVM_FIFO_F_SHRINK = 1 << 2,
SVM_FIFO_F_COLLECT_CHUNKS = 1 << 3,
SVM_FIFO_F_LL_TRACKED = 1 << 4,
+ SVM_FIFO_F_SINGLE_THREAD_OWNED = 1 << 5,
} svm_fifo_flag_t;
typedef struct _svm_fifo
@@ -477,6 +478,14 @@ ooo_segment_t *svm_fifo_first_ooo_segment (svm_fifo_t * f);
* @return 1 if sane, 0 otherwise
*/
u8 svm_fifo_is_sane (svm_fifo_t * f);
+/**
+ * Declare this fifo is used by only a single thread.
+ * In this special case, fifo-growth can be done in an efficient way without delay.
+ *
+ * @param f fifo
+ * @return 1 if the fifo is already owned by another thread, 0 otherwise
+ */
+u8 svm_fifo_set_single_thread_owned (svm_fifo_t * f);
format_function_t format_svm_fifo;
/**