diff options
author | David Hildenbrand <david@redhat.com> | 2024-04-09 22:22:49 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-05-06 03:53:29 +0300 |
commit | 4103b93b07bceac30bc83cbce81693bb2ea93c22 (patch) | |
tree | 7313a5a2122a91816791e23788a906a088831164 /mm/memory.c | |
parent | eefb9b2725e395d58119a92eb8eaea8f2504b5eb (diff) | |
download | linux-4103b93b07bceac30bc83cbce81693bb2ea93c22.tar.xz |
mm: make folio_mapcount() return 0 for small typed folios
We already handle it properly for large folios. Let's also return "0" for
small typed folios, like page_mapcount() currently would.
Consequently, folio_mapcount() will never return negative values for typed
folios, but may return negative values for underflows.
[david@redhat.com: make folio_mapcount() slightly more efficient]
Link: https://lkml.kernel.org/r/c30fcda1-ed87-46f5-8297-cdedbddac009@redhat.com
Link: https://lkml.kernel.org/r/20240409192301.907377-7-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Hugh Dickins <hughd@google.com>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Richard Chang <richardycc@google.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Yin Fengwei <fengwei.yin@intel.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
0 files changed, 0 insertions, 0 deletions