Commit 6d77795
mm: optimize compound_head() by avoiding a shared page flag
The patch adds PageTail(page) and PageHead(page) to check if a page is the
head or the tail of a compound page. This is done by masking the two bits
describing the state of a compound page and then comparing them. So one
comparision and a branch instead of two bit checks and two branches.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent d85f338 commit 6d77795
3 files changed
+32
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 272 | + | |
280 | 273 | | |
281 | 274 | | |
282 | 275 | | |
| |||
327 | 320 | | |
328 | 321 | | |
329 | 322 | | |
330 | | - | |
| 323 | + | |
331 | 324 | | |
332 | 325 | | |
333 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
| |||
248 | 243 | | |
249 | 244 | | |
250 | 245 | | |
251 | | - | |
252 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
253 | 251 | | |
254 | | - | |
255 | | - | |
256 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
257 | 272 | | |
258 | 273 | | |
259 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
244 | 243 | | |
245 | 244 | | |
246 | 245 | | |
| |||
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
256 | | - | |
| 255 | + | |
257 | 256 | | |
258 | | - | |
| 257 | + | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
| 261 | + | |
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
266 | | - | |
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
| |||
0 commit comments