Commit fde4770
mm/huge_memory: refactor after-split (page) cache code
Smatch/coverity checkers report NULL mapping referencing issues[1][2][3]
every time the code is modified, because they do not understand that
mapping cannot be NULL when a folio is in page cache in the code.
Refactor the code to make it explicit.
Remove "end = -1" for anonymous folios, since after code refactoring, end
is no longer used by anonymous folio handling code.
No functional change is intended.
Link: https://lkml.kernel.org/r/20250718023000.4044406-7-ziy@nvidia.com
Link: https://lore.kernel.org/linux-mm/2afe3d59-aca5-40f7-82a3-a6d976fb0f4f@stanley.mountain/ [1]
Link: https://lore.kernel.org/oe-kbuild/64b54034-f311-4e7d-b935-c16775dbb642@suswa.mountain/ [2]
Link: https://lore.kernel.org/linux-mm/20250716145804.4836-1-antonio@mandelbit.com/ [3]
Link: https://lkml.kernel.org/r/20250718183720.4054515-7-ziy@nvidia.com
Signed-off-by: Zi Yan <ziy@nvidia.com>
Suggested-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kirill A. Shutemov <k.shutemov@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: Mathew Brost <matthew.brost@intel.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent a387156 commit fde4770
1 file changed
+28
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3640 | 3640 | | |
3641 | 3641 | | |
3642 | 3642 | | |
3643 | | - | |
3644 | 3643 | | |
3645 | 3644 | | |
3646 | 3645 | | |
| |||
3793 | 3792 | | |
3794 | 3793 | | |
3795 | 3794 | | |
| 3795 | + | |
| 3796 | + | |
3796 | 3797 | | |
3797 | 3798 | | |
3798 | 3799 | | |
3799 | 3800 | | |
3800 | 3801 | | |
3801 | 3802 | | |
3802 | 3803 | | |
3803 | | - | |
3804 | | - | |
3805 | | - | |
3806 | | - | |
3807 | | - | |
3808 | | - | |
3809 | | - | |
3810 | | - | |
3811 | | - | |
3812 | | - | |
3813 | | - | |
3814 | | - | |
3815 | | - | |
3816 | | - | |
3817 | | - | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
3818 | 3809 | | |
3819 | 3810 | | |
3820 | 3811 | | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
3821 | 3824 | | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
3822 | 3834 | | |
3823 | 3835 | | |
3824 | 3836 | | |
| |||
0 commit comments