public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Andrew Morton <akpm@zip.com.au>
Cc: Hugh Dickins <hugh@veritas.com>,
	Rik van Riel <riel@conectiva.com.br>,
	"David S. Miller" <davem@redhat.com>,
	bcrl@redhat.com, Hugh Dickins <hugh@lrel.veritas.com>,
	marcelo@conectiva.com.br, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] __free_pages_ok oops
Date: Thu, 7 Feb 2002 23:18:38 +0100	[thread overview]
Message-ID: <20020207231837.S1743@athlon.random> (raw)
In-Reply-To: <Pine.LNX.4.33L.0202071120160.17850-100000@imladris.surriel.com> <Pine.LNX.4.21.0202071355450.1149-100000@localhost.localdomain>, <Pine.LNX.4.21.0202071355450.1149-100000@localhost.localdomain> <20020207215854.P1743@athlon.random> <3C62ED05.F4683103@zip.com.au>
In-Reply-To: <3C62ED05.F4683103@zip.com.au>

On Thu, Feb 07, 2002 at 01:09:25PM -0800, Andrew Morton wrote:
> Andrea Arcangeli wrote:
> > 
> > On Thu, Feb 07, 2002 at 02:28:44PM +0000, Hugh Dickins wrote:
> > > On Thu, 7 Feb 2002, Rik van Riel wrote:
> > > > On Thu, 7 Feb 2002, Hugh Dickins wrote:
> > > > >
> > > > > If this were a common case where many pages end up, yes, we'd
> > > > > need a separate special list; but it's a very rare case
> > > >
> > > > Think of a web or ftp server doing nothing but sendfile()
> > >
> > > Aren't the sendfile() pages in the page cache, and normally taken
> > > off LRU at the same time as removed from page cache, in shrink_cache?
> > > The exception being when the file is truncated while it is being sent,
> > > and buffers busy, so left behind on LRU by truncate_complete_page?
> > 
> > the buffers will hold a reference on the page. So the pagecache is
> > either in the LRU with refcount > 1, or the refcount is 1 and the page
> > is not in the lru.
> > 
> > In short Ben's patch was useless but it was faster and cleaner than what
> > we had before with the special page_cache_release, and so it was good.
> > 
> > Said it in another manner: we'll never effectively free a page that is
> > in the LRU, unless it's an anonymous page (no brainer for
> > sendpage/sendfile).
> 
> Good to hear.  But what about the weird corner-case in truncate_complete_page(),
> where a mapped page is not successfully released, and is converted into
> an anon buffercache page?  It seems that a combination of sendfile
> and truncate could result in one of those pages being subject to
> final release in BH context?

Such a page is not in the lru so it doesn't matter.

As said in the previous email, from another point of view, the only
thing that can be still in the lru during __free_pages_ok is an
anonymous page. truncate_complete_page cannot run on an anonymous page.
Anonymous pages cannot be truncated.

> 
> 1: try_to_release_page() fails.  It becomes a buffercache page.
> 2: vm runs try_to_release_page() again.  This time it succeeds.
> 3: sendfile completes.
> 
> 
> > Hugh's patch is definitely valid and it's a nice bugcheck to have, it
> > should be merged IMHO (it's in a slow path), but there's no bug to fix I
> > think, the bugcheck is paranoid-in-slow-path kind of thing.
> 
> It's looking more and more like we need that test.

needed is the wrong word, but we do want it for long term paranoid
safety (actually it is a more interesting for 2.5 infact).

Andrea

  reply	other threads:[~2002-02-07 22:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-06 19:06 [PATCH] __free_pages_ok oops Hugh Dickins
2002-02-06 19:47 ` Andrew Morton
2002-02-06 20:15   ` Hugh Dickins
2002-02-06 21:11     ` Andrew Morton
2002-02-07 20:31       ` Manfred Spraul
2002-02-07  5:09 ` Benjamin LaHaise
2002-02-07  5:47   ` Andrew Morton
2002-02-07  5:55     ` David S. Miller
2002-02-07  6:19       ` Andrew Morton
2002-02-07  6:49         ` David S. Miller
2002-02-07  7:07           ` Andrew Morton
2002-02-07 11:52             ` Hugh Dickins
2002-02-07 12:34             ` Rik van Riel
2002-02-07 12:37               ` David S. Miller
2002-02-07 12:44                 ` Rik van Riel
2002-02-07 13:19                   ` Hugh Dickins
2002-02-07 13:27                     ` Rik van Riel
2002-02-07 13:55                       ` Daniel Phillips
2002-02-07 14:28                       ` Hugh Dickins
2002-02-07 14:56                         ` Rik van Riel
2002-02-07 20:21                           ` Hugh Dickins
2002-02-07 20:58                         ` Andrea Arcangeli
2002-02-07 21:09                           ` Andrew Morton
2002-02-07 22:18                             ` Andrea Arcangeli [this message]
2002-02-07 22:31                               ` Andrew Morton
2002-02-07 23:09                                 ` Andrea Arcangeli
2002-02-07 23:27                                   ` Andrew Morton
2002-02-08 17:46                                     ` Hugh Dickins
2002-02-09 14:14                                       ` Gerd Knorr
2002-02-09 15:47                                         ` arjan
2002-02-09 14:33                                       ` Benjamin LaHaise
2002-02-12 20:19                                         ` Hugh Dickins
2002-02-13 18:52                                           ` Marcelo Tosatti
2002-02-14 10:47                                             ` Hugh Dickins
2002-02-14 11:10                                               ` Gerd Knorr
2002-02-14 13:10                                                 ` Andrea Arcangeli
2002-02-14 14:01                                                   ` Hugh Dickins
2002-02-14 15:17                                                     ` Andrea Arcangeli
2002-02-14 16:27                                                   ` Linus Torvalds
2002-02-25 18:32                                                     ` Benjamin LaHaise
2002-02-25 19:35                                                       ` Linus Torvalds
2002-02-07  9:48         ` Benjamin LaHaise
  -- strict thread matches above, loose matches on Subject: below --
2002-02-09  8:52 alad
2002-02-09 10:46 ` Hugh Dickins

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=20020207231837.S1743@athlon.random \
    --to=andrea@suse.de \
    --cc=akpm@zip.com.au \
    --cc=bcrl@redhat.com \
    --cc=davem@redhat.com \
    --cc=hugh@lrel.veritas.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=riel@conectiva.com.br \
    /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