Hi
        About this problem how to analyze why the valgrind slow, I analyze the 
source code. I found the source to use atomic function  __sync_fetch_and_add to 
finish the job.
        There are  four thread  use __sync_fetch_and_add to sync the compute 
status.
        The source as below:
        Function1:
bool CDynamicScheduling::GetProcLoop(
        int& nBegin,
        int& nEndPlusOne)
{
        int curr = __sync_fetch_and_add(&m_nCurrent, m_nStep);
        if (curr > m_nEnd)
        {
                return false;
        }

        nBegin = curr;
        int limit = m_nEnd + 1;
        nEndPlusOne = curr + m_nStep;
        return true;
}
        
        
        Function2:
        ....
        int beginY, endY;
  while (pDS->GetProcLoop(beginY, endY)){
    for (y = beginY; y < endY; y++){
      for(x = 0; x < dstWDiv2-7; x+=8){
        vtmp0 = vld2q_u16(&pSrc[(y<<1)*srcStride+(x<<1)]);
        vtmp1 = vld2q_u16(&pSrc[((y<<1)+1)*srcStride+(x<<1)]);
        vst1q_u16(&pDst[y*dstStride+x], (vtmp0.val[0] + vtmp0.val[1] + 
vtmp1.val[0] + vtmp1.val[1] + vdupq_n_u16(2)) >> vdupq_n_u16(2));
      }
      for(; x < dstWDiv2; x++){
        pDst[y*dstStride+x] = (pSrc[(y<<1)*srcStride+(x<<1)] + 
pSrc[(y<<1)*srcStride+(x<<1)+1] + pSrc[((y<<1)+1)*srcStride+(x<<1)] + 
pSrc[((y<<1)+1)*srcStride+((x<<1)+1)] + 2) >> 2;
      }
    }
  }

  return;
}       

        Function 2 call function1 (GetProcLoop) to get start and end index, Is 
there something relate to problem of valgrind last too long.

        Before  I heard some guy who maintained the valgrind said the valgrind 
3.13 modify the lock algorithm. So the lock algorithm  of valgirnd 3.13 is 
different from valgirnd 3.12's.  
        Can you show me  some details why you modify the lock algorithm, what 
improvement. I need to know whether I need to upgrade the valgrind .  Upgrade 
is the hard work, a lot of testing.
        
        Background, I have down load the source code , but I still compile the 
source code failed in arm32, I need both aarch64 and arm32. They run together.
        So I want to try new way, build the valgrind 3.13 and try it.

BR
Owen




-----邮件原件-----
发件人: Ivo Raisr [mailto:iv...@ivosh.net] 
发送时间: 2018年1月24日 12:36
收件人: Wuweijia <wuwei...@huawei.com>
抄送: valgrind-users@lists.sourceforge.net; Fanbohao <fanbo...@huawei.com>
主题: Re: 答复: 答复: [Valgrind-users] [Help] Valgrind sometime run the program very 
slowly sometimes , it last at least one hour. can you show me why or some way 
to analyze it?

2018-01-24 1:36 GMT+01:00 Wuweijia <wuwei...@huawei.com>:
> Hi:
>         But I can not access the git of valgrind. Is there any way to 
> get the newest source code; Maybe the network configuration do not 
> allow it;

It is hard to help you without any specific error shown.
If this is indeed a network configuration, there is a git mirror of Valgrind 
accessible over http or https.
Have a look at http://repo.or.cz/w/valgrind.git

I.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to