On 01/23/2013 10:49 PM, Takuya Yoshikawa wrote: > On Wed, 23 Jan 2013 21:45:23 +0800 > Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx> wrote: > >>> The current code which deletes the two link nodes in different functions >>> looks unnatural to me: traversing the sp->link nodes forces us to break >>> the loop and sp->hash_link nodes alone is allowed to continue ... >>> >>> Making each function semantically clear should be more important than >>> other things. >>> >> >> The reason the code like this is, we have lockless shadow page walker. > > But hash_link needs to be protected by mmu_lock anyway? The purpose that do not delete hlist is for continuously walking hash table entry. Deleting link is for reusing it on invalid list to save memory space. If you really like to continuously walk sh->link, we can introduce another list for invalid list using, but it is not worthwhile. To be honest, i do not care this, no one ask us to obey the rule that "all lists should have the same walking behaviour". ;). But comment for these code is always appreciated. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html