linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
	Hugh Dickins <hughd@google.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>, Jason Evans <je@fb.com>
Subject: Re: [RFC 3/6] mm: support madvise(MADV_FREE)
Date: Fri, 14 Mar 2014 15:24:17 +0000	[thread overview]
Message-ID: <20140314152417.GA4008@gmail.com> (raw)
In-Reply-To: <20140314133311.GA6316@node.dhcp.inet.fi>

On Fri, Mar 14, 2014 at 03:33:11PM +0200, Kirill A. Shutemov wrote:
> On Fri, Mar 14, 2014 at 03:37:47PM +0900, Minchan Kim wrote:
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index c1b7414c7bef..9b048cabce27 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -933,10 +933,16 @@ void page_address_init(void);
> >   * Please note that, confusingly, "page_mapping" refers to the inode
> >   * address_space which maps the page from disk; whereas "page_mapped"
> >   * refers to user virtual address space into which the page is mapped.
> > + *
> > + * PAGE_MAPPING_LZFREE bit is set along with PAGE_MAPPING_ANON bit
> > + * and then page->mapping points to an anon_vma. This flag is used
> > + * for lazy freeing the page instead of swap.
> >   */
> >  #define PAGE_MAPPING_ANON	1
> >  #define PAGE_MAPPING_KSM	2
> > -#define PAGE_MAPPING_FLAGS	(PAGE_MAPPING_ANON | PAGE_MAPPING_KSM)
> > +#define PAGE_MAPPING_LZFREE	4
> > +#define PAGE_MAPPING_FLAGS	(PAGE_MAPPING_ANON | PAGE_MAPPING_KSM | \
> > +				 PAGE_MAPPING_LZFREE)
> 
> Is it safe to use third bit in pointer everywhere?

I overlooked ARCH_SLAB_MINALIGN which is 8 byte for most arch but
surely some of arch would have less than it(ex, 4 byte).

Alternative is PG_private or PG_private2. That flags is used for
file pages mostly while zsmalloc uses it but it should not LRU page.
Other thing in mm/ is memory-hotplug but I guess we don't need to set
PG_private because I couldn't find PagePrivate for that.

So, I think using that flag for anon page has no problem if we tweak
page_has_private works with only !PageAnon.

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

--
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:[~2014-03-14 15:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  6:37 [RFC 0/6] mm: support madvise(MADV_FREE) Minchan Kim
2014-03-14  6:37 ` [RFC 1/6] mm: clean up PAGE_MAPPING_FLAGS Minchan Kim
2014-03-14  6:37 ` [RFC 2/6] mm: work deactivate_page with anon pages Minchan Kim
2014-03-14  6:37 ` [RFC 3/6] mm: support madvise(MADV_FREE) Minchan Kim
2014-03-14  7:49   ` Minchan Kim
2014-03-14 13:33   ` Kirill A. Shutemov
2014-03-14 15:24     ` Minchan Kim [this message]
2014-03-18 18:26   ` Johannes Weiner
2014-03-19  1:22     ` Minchan Kim
2014-03-14  6:37 ` [RFC 4/6] mm: add stat about lazyfree pages Minchan Kim
2014-03-14  6:37 ` [RFC 5/6] mm: reclaim lazyfree pages in swapless system Minchan Kim
2014-03-14  6:37 ` [RFC 6/6] mm: ksm: don't merge lazyfree page Minchan Kim
2014-03-14  7:37 ` [RFC 0/6] mm: support madvise(MADV_FREE) Zhang Yanfei
2014-03-14  7:56   ` Minchan Kim
2014-03-18 17:55 ` Andy Lutomirski
2014-03-19  0:18   ` Minchan Kim
2014-03-19  0:23     ` Andy Lutomirski
2014-03-19  1:02       ` Minchan Kim
2014-03-19  5:15       ` Johannes Weiner

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=20140314152417.GA4008@gmail.com \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=je@fb.com \
    --cc=john.stultz@linaro.org \
    --cc=kirill@shutemov.name \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.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).