Re: [PATCH] x86/mm: fix function name typo in pmd_read_atomic() comment
From: Wei Yang
Date: Tue Sep 24 2019 - 22:00:21 EST
To be honest, I have a question on how this works.
As the comment says, we need to call pmd_read_atomic before using
pte_offset_map_lock to avoid data corruption.
For example, in function swapin_walk_pmd_entry:
pmd_none_or_trans_huge_or_clear_bad(pmd)
pmd_read_atomic(pmd) --- 1
pte_offset_map_lock(mm, pmd, ...) --- 2
At point 1, we are assured the content is intact. While in point 2, we would
read pmd again to calculate the pte address. How we ensure this time the
content is intact? Because pmd_none_or_trans_huge_or_clear_bad() ensures the
pte is stable, so that the content won't be changed?
Thanks for your time in advance.
--
Wei Yang
Help you, Help me