Hi,

Could you give the steps to reproduce?

Cheers,
Ole



> On 27 Sep 2019, at 11:59, [email protected] wrote:
> 
> my code is on master commit f5667c3055dbd6755277f085c6778c2b1104aa6e
> in stat_segment.c: stat_validate_counter_vector(), create two dimension:  
> counter[thread_num][max]
> 
> 
> static void
> 
> stat_validate_counter_vector (stat_segment_directory_entry_t * ep, u32 max)
> 
> {
> 
>   stat_segment_main_t *sm = &stat_segment_main;
> 
>   stat_segment_shared_header_t *shared_header = sm->shared_header;
> 
>   counter_t **counters = 0;
> 
>   vlib_thread_main_t *tm = vlib_get_thread_main ();
> 
>   int i;
> 
>   u64 *offset_vector = 0;
> 
> 
> 
>   vec_validate_aligned (counters, tm->n_vlib_mains - 1,
> 
>       CLIB_CACHE_LINE_BYTES);
> 
>   for (i = 0; i < tm->n_vlib_mains; i++)
> 
>     {
> 
>       vec_validate_aligned (counters[i], max, CLIB_CACHE_LINE_BYTES);
> 
>       vec_add1 (offset_vector,
> 
>     stat_segment_offset (shared_header, counters[i]));
> 
>     }
> 
>   ep->offset = stat_segment_offset (shared_header, counters);
> 
>   ep->offset_vector = stat_segment_offset (shared_header, offset_vector);
> 
> }
> 
> but in do_stat_segment_updates(),  access counter by 
> counter[max][thread_num],  this lead to unpredict behavior, like man thread 
> hang on. 
> 
>   for (i = start; i < vec_len (vlib_mains); i++)
> 
>     {
> 
> 
> 
>       f64 this_vector_rate;
> 
> 
> 
>       this_vlib_main = vlib_mains[i];
> 
> 
> 
>       this_vector_rate = vlib_last_vector_length_per_node (this_vlib_main);
> 
>       vector_rate += this_vector_rate;
> 
> 
> 
>       /* Set the per-worker rate */
> 
>       counters[0][i - start] = this_vector_rate;
> 
>     }
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#14074): https://lists.fd.io/g/vpp-dev/message/14074
> Mute This Topic: https://lists.fd.io/mt/34309766/675193
> Group Owner: [email protected]
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14075): https://lists.fd.io/g/vpp-dev/message/14075
Mute This Topic: https://lists.fd.io/mt/34309766/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to