lkml.org 
[lkml]   [2020]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache
On Sat, Mar 14, 2020 at 09:59:12PM +0000, Wei Yang wrote:
> Function add_to_swap_cache() and delete_from_swap_cache() are counter
> parts, while currently they use different way to count page.
>
> It doesn't break any thing because we only have two size for PageAnon,
> but this is confusing and not a good practice.
>
> This patch corrects it by both using compound_nr().

You're converting in the wrong direction. hpage_nr_pages() is optimised
away when CONFIG_TRANSPARENT_HUGEPAGE is undefined, whereas compound_nr()
is not.

I also have this patch pending:
http://git.infradead.org/users/willy/linux-dax.git/commitdiff/192b635b428ae74f680574cdcc3d5e9d213fcb64

\
 
 \ /
  Last update: 2020-03-15 08:19    [W:0.078 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site