linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: trond.myklebust@fys.uio.no, Andrew Morton <akpm@digeo.com>,
	Linus Torvalds <torvalds@transmeta.com>
Cc: Rik van Riel <riel@conectiva.com.br>,
	Urban Widmark <urban@teststation.com>,
	Chuck Lever <cel@citi.umich.edu>,
	trond.myklebust@fys.uio.no,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: invalidate_inode_pages in 2.5.32/3
Date: Mon, 23 Sep 2002 21:13:26 +0200	[thread overview]
Message-ID: <E17tYe7-0003b4-00@starship> (raw)
In-Reply-To: <15759.17258.990642.379366@charged.uio.no>

On Monday 23 September 2002 18:38, Trond Myklebust wrote:
> >>>>> " " == Andrew Morton <akpm@digeo.com> writes:
> 
>      > Look, idunnoigiveup.  Like scsi and USB, NFS is a black hole
>      > where akpms fear to tread.  I think I'll sulk until someone
>      > explains why this work has to be performed in the context of a
>      > process which cannot do it.
> 
> I'd be happy to move that work out of the RPC callbacks if you could
> point out which other processes actually can do it.
> 
> The main problem is that the VFS/MM has no way of relabelling pages as
> being invalid or no longer up to date: I once proposed simply clearing
> PG_uptodate on those pages which cannot be cleared by
> invalidate_inode_pages(), but this was not to Linus' taste.

I'll take a run at analyzing this.

First, it's clear why can't just set the page !uptodate: if we fail to
lock the page we can't change the state of the uptodate bit because we
would violate the locking rules, iow, we would race with the vfs (see
block_read/write_full_page).

Note that even if succeed in the TryLock and set !uptodate, we still
have to walk the rmap list and unmap the page or it won't get refaulted
and the uptodate bit will be ignored.

For any page we can't lock without blocking, the cases are:

 1) Dirty: we don't need to invalidate it because it's going to get
    written back to the server anyway

 2) Locked, clean: the page could be locked for any number of reasons.
    Probably, it's locked for reading though.  We *obviously* need to
    kill this page at some point or we have a nasty heisenbug.  E.g., 
    somebody, somewhere, will get a file handed back to them from some 
    other client that rewrote the whole thing, complete and correct
    except for a stale page or two.

For pages that we can lock, we have:

 3) Elevated count, clean: we could arguably ignore the use count
    and just yank the page out of the inode list, as Andrew's patch
    does.  Getting it out of the mapping is harder, perhaps much
    harder.

 4) Clean, has buffers, can't get rid of the buffers: we can't know
    why.  HTree puts pages in this state for directory access, Ext3
    probably does it for a variety of reasons.  Same situation as
    above.

Given the obviously broken case (2) above and the two probably broken
case (3) and (4), I don't see any way to ignore this problem and still
implement the NFS semantics Chuck described earlier.

I see Rik's suggestion of marking the problem pages invalid, and walking
the ptes to protect them as the cleanest fix.  Unlike invalidate_inode_pages,
the fault path can block perfectly happily while the problem conditions
sort themselves out.

-- 
Daniel

  parent reply	other threads:[~2002-09-23 19:20 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-05 14:25 invalidate_inode_pages in 2.5.32/3 Chuck Lever
2002-09-05 18:27 ` Andrew Morton
2002-09-05 18:53   ` Chuck Lever
2002-09-05 19:17     ` Andrew Morton
2002-09-05 20:00       ` Trond Myklebust
2002-09-05 20:15         ` Andrew Morton
2002-09-05 20:27           ` Trond Myklebust
2002-09-05 20:37             ` Andrew Morton
2002-09-05 20:51               ` Trond Myklebust
2002-09-05 21:12                 ` Andrew Morton
2002-09-05 21:31                   ` Trond Myklebust
2002-09-05 22:19                     ` Andrew Morton
2002-09-06  0:48                       ` Trond Myklebust
2002-09-06  1:08                         ` Andrew Morton
2002-09-06  6:49                           ` Trond Myklebust
2002-09-07  8:37                           ` Daniel Phillips
2002-09-07 16:09                             ` Andrew Morton
2002-09-07 17:02                               ` Andrew Morton
2002-09-07  8:24                       ` Daniel Phillips
2002-09-07 16:06                         ` Andrew Morton
2002-09-09 21:08                           ` Daniel Phillips
2002-09-09 21:36                             ` Andrew Morton
2002-09-09 22:12                               ` Daniel Phillips
2002-09-07 18:47                         ` Rik van Riel
2002-09-07 23:09                           ` Andrew Morton
2002-09-09 21:44                             ` Daniel Phillips
2002-09-09 22:03                               ` Andrew Morton
2002-09-09 22:19                                 ` Daniel Phillips
2002-09-09 22:32                                   ` Andrew Morton
2002-09-10 16:57                                     ` Daniel Phillips
2002-09-09 23:51                                   ` Chuck Lever
2002-09-10  1:07                                     ` Daniel Phillips
2002-09-10 15:09                                       ` Chuck Lever
2002-09-10 16:13                                         ` Daniel Phillips
2002-09-10 19:04                                           ` Chuck Lever
2002-09-10 20:52                                             ` Daniel Phillips
2002-09-11  0:07                                               ` Andrew Morton
2002-09-11  0:27                                                 ` Daniel Phillips
2002-09-11  0:38                                                   ` Andrew Morton
2002-09-11  0:53                                                     ` Daniel Phillips
2002-09-11  1:49                                                       ` Andrew Morton
2002-09-11  2:14                                                         ` Daniel Phillips
2002-09-11 16:18                                                 ` Rik van Riel
2002-09-11 17:14                                                   ` Daniel Phillips
2002-09-12 19:06                                             ` Daniel Phillips
2002-09-12 22:05                                         ` Urban Widmark
2002-09-12 22:21                                           ` Andrew Morton
2002-09-12 22:30                                             ` Rik van Riel
2002-09-12 22:43                                               ` Daniel Phillips
2002-09-12 22:51                                               ` Andrew Morton
2002-09-12 23:05                                                 ` Randy.Dunlap
2002-09-12 23:23                                                 ` Rik van Riel
2002-09-12 23:53                                                   ` Daniel Phillips
2002-09-23 16:38                                                 ` Trond Myklebust
2002-09-23 17:16                                                   ` Daniel Phillips
2002-09-23 18:57                                                   ` Andrew Morton
2002-09-23 20:41                                                     ` Trond Myklebust
2002-09-23 20:49                                                       ` Daniel Phillips
2002-09-23 22:43                                                         ` Trond Myklebust
2002-09-24  5:09                                                           ` Daniel Phillips
2002-09-24 16:40                                                             ` Trond Myklebust
2002-09-23 19:13                                                   ` Daniel Phillips [this message]
2002-09-13  4:19                                               ` Daniel Phillips
2002-09-13  4:52                                               ` Daniel Phillips
2002-09-14  9:58                                             ` Urban Widmark
2002-09-12 13:04                                     ` Trond Myklebust
2002-09-12 18:21                                       ` Andrew Morton
2002-09-12 21:15                                         ` Daniel Phillips
2002-09-12 21:38                                           ` Andrew Morton
2002-09-12 21:52                                             ` Daniel Phillips
2002-09-05 22:01                   ` Chuck Lever
2002-09-05 22:23                     ` Andrew Morton
2002-09-05 21:41           ` Chuck Lever
2002-09-06  9:35     ` Helge Hafting
2002-09-06 16:16       ` Chuck Lever
2002-09-07  8:01   ` Daniel Phillips
2002-09-07 10:01     ` Daniel Phillips

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=E17tYe7-0003b4-00@starship \
    --to=phillips@arcor.de \
    --cc=akpm@digeo.com \
    --cc=cel@citi.umich.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    --cc=trond.myklebust@fys.uio.no \
    --cc=urban@teststation.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).