Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587091

Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list
Date 2017-02-23 20:00 +0100
Message-ID <te6Mq-58d-21@gated-at.bofh.it> (permalink)
References <tdKiR-62X-7@gated-at.bofh.it> <tdKiS-62X-29@gated-at.bofh.it> <te47U-3xP-15@gated-at.bofh.it> <te6Mq-58d-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Feb 23, 2017 at 08:26:03AM -0800, Shaohua Li wrote:
> On Thu, Feb 23, 2017 at 10:58:27AM -0500, Johannes Weiner wrote:
> > Hi Shaohua,
> > 
> > On Wed, Feb 22, 2017 at 10:50:41AM -0800, Shaohua Li wrote:
> > > @@ -268,6 +268,12 @@ static void __activate_page(struct page *page, struct lruvec *lruvec,
> > >  		int lru = page_lru_base_type(page);
> > >  
> > >  		del_page_from_lru_list(page, lruvec, lru);
> > > +		if (PageAnon(page) && !PageSwapBacked(page)) {
> > > +			SetPageSwapBacked(page);
> > > +			/* charge to anon scanned/rotated reclaim_stat */
> > > +			file = 0;
> > > +			lru = LRU_INACTIVE_ANON;
> > > +		}
> > 
> > As per my previous feedback, please remove this. Write-after-free will
> > be caught and handled in the reclaimer, read-after-free is a bug that
> > really doesn't require optimizing page aging for. And we definitely
> > shouldn't declare invalid data suddenly valid because it's being read.
> 
> GUP could run into this. Don't we move the page because it's hot? I think it's
> not just about page aging. If we leave the page there, page reclaim will just
> waste time to reclaim the pages which should't be reclaimed.

There is just no convincing justification to add this code, because it
optimizes something that doesn't have a real world application. If we
just delete this branch, for all intents and purposes the outcome will
be perfectly acceptable.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V4 0/6] mm: fix some MADV_FREE issues Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
    Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 17:10 +0100
      Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 20:00 +0100
    Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Minchan Kim <minchan@kernel.org> - 2017-02-24 03:00 +0100
      Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Minchan Kim <minchan@kernel.org> - 2017-02-25 00:40 +0100
  [PATCH V4 5/6] mm: enable MADV_FREE for swapless system Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 2/6] mm: don't assume anonymous pages have SwapBacked flag Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 4/6] mm: reclaim MADV_FREE pages Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
    Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 17:20 +0100
    Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Minchan Kim <minchan@kernel.org> - 2017-02-24 03:20 +0100
      Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Johannes Weiner <hannes@cmpxchg.org> - 2017-02-24 16:50 +0100
        Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Minchan Kim <minchan@kernel.org> - 2017-02-25 00:30 +0100

csiph-web