Skip to contentSkip to conversation

ip_pipeline: fix false cacheline sharing among threads

PATCH Superseded Jasvinder Singh 2 participants 3 messages Jun 11, 2016 – Jun 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip_pipeline: fix false cacheline sharing among threads

In ip_pipeline app, the structure app_thread_data needs to be aligned to the cache line boundary as threads on different cpu cores are accessing fields of the app->thread_data and having this structure not aligned on cacheline boundary leads to false cacheline sharing.

Fixes 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")
---
 examples/ip_pipeline/app.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ip_pipeline/app.h +1 -1
index 848244a..c51fc7f 100644
@@ -300,7 +300,7 @@ struct app_thread_data {
 	uint64_t headroom_time;
 	uint64_t headroom_cycles;
 	double headroom_ratio;
-};
+}__rte_cache_aligned;
 
 #ifndef APP_MAX_LINKS
 #define APP_MAX_LINKS                            16
Signature · 1 line
2.5.5
#1 lore raw

PATCH v2 1/1 ip_pipeline: fix false cacheline sharing among threads

In ip_pipeline app, the structure app_thread_data needs to be aligned to the cache line boundary as threads on different cpu cores are accessing fields of the app->thread_data and having this structure not aligned on cacheline boundary leads to false cacheline sharing.

Fixes 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

---
v2
- fix checkpatch error

 examples/ip_pipeline/app.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ip_pipeline/app.h +1 -1
index 848244a..7611341 100644
@@ -300,7 +300,7 @@ struct app_thread_data {
 	uint64_t headroom_time;
 	uint64_t headroom_cycles;
 	double headroom_ratio;
-};
+} __rte_cache_aligned;
 
 #ifndef APP_MAX_LINKS
 #define APP_MAX_LINKS                            16
Signature · 1 line
2.5.5
#2 lore raw

2016-06-12 13:42, Jasvinder Singh:

Quoted 9 lines

In ip_pipeline app, the structure app_thread_data needs to be aligned to the cache line boundary as threads on different cpu cores are accessing fields of the app->thread_data and having this structure not aligned on cacheline boundary leads to false cacheline sharing.

Fixes 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Applied, thanks