linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	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: Sun, 15 Mar 2020 01:23:59 +0000	[thread overview]
Message-ID: <20200315012359.uebl54wauvcpd5j4@master> (raw)
In-Reply-To: <20200315002101.GT22433@bombadil.infradead.org>

On Sat, Mar 14, 2020 at 05:21:01PM -0700, Matthew Wilcox wrote:
>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.

Ok, I didn't think about the optimisation.

Will use hpage_nr_pages() in v2.

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

-- 
Wei Yang
Help you, Help me

      reply	other threads:[~2020-03-15  1:29 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
2020-03-15  1:23   ` Wei Yang [this message]

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=20200315012359.uebl54wauvcpd5j4@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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).