]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Cleanup faultaround and finish_fault() codepaths
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Sat, 19 Dec 2020 12:19:23 +0000 (15:19 +0300)
committerWill Deacon <will@kernel.org>
Wed, 20 Jan 2021 14:46:04 +0000 (14:46 +0000)
commit33fe6a60a1785e8fad8958e6d496f58d52a8364b
tree81ea4f17081eac47606246a4ba96a43cd8db00c9
parent9fb686b91f85f6106279ccd602ad0555eb2734b1
mm: Cleanup faultaround and finish_fault() codepaths

alloc_set_pte() has two users with different requirements: in the
faultaround code, it called from an atomic context and PTE page table
has to be preallocated. finish_fault() can sleep and allocate page table
as needed.

PTL locking rules are also strange, hard to follow and overkill for
finish_fault().

Let's untangle the mess. alloc_set_pte() has gone now. All locking is
explicit.

The price is some code duplication to handle huge pages in faultaround
path, but it should be fine, having overall improvement in readability.

Link: https://lore.kernel.org/r/20201229132819.najtavneutnf7ajp@box
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[will: s/from from/from/ in comment; spotted by willy]
Signed-off-by: Will Deacon <will@kernel.org>
fs/xfs/xfs_file.c
include/linux/mm.h
include/linux/pgtable.h
mm/filemap.c
mm/memory.c