Commit 67f1c9c
zsmalloc: introduce some helper functions
Patch series "zsmalloc: remove bit_spin_lock", v2.
zsmalloc uses bit_spin_lock to minimize space overhead since it's zpage
granularity lock. However, it causes zsmalloc non-working under
PREEMPT_RT as well as adding too much complication.
This patchset tries to replace the bit_spin_lock with per-pool rwlock.
It also removes unnecessary zspage isolation logic from class, which was
the other part too much complication added into zsmalloc.
Last patch changes the get_cpu_var to local_lock to make it work in
PREEMPT_RT.
This patch (of 9):
get_zspage_mapping returns fullness as well as class_idx. However, the
fullness is usually not used since it could be stale in some contexts.
It causes misleading as well as unnecessary instructions so this patch
introduces zspage_class.
obj_to_location also produces page and index but we don't need always
the index, either so this patch introduces obj_to_page.
Link: https://lkml.kernel.org/r/20211115185909.3949505-1-minchan@kernel.org
Link: https://lkml.kernel.org/r/20211115185909.3949505-2-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 1622ed7 commit 67f1c9c
1 file changed
Lines changed: 23 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
| |||
844 | 850 | | |
845 | 851 | | |
846 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
847 | 859 | | |
848 | 860 | | |
849 | 861 | | |
| |||
1246 | 1258 | | |
1247 | 1259 | | |
1248 | 1260 | | |
1249 | | - | |
1250 | | - | |
1251 | 1261 | | |
1252 | 1262 | | |
1253 | 1263 | | |
| |||
1270 | 1280 | | |
1271 | 1281 | | |
1272 | 1282 | | |
1273 | | - | |
1274 | | - | |
| 1283 | + | |
1275 | 1284 | | |
1276 | 1285 | | |
1277 | 1286 | | |
| |||
1304 | 1313 | | |
1305 | 1314 | | |
1306 | 1315 | | |
1307 | | - | |
1308 | | - | |
1309 | 1316 | | |
1310 | 1317 | | |
1311 | 1318 | | |
1312 | 1319 | | |
1313 | 1320 | | |
1314 | 1321 | | |
1315 | | - | |
1316 | | - | |
| 1322 | + | |
1317 | 1323 | | |
1318 | 1324 | | |
1319 | 1325 | | |
| |||
1491 | 1497 | | |
1492 | 1498 | | |
1493 | 1499 | | |
1494 | | - | |
1495 | | - | |
1496 | 1500 | | |
1497 | 1501 | | |
1498 | 1502 | | |
| |||
1502 | 1506 | | |
1503 | 1507 | | |
1504 | 1508 | | |
1505 | | - | |
| 1509 | + | |
1506 | 1510 | | |
1507 | 1511 | | |
1508 | 1512 | | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
| 1513 | + | |
1512 | 1514 | | |
1513 | 1515 | | |
1514 | 1516 | | |
| |||
1866 | 1868 | | |
1867 | 1869 | | |
1868 | 1870 | | |
1869 | | - | |
1870 | | - | |
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
| |||
1880 | 1880 | | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | 1883 | | |
1890 | 1884 | | |
1891 | | - | |
| 1885 | + | |
| 1886 | + | |
1892 | 1887 | | |
1893 | 1888 | | |
1894 | 1889 | | |
| |||
1907 | 1902 | | |
1908 | 1903 | | |
1909 | 1904 | | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
1910 | 1908 | | |
1911 | 1909 | | |
1912 | 1910 | | |
| |||
1923 | 1921 | | |
1924 | 1922 | | |
1925 | 1923 | | |
1926 | | - | |
1927 | | - | |
1928 | 1924 | | |
1929 | 1925 | | |
1930 | 1926 | | |
| |||
1949 | 1945 | | |
1950 | 1946 | | |
1951 | 1947 | | |
1952 | | - | |
1953 | 1948 | | |
1954 | | - | |
| 1949 | + | |
1955 | 1950 | | |
1956 | 1951 | | |
1957 | 1952 | | |
| |||
2049 | 2044 | | |
2050 | 2045 | | |
2051 | 2046 | | |
2052 | | - | |
2053 | | - | |
2054 | 2047 | | |
2055 | 2048 | | |
2056 | 2049 | | |
2057 | 2050 | | |
2058 | 2051 | | |
2059 | 2052 | | |
2060 | 2053 | | |
2061 | | - | |
2062 | 2054 | | |
2063 | 2055 | | |
2064 | | - | |
| 2056 | + | |
2065 | 2057 | | |
2066 | 2058 | | |
2067 | 2059 | | |
| |||
0 commit comments