Re: Memory barrier

2011-12-22 Thread Vladimir Murzin
get the result: b==2 & a==0 , which means although cpu1 set int1=1 > before int2=2, there is no garentee for cpu2 to perceive int1 before int2. > you must add smp_rmb() inside cpu2 to prevent this. > > two cpus must cooperate to acheive the sequence memory order. > > > &

Re: memory barrier in UP

2011-12-12 Thread Mulyadi Santosa
Hi Subin On Tue, Dec 13, 2011 at 01:57, subin gangadharan wrote: > Hi Mulyadi, > > Thanks for the answer. You welcome...I just shared what I know :) > In that case (ALPHA), is compiler barrier sufficient enough to prevent > the re ordering done by the processor. > What I was thinking,compil

Re: memory barrier in UP

2011-12-12 Thread subin gangadharan
Hi Mulyadi, Thanks for the answer. On Mon, Dec 12, 2011 at 11:16 AM, Mulyadi Santosa wrote: > Hi... > > On Mon, Dec 12, 2011 at 01:11, subin gangadharan > wrote: >> Hi All, >> >> I am reading about the barrier from linux kernel development.In this >> books, he says >> "On SMP kernels they are d

Re: memory barrier in UP

2011-12-12 Thread Mulyadi Santosa
Hi... On Mon, Dec 12, 2011 at 01:11, subin gangadharan wrote: > Hi All, > > I am reading about the barrier from linux kernel development.In this > books, he says > "On SMP kernels they are defined only as usual memory barriers.where > as on UP kernels they are > defined only as a compiler barrier

memory barrier in UP

2011-12-11 Thread subin gangadharan
Hi All, I am reading about the barrier from linux kernel development.In this books, he says "On SMP kernels they are defined only as usual memory barriers.where as on UP kernels they are defined only as a compiler barrier" Does this mean in UP, processor won't reorder the instructions ? Could pl

RE: Memory barrier

2011-12-09 Thread 卜弋天
s no garentee for cpu2 to perceive int1 before int2. you must add smp_rmb() inside cpu2 to prevent this. two cpus must cooperate to acheive the sequence memory order. > Date: Fri, 9 Dec 2011 14:14:37 +0530 > Subject: Re: Memory barrier > From: trisha1ma...@gmail.com > To: bu

Re: Memory barrier

2011-12-09 Thread trisha yad
. > > 2011/12/9 卜弋天 : >> Hi : >> >> memory barriers can not make order on other cpus, only the current >> cpu's order will be promised. >> >> >> >>> Date: Fri, 9 Dec 2011 12:54:40 +0530 >>> Subject: Memory barrier >>> F

Re: Memory barrier

2011-12-09 Thread trisha yad
CONFIG_SMP, all SMP barriers are converted into plain compiler barriers. 2011/12/9 卜弋天 : > Hi : > > memory barriers can not make order on other cpus, only the current > cpu's order will be promised. > > > >> Date: Fri, 9 Dec 2011 12:54:40 +0530 >> Subj

RE: Memory barrier

2011-12-08 Thread 卜弋天
Hi : memory barriers can not make order on other cpus, only the current cpu's order will be promised. > Date: Fri, 9 Dec 2011 12:54:40 +0530 > Subject: Memory barrier > From: trisha1ma...@gmail.com > To: Kernelnewbies@kernelnewbies.org > > Hi All, > &g

Memory barrier

2011-12-08 Thread trisha yad
Hi All, I need small clarification on memory barrier. #define smp_mb()        mb() #define smp_rmb()       rmb() #define smp_wmb()       wmb() In case of SMP: is smp_mb() or smp_rmb() make order on current CPU or all cpu's Thanks ___ Kernelne