linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Dave Hansen <dave.hansen@intel.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH 2/2 mmotm] mm/page-writeback: check-before-clear PageReclaim
Date: Mon, 6 Apr 2015 15:04:09 +0300	[thread overview]
Message-ID: <20150406120409.GB8375@node.dhcp.inet.fi> (raw)
In-Reply-To: <20150406081325.GB7373@hori1.linux.bs1.fc.nec.co.jp>

On Mon, Apr 06, 2015 at 08:13:25AM +0000, Naoya Horiguchi wrote:
> With page flag sanitization patchset, an invalid usage of ClearPageReclaim()
> is detected in set_page_dirty().
> This can be called from __unmap_hugepage_range(), so let's check PageReclaim
> flag before trying to clear it to avoid the misuse.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

> ---
>  mm/page-writeback.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 22f3714d35e6..38aa0d8f19d3 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -2225,7 +2225,8 @@ int set_page_dirty(struct page *page)
>  		 * it will confuse readahead and make it restart the size rampup
>  		 * process. But it's a trivial problem.
>  		 */
> -		ClearPageReclaim(page);
> +		if (PageReclaim(page))
> +			ClearPageReclaim(page);
>  #ifdef CONFIG_BLOCK
>  		if (!spd)
>  			spd = __set_page_dirty_buffers;
> -- 
> 2.1.0

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-04-06 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06  6:20 kernel BUG at include/linux/page-flags.h:333! from migrate_page_copy(), ... 317! from set_page_dirty() Naoya Horiguchi
2015-04-06  7:25 ` Kirill A. Shutemov
2015-04-06  7:46   ` Naoya Horiguchi
2015-04-06  8:13     ` [PATCH 1/2 mmotm] mm/migrate: check-before-clear PageSwapCache Naoya Horiguchi
2015-04-06 12:03       ` Kirill A. Shutemov
2015-04-06  8:13     ` [PATCH 2/2 mmotm] mm/page-writeback: check-before-clear PageReclaim Naoya Horiguchi
2015-04-06 12:04       ` Kirill A. Shutemov [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=20150406120409.GB8375@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave.hansen@intel.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.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).