Commit 219f624
committed
mm/mm_init: drop deferred_init_maxorder()
deferred_init_memmap_chunk() calls deferred_init_maxorder() to initialize
struct pages in MAX_ORDER_NR_PAGES because according to commit 0e56aca
("mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger
sections") this provides better cache locality than initializing the memory
map in larger sections.
The looping through free memory ranges is quite cumbersome in the current
implementation as it is divided between deferred_init_memmap_chunk() and
deferred_init_maxorder(). Besides, the latter has two loops, one that
initializes struct pages and another one that frees them.
There is no need in two loops because it is safe to free pages in groups
smaller than MAX_ORDER_NR_PAGES. Even if lookup for a buddy page will
access a struct page ahead of the pages being initialized, that page is
guaranteed to be initialized either by memmap_init_reserved_pages() or by
init_unavailable_range().
Simplify the code by moving initialization and freeing of the pages into
deferred_init_memmap_chunk() and dropping deferred_init_maxorder().
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>1 parent f1f8618 commit 219f624
1 file changed
Lines changed: 32 additions & 95 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2046 | 2046 | | |
2047 | 2047 | | |
2048 | 2048 | | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
2059 | | - | |
2060 | | - | |
2061 | | - | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | | - | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | | - | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
2088 | 2057 | | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
| 2058 | + | |
| 2059 | + | |
2092 | 2060 | | |
2093 | 2061 | | |
2094 | | - | |
2095 | | - | |
| 2062 | + | |
| 2063 | + | |
2096 | 2064 | | |
2097 | | - | |
2098 | | - | |
| 2065 | + | |
2099 | 2066 | | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
2119 | | - | |
| 2067 | + | |
| 2068 | + | |
2120 | 2069 | | |
2121 | | - | |
2122 | | - | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
2123 | 2073 | | |
2124 | | - | |
| 2074 | + | |
2125 | 2075 | | |
2126 | 2076 | | |
2127 | | - | |
2128 | | - | |
| 2077 | + | |
| 2078 | + | |
2129 | 2079 | | |
2130 | | - | |
2131 | | - | |
2132 | | - | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
2133 | 2083 | | |
2134 | | - | |
2135 | | - | |
2136 | | - | |
2137 | | - | |
2138 | | - | |
2139 | | - | |
2140 | | - | |
2141 | | - | |
2142 | | - | |
2143 | | - | |
| 2084 | + | |
| 2085 | + | |
2144 | 2086 | | |
2145 | | - | |
| 2087 | + | |
2146 | 2088 | | |
2147 | | - | |
2148 | | - | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
2153 | | - | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
2157 | 2094 | | |
2158 | 2095 | | |
2159 | 2096 | | |
| |||
0 commit comments