From: Andrew Morton <akpm@zip.com.au>
To: trond.myklebust@fys.uio.no
Cc: Chuck Lever <cel@citi.umich.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: invalidate_inode_pages in 2.5.32/3
Date: Thu, 05 Sep 2002 14:12:23 -0700 [thread overview]
Message-ID: <3D77C8B7.1534A2DB@zip.com.au> (raw)
In-Reply-To: 15735.50124.304510.10612@charged.uio.no
Trond Myklebust wrote:
>
> >>>>> " " == Andrew Morton <akpm@zip.com.au> writes:
>
> > Probably, it worked OK with the global locking because nobody
> > was taking a temp ref against those pages.
>
> But we still have global locking in that readdir by means of the
> BKL. There should be no nasty races...
>
> > Please tell me exactly what semantics NFS needs in there. Does
> > truncate_inode_pages() do the wrong thing?
>
> Definitely. In most cases we *cannot* wait on I/O completion because
> nfs_zap_caches() can be called directly from the 'rpciod' process by
> means of a callback. Since 'rpciod' is responsible for completing all
> asynchronous I/O, then truncate_inode_pages() would deadlock.
But if there are such pages, invalidate_inode_pages() would not
have removed them anyway?
> As I said: I don't believe the problem here has anything to do with
> invalidate_inode_pages vs. truncate_inode_pages:
> - Pages should only be locked if they are actually being read from
> the server.
> - They should only be refcounted and/or cleared while the BKL is
> held...
> There is no reason why code which worked fine under 2.2.x and 2.4.x
> shouldn't work under 2.5.x.
Trond, there are very good reasons why it broke. Those pages are
visible to the whole world via global data structures - both the
page LRUs and via the superblocks->inodes walk. Those things exist
for legitimate purposes, and it is legitimate for async threads
of control to take a reference on those pages while playing with them.
It just "happened to work" in earlier kernels.
I suspect we can just remove the page_count() test from invalidate
and that will fix everything up. That will give stronger invalidate
and anything which doesn't like that is probably buggy wrt truncate anyway.
Could you test that?
next prev parent reply other threads:[~2002-09-05 21:09 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 [this message]
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
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=3D77C8B7.1534A2DB@zip.com.au \
--to=akpm@zip.com.au \
--cc=cel@citi.umich.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/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