From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: "Srivastava, Rahul" <rahul.srivastava@hp.com>
Cc: Ernie Petrides <petrides@redhat.com>,
lwoodman@redhat.com, linux-fsdevel@vger.kernel.org
Subject: Re: FW: oops in 2.4.25 prune_icache() called from kswapd
Date: Wed, 10 Aug 2005 18:56:17 -0300 [thread overview]
Message-ID: <20050810215617.GA3253@dmt.cnet> (raw)
In-Reply-To: <717252EC3E37AE4392E2614EA24E9F2B0D7D0D17@txnexc01.americas.cpqcorp.net>
Hi Rahul,
My previous description was incomplete, AFAICS there's more important
thing which guarantees consistency.
On Tue, Aug 09, 2005 at 12:00:54PM -0500, Srivastava, Rahul wrote:
> Hi,
>
> Please consider following scenario (with the patch/fix from Larry):
>
> -> engine 0: calls iput() and lock inode_lock. iput removes the inode
> from the i_list and unlocks inode_lock
>
> ---> engine 1: grab inode_lock and calls __sync_one()
Inodes which reach __sync_one() have been found through any of the type
lists (dirty, in use, etc), which are walked with the inode_lock held.
iput() deletes the inode from the i_list before proceeding, so they
are unreachable via the type lists after the inode lock is released.
Go ahead and try to prove me wrong -- what you're doing is very welcome
(sincerely, I dont fully understand the inode cache).
> -> engine 0: calls clear_inode(), get past the call to "wait_on_inode()"
> which looks if I_LOCK is set.
> /* From this point onwards clear_inode() and the remainder of iput()
> does not care about I_LOCK or inode_lock. */
> Now with new changes, it will wait for inode_lock before setting the
> state to I_CLEAR. So now we are waiting for inode_lock on engine 0.
>
> ---> engine 1: Sets I_LOCK and release the inode_lock
>
>
> -> engine 0: We now get the lock and set the state to I_CLEAR, release
> the lock and free the inode (though on engine 1 we have set I_LOCK and
> are thinking that no one will destroy this inode).
>
> Though numerous kind of corruption is possible now, I am sighting one
> example here: Under low memory condition it is possible that the inode
> from inode_cachep (freed inode cache), will be returned to system memory
> (subject to all the objects in that particular slab is freed). And that
> memory chuck (which we were just now using for inode) is allocated to
> some other process. Suppose, this new process which just got this newly
> allocated chunk, goes and clears the field, which was earlier i_state,
> to NULL, or some other value (other than value which suggests I_FREEING
> or I_CLEAR is set)
>
> ---> engine 1: We get the spin lock, clears I_LOCK (even though we don't
> own this memory chunk anymore), see (As per above mentioned example
> scenario) that I_FREEING or I_CLEAR is not set and insert this freed
> inode into the list!! This way we will still end up in corrupted list
> (as per above example scenario).
>
> Please correct me if I am wrong somewhere.
next prev parent reply other threads:[~2005-08-10 22:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-09 17:00 FW: oops in 2.4.25 prune_icache() called from kswapd Srivastava, Rahul
2005-08-10 21:56 ` Marcelo Tosatti [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-08-10 22:59 Srivastava, Rahul
2005-08-08 21:03 Srivastava, Rahul
2005-08-09 0:33 ` Marcelo Tosatti
[not found] <717252EC3E37AE4392E2614EA24E9F2B0D7D0733@txnexc01.americas.cpqcorp.net>
2005-08-08 20:19 ` Ernie Petrides
2005-08-08 16:45 Srivastava, Rahul
2005-08-09 2:55 ` Marcelo Tosatti
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=20050810215617.GA3253@dmt.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lwoodman@redhat.com \
--cc=petrides@redhat.com \
--cc=rahul.srivastava@hp.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).