From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: "Srivastava, Rahul" <rahul.srivastava@hp.com>
Cc: 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: Mon, 8 Aug 2005 23:55:09 -0300 [thread overview]
Message-ID: <20050809025509.GO9569@dmt.cnet> (raw)
In-Reply-To: <717252EC3E37AE4392E2614EA24E9F2B0D7D0736@txnexc01.americas.cpqcorp.net>
On Mon, Aug 08, 2005 at 11:45:28AM -0500, Srivastava, Rahul wrote:
> Hi All,
>
> I was just wondering if any of you guys had a chance to validate the
> hypothesis and the proposed fix.
>
> Thanks,
> Rahul
>
>
> -----Original Message-----
> From: Srivastava, Rahul
> Sent: Tuesday, August 02, 2005 8:32 AM
> To: 'Marcelo Tosatti'; 'Ernie Petrides'; 'Larry Woodman'
> Subject: RE: oops in 2.4.25 prune_icache() called from kswapd
>
>
> Hi,
>
> Thanks for reviewing the mail. I was thinking whether below changes in
> clear_inode() will close the race window:
>
> in clear_inode(), change line:
>
> inode->i_state = I_CLEAR;
>
> with below piece of code:
>
> *****
> spin_lock(&inode_lock);
> while (inode->i_state & I_LOCK) {
> spin_unlock(&inode_lock);
> __wait_on_inode(inode);
> spin_lock(&inode_lock);
> }
> inode->i_state = I_CLEAR;
> spin_unlock(&inode_lock);
> *****
>
> I feel the race is between "__sync_one()" and "iput()/clear_inode()"
> (also suggested by Albert) which is as follows:
>
> **************** race
> condition*******************************************
>
>
> 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()
>
> |
> 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. */
> |
>
> |
>
> | engine 1:
>
>
> | Sets I_LOCK.
>
> |
> engine 0:
> |
> sets i_state = I_CLEAR
> |
> iput() calls destroy_inode()
> |
> kmem_cache_free() returns the inode to free list of inode cache.
> |
>
> |
>
> | engine 1:
>
> | Goes ahead and inserts the freed inode into one of the three possible
> lists.
As stated in private, Larry's fix should catch that in __refile_inode() and
ignore the I_CLEAR inode.
> And we endup in having a corrupted inode on the inode list.
>
> Your thoughts please.
next prev parent reply other threads:[~2005-08-09 3:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-08 16:45 FW: oops in 2.4.25 prune_icache() called from kswapd Srivastava, Rahul
2005-08-09 2:55 ` Marcelo Tosatti [this message]
[not found] <717252EC3E37AE4392E2614EA24E9F2B0D7D0733@txnexc01.americas.cpqcorp.net>
2005-08-08 20:19 ` Ernie Petrides
-- strict thread matches above, loose matches on Subject: below --
2005-08-08 21:03 Srivastava, Rahul
2005-08-09 0:33 ` Marcelo Tosatti
2005-08-09 17:00 Srivastava, Rahul
2005-08-10 21:56 ` Marcelo Tosatti
2005-08-10 22:59 Srivastava, Rahul
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=20050809025509.GO9569@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).