Also thanks for your patient communication and explanation.
A wonderful discussion~

Best Regards
Feifei
> -----邮件原件-----
> 发件人: Slava Ovsiienko <[email protected]>
> 发送时间: 2021年5月18日 18:18
> 收件人: Feifei Wang <[email protected]>; Matan Azrad
> <[email protected]>; Shahaf Shuler <[email protected]>
> 抄送: [email protected]; nd <[email protected]>; Ruifeng Wang
> <[email protected]>
> 主题: RE: [PATCH v3 2/2] net/mlx5: remove unnecessary wmb for Memory
> Region cache
> 
> > -----Original Message-----
> > From: Feifei Wang <[email protected]>
> > Sent: Tuesday, May 18, 2021 11:51
> > To: Matan Azrad <[email protected]>; Shahaf Shuler
> > <[email protected]>; Slava Ovsiienko <[email protected]>
> > Cc: [email protected]; [email protected]; Feifei Wang <[email protected]>;
> > Ruifeng Wang <[email protected]>
> > Subject: [PATCH v3 2/2] net/mlx5: remove unnecessary wmb for Memory
> > Region cache
> >
> > 'dev_gen' is a variable to trigger all cores to flush their local
> > caches once the global MR cache has been rebuilt.
> >
> > This is due to MR cache's R/W lock can maintain synchronization
> > between
> > threads:
> >
> > 1. dev_gen and global cache updating ordering inside the lock
> > protected section does not matter. Because other threads cannot take
> > the lock until global cache has been updated. Thus, in out of order
> > platform, even if other agents firstly observe updated dev_gen but
> > global does not update, they also have to wait the lock. As a result,
> > it is unnecessary to add a wmb between global cache rebuilding and
> > updating the dev_gen to keep the memory store order.
> >
> > 2. Store-Release of unlock provides the implicit wmb at the level
> > visible by software. This makes 'rebuilding global cache' and
> > 'updating dev_gen' be observed before local_cache starts to be updated
> > by other agents. Thus, wmb after 'updating dev_gen' can be removed.
> >
> > Suggested-by: Ruifeng Wang <[email protected]>
> > Signed-off-by: Feifei Wang <[email protected]>
> > Reviewed-by: Ruifeng Wang <[email protected]>
> Acked-by: Viacheslav Ovsiienko <[email protected]>
> 
> Thanks a lot for patience and cooperation.
> With best regards,
> Slava

Reply via email to