Files
ack-tegra/include/linux
Matthew Wilcox (Oracle) 4ffca5a966 mm: support only one page_type per page
By using a few values in the top byte, users of page_type can store up to
24 bits of additional data in page_type.  It also reduces the code size as
(with replacement of READ_ONCE() with data_race()), the kernel can check
just a single byte.  eg:

ffffffff811e3a79:       8b 47 30                mov    0x30(%rdi),%eax
ffffffff811e3a7c:       55                      push   %rbp
ffffffff811e3a7d:       48 89 e5                mov    %rsp,%rbp
ffffffff811e3a80:       25 00 00 00 82          and    $0x82000000,%eax
ffffffff811e3a85:       3d 00 00 00 80          cmp    $0x80000000,%eax
ffffffff811e3a8a:       74 4d                   je     ffffffff811e3ad9 <folio_mapping+0x69>

becomes:

ffffffff811e3a69:       80 7f 33 f5             cmpb   $0xf5,0x33(%rdi)
ffffffff811e3a6d:       55                      push   %rbp
ffffffff811e3a6e:       48 89 e5                mov    %rsp,%rbp
ffffffff811e3a71:       74 4d                   je     ffffffff811e3ac0 <folio_mapping+0x60>

replacing three instructions with one.

[wangkefeng.wang@huawei.com: fix ubsan warnings]
  Link: https://lkml.kernel.org/r/2d19c48a-c550-4345-bf36-d05cd303c5de@huawei.com
Link: https://lkml.kernel.org/r/20240821173914.2270383-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-03 21:15:43 -07:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-09-01 20:25:49 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-03 19:29:59 -07:00
…
…
2024-07-08 01:51:05 -06:00
…
…
…
…
…
…
…
…
2024-09-03 21:15:36 -07:00
…
…
…
2024-06-24 18:29:20 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-06-11 12:57:49 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-08-12 22:03:27 +02:00
…
…
…
…
…
…
…
…
…
2024-09-03 21:15:40 -07:00
…
…
…
…
…
…
…
…
…
…
2024-09-03 21:15:36 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-09-01 20:26:10 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-06-24 22:24:56 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-09-01 20:26:03 -07:00
…
…
…
…
2024-07-03 19:30:23 -07:00
…
…
…
…
…
2024-06-05 19:19:26 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-10 12:14:54 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-31 09:57:18 -07:00
…
…
…
2024-09-03 21:15:42 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-08 13:47:27 -04:00
…
…
…
…
…
…
2024-06-24 22:25:02 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-06-28 09:52:05 +02:00
…
…
…
…
2024-09-01 20:26:04 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-10 17:52:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-02 18:59:33 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-07-10 07:59:03 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-09-01 20:25:43 -07:00
…
…
…
…
…
…
…
2024-06-24 18:16:44 +01:00
…
…
…
…
…
…
…
…
…
…
…