linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	hannes@cmpxchg.org, david@redhat.com, vbabka@suse.cz,
	willy@infradead.org, akpm@linux-foundation.org,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH] mm/page-flags: Check enforce parameter in PF_ONLY_HEAD()
Date: Wed, 27 Mar 2019 14:15:06 +0100	[thread overview]
Message-ID: <20190327131506.GI11927@dhcp22.suse.cz> (raw)
In-Reply-To: <1553689672-28343-1-git-send-email-anshuman.khandual@arm.com>

[Cc Nick]

On Wed 27-03-19 17:57:52, Anshuman Khandual wrote:
> Just check for enforce parameter in PF_ONLY_HEAD() wrapper before calling
> VM_BUG_ON_PGFLAGS() for tail pages.

Why is this an actual fix? Only TESTPAGEFLAG doesn't enforce the check
but I suspect that Nick just wanted the check to be _always_ performed
as the name suggests. What kind of problem are you trying to solve?

> Fixes: 62906027091f ("mm: add PageWaiters indicating tasks are waiting for a page bit")
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
>  include/linux/page-flags.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index 9f8712a4b1a5..82539e287bc6 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -229,7 +229,7 @@ static inline void page_init_poison(struct page *page, size_t size)
>  #define PF_ANY(page, enforce)	PF_POISONED_CHECK(page)
>  #define PF_HEAD(page, enforce)	PF_POISONED_CHECK(compound_head(page))
>  #define PF_ONLY_HEAD(page, enforce) ({					\
> -		VM_BUG_ON_PGFLAGS(PageTail(page), page);		\
> +		VM_BUG_ON_PGFLAGS(enforce && PageTail(page), page);	\
>  		PF_POISONED_CHECK(page); })
>  #define PF_NO_TAIL(page, enforce) ({					\
>  		VM_BUG_ON_PGFLAGS(enforce && PageTail(page), page);	\
> -- 
> 2.20.1
> 

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2019-03-27 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 12:27 [PATCH] mm/page-flags: Check enforce parameter in PF_ONLY_HEAD() Anshuman Khandual
2019-03-27 13:15 ` Michal Hocko [this message]
2019-03-27 13:59   ` Anshuman Khandual

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=20190327131506.GI11927@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=vbabka@suse.cz \
    --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).