[dpdk-dev] About the shared flock for hugepage files

白长敏 912873551 at qq.com
Tue Sep 12 04:16:39 CEST 2017


Hi, everyone,


    I'm a developer from china, now i have a problem is about the shared flock for hugepage files in the function of "map_all_hugepages()".


as follows:
---------------------------------------------------------------------------------------------------
/* set shared flock on the file. */


if (flock(fd, LOCK_SH | LOCK_NB) == -1) {


        RTE_LOG(DEBUG, EAL, "%s(): Locking file failed:%s \n", __func__, strerror(errno));


        close(fd);


        return i;


}


close(fd);

--------------------------------------------------------------------------------------------------
there, it gives a shared flock to each hugepage file in /mnt/huge, and close it right away. 


it makes me puzzled. Why? What doing that is for? 


I'm looking forward to your reply, thank you very much.


best regards,
Bakari.


More information about the dev mailing list