All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages
Date: Fri, 20 Mar 2015 10:04:16 +0200	[thread overview]
Message-ID: <20150320080416.GA15877@node.dhcp.inet.fi> (raw)
In-Reply-To: <010601d062df$f7b5a4d0$e720ee70$@alibaba-inc.com>

On Fri, Mar 20, 2015 at 03:32:05PM +0800, Hillf Danton wrote:
> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -269,7 +269,7 @@ static inline struct page *compound_head_fast(struct page *page)
> >  	return page;
> >  }
> > 
> > -TESTPAGEFLAG(Locked, locked, ANY)
> > +__PAGEFLAG(Locked, locked, NO_TAIL)
> >  PAGEFLAG(Error, error, ANY) TESTCLEARFLAG(Error, error, ANY)
> >  PAGEFLAG(Referenced, referenced, ANY) TESTCLEARFLAG(Referenced, referenced, ANY)
> >  	__SETPAGEFLAG(Referenced, referenced, ANY)
> [...]
> > @@ -490,9 +481,9 @@ extern int wait_on_page_bit_killable_timeout(struct page *page,
> > 
> >  static inline int wait_on_page_locked_killable(struct page *page)
> >  {
> > -	if (PageLocked(page))
> > -		return wait_on_page_bit_killable(page, PG_locked);
> > -	return 0;
> > +	if (!PageLocked(page))
> > +		return 0;
> 
> I am lost here: can we feed any page to NO_TAIL operation?

NO_TAIL triggers VM_BUG on set/clear, but not on checks. PageLocked() will
look on head page.

I tried to enforce policy for checks too, but it triggers all over the
kernel. We tend to check random pages.

We can try apply enforcing for *some* flags, but I didn't evaluate that.

-- 
 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>

WARNING: multiple messages have this Message-ID (diff)
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages
Date: Fri, 20 Mar 2015 10:04:16 +0200	[thread overview]
Message-ID: <20150320080416.GA15877@node.dhcp.inet.fi> (raw)
In-Reply-To: <010601d062df$f7b5a4d0$e720ee70$@alibaba-inc.com>

On Fri, Mar 20, 2015 at 03:32:05PM +0800, Hillf Danton wrote:
> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -269,7 +269,7 @@ static inline struct page *compound_head_fast(struct page *page)
> >  	return page;
> >  }
> > 
> > -TESTPAGEFLAG(Locked, locked, ANY)
> > +__PAGEFLAG(Locked, locked, NO_TAIL)
> >  PAGEFLAG(Error, error, ANY) TESTCLEARFLAG(Error, error, ANY)
> >  PAGEFLAG(Referenced, referenced, ANY) TESTCLEARFLAG(Referenced, referenced, ANY)
> >  	__SETPAGEFLAG(Referenced, referenced, ANY)
> [...]
> > @@ -490,9 +481,9 @@ extern int wait_on_page_bit_killable_timeout(struct page *page,
> > 
> >  static inline int wait_on_page_locked_killable(struct page *page)
> >  {
> > -	if (PageLocked(page))
> > -		return wait_on_page_bit_killable(page, PG_locked);
> > -	return 0;
> > +	if (!PageLocked(page))
> > +		return 0;
> 
> I am lost here: can we feed any page to NO_TAIL operation?

NO_TAIL triggers VM_BUG on set/clear, but not on checks. PageLocked() will
look on head page.

I tried to enforce policy for checks too, but it triggers all over the
kernel. We tend to check random pages.

We can try apply enforcing for *some* flags, but I didn't evaluate that.

-- 
 Kirill A. Shutemov

  reply	other threads:[~2015-03-20  8:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <010501d062df$05125160$0f36f420$@alibaba-inc.com>
2015-03-20  7:32 ` [PATCH 04/16] page-flags: define PG_locked behavior on compound pages Hillf Danton
2015-03-20  7:32   ` Hillf Danton
2015-03-20  8:04   ` Kirill A. Shutemov [this message]
2015-03-20  8:04     ` Kirill A. Shutemov
2015-09-21 22:35 [PATCH 3/3] page-flags: rectify forward declaration Andrew Morton
2015-09-24 14:50 ` [PATCH 00/16] Refreshed page-flags patchset Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 04/16] page-flags: define PG_locked behavior on compound pages Kirill A. Shutemov
2015-09-24 14:50     ` Kirill A. Shutemov
2015-09-24 16:08     ` Christoph Lameter
2015-09-24 16:08       ` Christoph Lameter
2015-09-24 20:26       ` Kirill A. Shutemov
2015-09-24 20:26         ` Kirill A. Shutemov
  -- strict thread matches above, loose matches on Subject: below --
2015-03-19 17:08 [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages Kirill A. Shutemov
2015-03-19 17:08 ` [PATCH 04/16] page-flags: define PG_locked behavior on compound pages Kirill A. Shutemov
2015-03-19 17:08   ` Kirill A. Shutemov
2015-03-27 15:11   ` Mateusz Krawczuk
2015-03-27 15:11     ` Mateusz Krawczuk
2015-03-27 15:13   ` Mateusz Krawczuk
2015-03-27 15:13     ` Mateusz Krawczuk
2015-03-27 15:13     ` Mateusz Krawczuk
2015-03-27 16:37     ` Kirill A. Shutemov
2015-03-27 16:37       ` Kirill A. Shutemov
2015-03-27 16:37       ` Kirill A. Shutemov
2015-07-15 20:20   ` Christoph Lameter
2015-07-15 20:20     ` Christoph Lameter

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=20150320080416.GA15877@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.