From: Matthew Wilcox <willy@infradead.org>
To: Yang Shi <yang.shi@linux.alibaba.com>
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:24:20 -0700 [thread overview]
Message-ID: <20191023172420.GB2963@bombadil.infradead.org> (raw)
In-Reply-To: <1571850304-82802-1-git-send-email-yang.shi@linux.alibaba.com>
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:
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
*/
next prev parent reply other threads:[~2019-10-23 17:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 17:05 [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap Yang Shi
2019-10-23 17:24 ` Matthew Wilcox [this message]
2019-10-23 17:57 ` Yang Shi
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=20191023172420.GB2963@bombadil.infradead.org \
--to=willy@infradead.org \
--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=yang.shi@linux.alibaba.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).