Message ID | 1458321904-24247-1-git-send-email-zoltan.kiss@linaro.org |
---|---|
State | Accepted |
Commit | 65dfc6bccc751d42104d163961e621f336e993ff |
Headers | show |
Note, this is just a resend with a different set of CC recipients On 18/03/16 17:25, Zoltan Kiss wrote: > Since e5c85d3f "validation: timer: handle early exhaustion of pool" the > workers can handle if object caches retain packets, but with enough > threads it can happen that a late starting thread won't be able to > allocate any. This for loop should take that into account and not > trying to access tt[0].ev. > > Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> > --- > test/validation/timer/timer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c > index 5854b32..7b76dbf 100644 > --- a/test/validation/timer/timer.c > +++ b/test/validation/timer/timer.c > @@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) > uint32_t ms; > uint64_t prev_tick = odp_timer_current_tick(tp); > > - for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) { > + for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) { > odp_event_t ev; > while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) { > /* Subtract one from prev_tick to allow for timeouts >
Ping On 18/03/16 17:25, Zoltan Kiss wrote: > Since e5c85d3f "validation: timer: handle early exhaustion of pool" the > workers can handle if object caches retain packets, but with enough > threads it can happen that a late starting thread won't be able to > allocate any. This for loop should take that into account and not > trying to access tt[0].ev. > > Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> > --- > test/validation/timer/timer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c > index 5854b32..7b76dbf 100644 > --- a/test/validation/timer/timer.c > +++ b/test/validation/timer/timer.c > @@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) > uint32_t ms; > uint64_t prev_tick = odp_timer_current_tick(tp); > > - for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) { > + for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) { > odp_event_t ev; > while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) { > /* Subtract one from prev_tick to allow for timeouts >
Merged, with my review. Maxim. On 03/22/16 13:56, Zoltan Kiss wrote: > Ping > > On 18/03/16 17:25, Zoltan Kiss wrote: >> Since e5c85d3f "validation: timer: handle early exhaustion of pool" the >> workers can handle if object caches retain packets, but with enough >> threads it can happen that a late starting thread won't be able to >> allocate any. This for loop should take that into account and not >> trying to access tt[0].ev. >> >> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> >> --- >> test/validation/timer/timer.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/test/validation/timer/timer.c >> b/test/validation/timer/timer.c >> index 5854b32..7b76dbf 100644 >> --- a/test/validation/timer/timer.c >> +++ b/test/validation/timer/timer.c >> @@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg >> TEST_UNUSED) >> uint32_t ms; >> uint64_t prev_tick = odp_timer_current_tick(tp); >> >> - for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) { >> + for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) { >> odp_event_t ev; >> while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) { >> /* Subtract one from prev_tick to allow for timeouts >>
diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 5854b32..7b76dbf 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) uint32_t ms; uint64_t prev_tick = odp_timer_current_tick(tp); - for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) { + for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) { odp_event_t ev; while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) { /* Subtract one from prev_tick to allow for timeouts
Since e5c85d3f "validation: timer: handle early exhaustion of pool" the workers can handle if object caches retain packets, but with enough threads it can happen that a late starting thread won't be able to allocate any. This for loop should take that into account and not trying to access tt[0].ev. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> --- test/validation/timer/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)