The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Brad Chapman <kakadu_croc@yahoo.com>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: brlock_is_locked()?
Date: Wed, 22 Aug 2001 11:17:55 -0700 (PDT)	[thread overview]
Message-ID: <20010822181755.39925.qmail@web10905.mail.yahoo.com> (raw)
In-Reply-To: <20010822.110316.57459277.davem@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]

--- "David S. Miller" <davem@redhat.com> wrote:
>    From: Brad Chapman <kakadu_croc@yahoo.com>
>    Date: Wed, 22 Aug 2001 11:00:56 -0700 (PDT)
> 
>    	I'm not talking about _who_ owns the lock, I'm talking about whether
>    the lock itself is locked. I don't care which process is using the lock;
>    I just want to know if _somebody_ is using it. Is this possible?
> 
> Show a valid use for such a boolean state, then
> the discussion may proceed :-)
> 
> Later,
> David S. Miller
> davem@redhat.com

Mr. Miller,

	I am debugging my port of the Netfilter IPv4 connection tracking
subsystem to IPv6. In some sections of the code, I had to split the code
into core functions, which did the actual work and could be used by people
with the appropriate locks, and wrapper functions, which grabbed the locks
themselves. 
	One such group of functions was the ip6_conntrack_protocol API.
To make life easier in the future, and to make third-party protocol
registration easier, I split the functions. In the unregistration function,
in order to be SMP-compliant we needed to grab BR_NETPROTO_LOCK to seal
the netfilter stack and prevent any packets from being scanned by the protocol
functions. When I split the unregistration function, I realized that there
was no way to detect if BR_NETPROTO_LOCK was locked, by _anyone_. Thus, if
someone  had BR_NETPROTO_LOCK and tried to call
ip6_conntrack_protocol_unregister() (the wrapper), we would deadlock.
	At this section of the code, it doesn't really matter who in the
netfilter/network stack has BR_NETPROTO_LOCK, just that we need to know if
it's already locked by someone else, or unlocked for us to use. Is what I'm
asking for physically possible?

Thanks,

Brad


=====
Brad Chapman

Permanent e-mail: kakadu_croc@yahoo.com
Current e-mail: kakadu@adelphia.net

Reply to the address I used in the message to you,
please!

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

  reply	other threads:[~2001-08-22 18:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-22 13:04 brlock_is_locked()? Brad Chapman
2001-08-22 16:33 ` brlock_is_locked()? Ben LaHaise
2001-08-22 18:00   ` brlock_is_locked()? Brad Chapman
2001-08-22 18:03     ` brlock_is_locked()? David S. Miller
2001-08-22 18:17       ` Brad Chapman [this message]
2001-08-22 18:26         ` brlock_is_locked()? David S. Miller
2001-08-22 18:33           ` brlock_is_locked()? Brad Chapman
2001-08-22 18:47             ` brlock_is_locked()? David S. Miller
2001-08-22 18:53               ` brlock_is_locked()? Brad Chapman
2001-08-22 19:00                 ` brlock_is_locked()? David S. Miller
2001-08-22 19:08                   ` brlock_is_locked()? Brad Chapman
2001-08-24  6:49                     ` brlock_is_locked()? Jens Axboe
2001-08-24 14:11                       ` brlock_is_locked()? Brad Chapman

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=20010822181755.39925.qmail@web10905.mail.yahoo.com \
    --to=kakadu_croc@yahoo.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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