From: Daniel Forrest <forrest@lmcg.wisc.edu>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: lockd hanging
Date: Fri, 26 Apr 2002 12:25:23 -0500 (CDT) [thread overview]
Message-ID: <200204261725.MAA02024@radium.lmcg.wisc.edu> (raw)
In-Reply-To: <E17117p-0002fH-00@charged.uio.no> (message from Trond Myklebust on Fri, 26 Apr 2002 10:30:41 +0200)
Trond Myklebust <trond.myklebust@fys.uio.no> writes:
>> On Wednesday 24. April 2002 23:13, Daniel Forrest wrote:
>> > The bug I have found is in fs/lockd/svclock.c and is caused by downing
>> > an already downed semaphore:
>> >
>> > ->nlmsvc_lock calls down(&file->f_sema)
>>
>> Just exactly what is f_sema protecting? I've looked at the code,
>> and I just can't figure out why we need a semaphore there at all.
>>
>> AFAICS, all we are using them for is to protect the 2 lists
>> f_shares and f_blocks in struct nlm_file. Since we are already
>> holding the BKL, I don't see why we need an extra lock. (Yes:
>> nlmsvc_delete_block() can sleep, so we need to be careful with the
>> loop in nlmsvc_traverse_blocks(), but that is trivial to cope
>> with...)
I agree that it seems to be used to protect those two lists. I'm very
new to looking at the Linux kernel and I don't know how many threads
are running or how they preempt each other, but I think it is because
there are three paths that enter the code. One is RPC or an RPC
callback, one is a VFS callback, and one is the lockd thread itself.
Do they each hold the BKL while they are running? If there are any
on-line resources that describe this I would be quite interested in
reading them.
I'm afraid I don't follow your last comment either. Why might
nlmsvc_delete_block() sleep? (kfree()???) And how is this a problem?
>> As for calling nlmclnt_lookup_host() in nlmsvc_create_block(). Why
>> not just pass the value that we looked up in nlmsvc_proc_lock()?
I'm not sure why, but there seem to be two flavors of host entries.
One is created by a client request using nlmsvc_lookup_host() and the
other is created by lockd itself using nlmclnt_lookup_host(). The
first one seems to be used to keep track of the client who owns or has
requested a lock, while the second seems to be used only for the RPC
callback. I suppose this makes things easier in the case that the
request is cancelled while the RPC is still in progress?
Dan
--
+----------------------------------+----------------------------------+
| Daniel K. Forrest | Laboratory for Molecular and |
| forrest@lmcg.wisc.edu | Computational Genomics |
| (608)262-9479 | University of Wisconsin, Madison |
+----------------------------------+----------------------------------+
prev parent reply other threads:[~2002-04-26 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-11 23:33 Daniel Forrest
2002-04-12 7:10 ` Trond Myklebust
2002-04-24 21:13 ` Daniel Forrest
2002-04-26 8:30 ` Trond Myklebust
2002-04-26 17:25 ` Daniel Forrest [this message]
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=200204261725.MAA02024@radium.lmcg.wisc.edu \
--to=forrest@lmcg.wisc.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
all inboxes | Powered by JetHome®