Hi,
   OK.  Thanks very much for detailed explanation.

BR
Yan Limin

-----Original Message-----
From: Savolainen, Petri (Nokia - FI/Espoo) 
Sent: Wednesday, September 05, 2018 3:29 PM
To: Yan, Liming (NSB - CN/Hangzhou) <liming....@nokia-sbell.com>; Bill 
Fischofer <bill.fischo...@linaro.org>
Cc: lng-odp-forward <lng-odp@lists.linaro.org>
Subject: RE: [lng-odp] Are those Asynchronous ordered locks available for use 
in 1.19?

Hi,

These calls have been implemented by the API spec. So, you can use those in 
your application. Lock_start() hints implementation that a lock_wait() will 
follow, but implementation is free to ignore the hint (if there's nothing it 
can do as preparation for lock_wait()). Lock_wait() is the one that must ensure 
synchronization.

Odp-linux or odp-dpdk implementations ignore lock_start() and do normal lock 
call in lock_wait(), as the (current) SW implementation is synchronous. May be 
we could e.g. do a memory prefetch at lock_start(), but not much more.

However, ODP implementations with a HW scheduler may very well use this hint 
for their benefit and your application could run there faster when using 
lock_start() and lock_wait(), instead of the normal _lock(). For example, 
Cavium implementations may benefit from these calls, as these were added from 
their request.

-Petri

> -----Original Message-----
> From: lng-odp <lng-odp-boun...@lists.linaro.org> On Behalf Of Yan, 
> Liming (NSB - CN/Hangzhou)
> Sent: Wednesday, September 5, 2018 6:15 AM
> To: Bill Fischofer <bill.fischo...@linaro.org>
> Cc: lng-odp-forward <lng-odp@lists.linaro.org>
> Subject: Re: [lng-odp] Are those Asynchronous ordered locks available 
> for use in 1.19?
> 
> Hi,
>    Thanks. You mean aync ordering lock needs HW support?  I’m using 
> odp- dpdk in virtual machine. So can I use 
> odp_schedule_order_lock_start() and
> odp_schedule_order_lock_wait() for async ordering lock?
> 
> 
> BR
> Yan Limin
> 
> From: Bill Fischofer [mailto:bill.fischo...@linaro.org]
> Sent: Tuesday, September 04, 2018 7:45 PM
> To: Yan, Liming (NSB - CN/Hangzhou) <liming....@nokia-sbell.com>
> Cc: lng-odp-forward <lng-odp@lists.linaro.org>
> Subject: Re: [lng-odp] Are those Asynchronous ordered locks available 
> for use in 1.19?
> 
> Yes, these APIs are available however only platforms with HW support 
> will show a practical difference in behavior. These APIs are hints to 
> the implementation, which is why you cannot assume you hold the lock 
> until after odp_schedule_order_lock_wait() completes.
> 
> On Tue, Sep 4, 2018 at 6:41 AM Yan, Liming (NSB - CN/Hangzhou) 
> <liming....@nokia-sbell.com<mailto:liming....@nokia-sbell.com>> wrote:
> Hi,
>   I see in change log:
> 
>    Asynchronous ordered locks
>    Two new APIs, odp_schedule_order_lock_start() and
> odp_schedule_order_lock_wait() are added to allow for asynchronous 
> ordered lock acquisition in addition to the existing synchronous
> odp_schedule_order_lock() API. In some implementations and 
> applications, there may be a performance advantage to indicating the 
> intent to acquire an ordered lock to allow the implementation to 
> prepare for this while the application continues parallel processing 
> and then enter the critical section protected by the ordered lock at a 
> later time. In this case ordered lock protection is not guaranteed 
> until the odp_schedule_order_lock_wait() call returns.
> 
> But when I check the APIs code, seems they're still synchronous 
> calling, similar with schedule_order_lock. Maybe I don't get how to 
> use these APIs.  I didn't see any examples. So my question is, Are 
> those Asynchronous ordered locks available for use?  And how to use them?  
> Thanks very much.
> 
> static void schedule_order_lock_wait(uint32_t lock_index) {
>         schedule_order_lock(lock_index); }
> 
> 
> 
> BR
> Yan Limin
> 

Reply via email to