linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: hughd@google.com, aarcange@redhat.com,
	kirill.shutemov@linux.intel.com, gavin.dg@linux.alibaba.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap
Date: Wed, 23 Oct 2019 10:57:44 -0700	[thread overview]
Message-ID: <792ea136-4fa0-c87b-9399-5ca47c501c9c@linux.alibaba.com> (raw)
In-Reply-To: <20191023172420.GB2963@bombadil.infradead.org>



On 10/23/19 10:24 AM, Matthew Wilcox wrote:
> On Thu, Oct 24, 2019 at 01:05:04AM +0800, Yang Shi wrote:
>> +	return map_count >= 0 &&
>> +	       map_count == atomic_read(&head[1].compound_mapcount);
>>   }
> I didn't like Hugh's duplicate definition either.  May I suggest:

Thanks, Willy. It is fine to me. Will take it in v3.

>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 2f2199a51941..3d0efd937d2b 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -695,11 +695,6 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
>   
>   extern void kvfree(const void *addr);
>   
> -static inline atomic_t *compound_mapcount_ptr(struct page *page)
> -{
> -	return &page[1].compound_mapcount;
> -}
> -
>   static inline int compound_mapcount(struct page *page)
>   {
>   	VM_BUG_ON_PAGE(!PageCompound(page), page);
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 2222fa795284..270aa8fd2800 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -221,6 +221,11 @@ struct page {
>   #endif
>   } _struct_page_alignment;
>   
> +static inline atomic_t *compound_mapcount_ptr(struct page *page)
> +{
> +	return &page[1].compound_mapcount;
> +}
> +
>   /*
>    * Used for sizing the vmemmap region on some architectures
>    */



  reply	other threads:[~2019-10-23 17:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 17:05 Yang Shi
2019-10-23 17:24 ` Matthew Wilcox
2019-10-23 17:57   ` Yang Shi [this message]
2019-10-23 18:57     ` Hugh Dickins
2019-10-23 19:28 ` Hugh Dickins
2019-10-23 19:37   ` Yang Shi
2019-10-23 20:00     ` Hugh Dickins
2019-10-23 20:50       ` Yang Shi

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=792ea136-4fa0-c87b-9399-5ca47c501c9c@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gavin.dg@linux.alibaba.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.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