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 4 additions, 2 deletionsfs/xfs/xfs_file.c
- include/linux/mm.h 7 additions, 5 deletionsinclude/linux/mm.h
- include/linux/pgtable.h 11 additions, 0 deletionsinclude/linux/pgtable.h
- mm/filemap.c 134 additions, 43 deletionsmm/filemap.c
- mm/memory.c 57 additions, 142 deletionsmm/memory.c
-
mentioned in commit 3649d388
-
mentioned in commit 3b8b5154
-
mentioned in commit e715109c
-
mentioned in commit f78a7c1c
-
mentioned in commit 5d05af0b
-
mentioned in commit 19614e3c
-
mentioned in commit 2f57a9be
-
mentioned in commit 2e09a488
-
mentioned in commit 3fe2895c
-
mentioned in commit f1a0a81e
-
mentioned in commit 2722fb0f
-
mentioned in commit f7791e61
-
mentioned in commit 274df74b
-
mentioned in commit c34869f1
-
mentioned in commit 2243821a
-
mentioned in commit f3ccc300
-
mentioned in commit 6e71b85f
-
mentioned in commit 7cc5413b
-
mentioned in commit 70427f6e
-
mentioned in commit f9cedf6b
-
mentioned in commit 90270e6e
-
mentioned in commit ea56f853
-
mentioned in commit 636e84ce
-
mentioned in commit ark-5.14@636e84ce
-
mentioned in commit 5fb75893
-
mentioned in commit aeb6fbd1
-
mentioned in commit 5bdd6042
-
mentioned in commit fa466f51
-
mentioned in commit fd9e279f
-
mentioned in commit 2a2bce2d
-
mentioned in commit b69f6450
-
mentioned in commit c5875a1c
-
mentioned in commit f8b67eab
-
mentioned in commit clo/linux-kernel/rb3gen2@9aa1345d