linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache
Date: Sat, 14 Mar 2020 17:21:01 -0700	[thread overview]
Message-ID: <20200315002101.GT22433@bombadil.infradead.org> (raw)
In-Reply-To: <20200314215912.1554-1-richard.weiyang@gmail.com>

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

  reply	other threads:[~2020-03-15  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-14 21:59 [PATCH] mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache Wei Yang
2020-03-15  0:21 ` Matthew Wilcox [this message]
2020-03-15  1:23   ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200315002101.GT22433@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=richard.weiyang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).