Fwd: Locking Design of dm-cache

89 views
Skip to first unread message

Ming Zhao

unread,
Apr 10, 2012, 8:21:27 AM4/10/12
to dm-c...@googlegroups.com


---------- 转发的邮件 ----------
发件人: Ming Chen
日期: 2012年4月10日星期二
主题: Locking Design of dm-cache
收件人: "mi...@cs.fiu.edu" <mi...@cs.fiu.edu>


Dear Professor Zhao,

 

This is Ming Chen, a PhD student at Stony Brook University. I am developing a device mapper target as part of a course project. I have learnt a lot from dm-cache. Thank you for your wonderful work on dm-cache.

 

I have two questions about locking design of dm-cache.

 

In cache_lookup, there is no locking when cache state is examined. For example, line 910 does not hold a lock. However, in cache_hit, the lock is held for the same operation (line 1014). I am sorry that I am a little confused. Can you enlighten me of the design concern of this?

 

Moreover, for _job_lock, the irqsave/restore version of spinlock is used, whereas for cache[cache_block].lock, the simplest version is used. I know we can use simple spin_lock and spin_unlock when the critical section will not be called by an interrupt handle. However, I cannot see this here.

 

The version I am referring to is 3.0, and please kindly let me know if I have any misunderstanding. Thank you very much!

 

Best,

Ming


Reply all
Reply to author
Forward
0 new messages