Repository navigation
Commit 75edd34
tmpfs: preliminary minor tidyups
Make a few cleanups in mm/shmem.c, before going on to complicate it.
shmem_alloc_page() will become more complicated: we can't afford to to
have that complication duplicated between a CONFIG_NUMA version and a
!CONFIG_NUMA version, so rearrange the #ifdef'ery there to yield a
single shmem_swapin() and a single shmem_alloc_page().
Yes, it's a shame to inflict the horrid pseudo-vma on non-NUMA
configurations, but eliminating it is a larger cleanup: I have an
alloc_pages_mpol() patchset not yet ready - mpol handling is subtle and
bug-prone, and changed yet again since my last version.
Move __SetPageLocked, __SetPageSwapBacked from shmem_getpage_gfp() to
shmem_alloc_page(): that SwapBacked flag will be useful in future, to
help to distinguish different cases appropriately.
And the SGP_DIRTY variant of SGP_CACHE is hard to understand and of
little use (IIRC it dates back to when shmem_getpage() returned the page
unlocked): kill it and do the necessary in shmem_file_read_iter().
But an arm64 build then complained that info may be uninitialized (where
shmem_getpage_gfp() deletes a freshly alloced page beyond eof), and
advancing to an "sgp <= SGP_CACHE" test jogged it back to reality.
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Yang Shi <yang.shi@linaro.org>
Cc: Ning Qu <quning@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent fa9949d commit 75edd34
2 files changed
Lines changed: 32 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
172 | | - | |
| 171 | + | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| |||
947 | 946 | | |
948 | 947 | | |
949 | 948 | | |
950 | | - | |
951 | | - | |
| 949 | + | |
952 | 950 | | |
953 | 951 | | |
954 | 952 | | |
| |||
972 | 970 | | |
973 | 971 | | |
974 | 972 | | |
975 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
976 | 985 | | |
977 | 986 | | |
978 | 987 | | |
| |||
1008 | 1017 | | |
1009 | 1018 | | |
1010 | 1019 | | |
1011 | | - | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1012 | 1025 | | |
1013 | 1026 | | |
1014 | 1027 | | |
1015 | 1028 | | |
1016 | 1029 | | |
1017 | 1030 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | 1031 | | |
1045 | 1032 | | |
1046 | 1033 | | |
| |||
1084 | 1071 | | |
1085 | 1072 | | |
1086 | 1073 | | |
1087 | | - | |
1088 | | - | |
1089 | 1074 | | |
1090 | 1075 | | |
1091 | 1076 | | |
| |||
1155 | 1140 | | |
1156 | 1141 | | |
1157 | 1142 | | |
1158 | | - | |
| 1143 | + | |
1159 | 1144 | | |
1160 | 1145 | | |
1161 | 1146 | | |
| |||
1275 | 1260 | | |
1276 | 1261 | | |
1277 | 1262 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | 1263 | | |
1282 | 1264 | | |
1283 | 1265 | | |
| |||
1321 | 1303 | | |
1322 | 1304 | | |
1323 | 1305 | | |
1324 | | - | |
1325 | | - | |
1326 | 1306 | | |
1327 | 1307 | | |
1328 | 1308 | | |
1329 | | - | |
| 1309 | + | |
1330 | 1310 | | |
1331 | 1311 | | |
1332 | 1312 | | |
| |||
1633 | 1613 | | |
1634 | 1614 | | |
1635 | 1615 | | |
1636 | | - | |
| 1616 | + | |
1637 | 1617 | | |
1638 | 1618 | | |
1639 | 1619 | | |
| |||
1659 | 1639 | | |
1660 | 1640 | | |
1661 | 1641 | | |
1662 | | - | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
1663 | 1645 | | |
| 1646 | + | |
1664 | 1647 | | |
1665 | 1648 | | |
1666 | 1649 | | |
| |||
0 commit comments