+28
−24
Loading
mainline inclusion from mainline-v6.11-rc1 commit 15c0536fb57fd989e24335020a443486bac01dac category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/IAJ5MT Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=15c0536fb57fd989e24335020a443486bac01dac -------------------------------- A lot of intricacies go into updating the stats when adding or removing mappings: which stat index to use and which function. Abstract this away into a new static helper in rmap.c, __folio_mod_stat(). This adds an unnecessary call to folio_test_anon() in __folio_add_anon_rmap() and __folio_add_file_rmap(). However, the folio struct should already be in the cache at this point, so it shouldn't cause any noticeable overhead. No functional change intended. [hughd@google.com: fix /proc/meminfo] Link: https://lkml.kernel.org/r/49914517-dfc7-e784-fde0-0e08fafbecc2@google.com Link: https://lkml.kernel.org/r/20240506211333.346605-1-yosryahmed@google.com Signed-off-by:Yosry Ahmed <yosryahmed@google.com> Signed-off-by:
Hugh Dickins <hughd@google.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Conflicts: mm/rmap.c [ Conflicts due to miss commit 4f687281012e which is bugfix for another feature ] Signed-off-by:
Liu Shixin <liushixin2@huawei.com>