Re: fast softint support for sparc64

Takeshi Nakayama <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc64
Message-ID <[email protected]>
>>> Eduardo Horvath <[email protected]> wrote

> If you're trying to order the store to the CI_MTX_COUNT with the store to 
> L_CTXSWTCH then I think it should be #StoreStore.  
> 
> Note the comment in membar_ops.S:
> 
> /* These assume Total Store Order (TSO) */
> 
> Um, if you're running TSO then you don't need any membars at all.  We 
> should really be coding this for RMO to get some performance improvements.  
> Otherwise leaving them out will reduce instruction count and CPU cycles.

Ok, I will just leave it out.  Thank you for detailed comment.

> Hm.  Looking more at mi_switch() it doesn't seem all that mi to me.  It 
> appears to be using l->l_ctxswtch as a synchronization flag, but the code 
> where it's set:
> 
>     733 		KASSERT(l->l_ctxswtch == 0);
>     734 		l->l_ctxswtch = 1;
>     735 		l->l_ncsw++;
>     736 		KASSERT((l->l_pflag & LP_RUNNING) != 0);
>     737 		l->l_pflag &= ~LP_RUNNING;
>     738 
> 
> really needs a membar after setting it to 1 to make sure the store 
> completes before continuing.  Well this explains why things didn't work 
> when I fixed up the stuff in libatomic and tried running the kernel RMO.
> 
> OTOH I think you can just leave the membar out.  It should work fine and 
> simplify code maintenance in the future.  As far as I'm concerned extra 
> membars in the wrong places are worse than not having them at all.  The 
> chance someone will go fix the membar correctly in future is pretty close 
> to zero.
> 
> Eduardo

Thanks,

Takeshi Nakayama
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.