netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 2/2] netfilter:ipset: References are protected by rwlock instead of mutex
Date: Mon, 28 Mar 2011 14:35:01 +0200	[thread overview]
Message-ID: <4D908075.1010008@trash.net> (raw)
In-Reply-To: <1301049733-32160-3-git-send-email-kadlec@blackhole.kfki.hu>

Am 25.03.2011 11:42, schrieb Jozsef Kadlecsik:
> The timeout variant of the list:set type must reference the member sets.
> However, its garbage collector runs at timer interrupt so the mutex protection
> of the references is a no go. Therefore the reference protection
> is converted to rwlock.
> 

>  __ip_set_get(ip_set_id_t index)
>  {
> -	atomic_inc(&ip_set_list[index]->ref);
> +	write_lock_bh(&ip_set_ref_lock);
> +	ip_set_list[index]->ref++;
> +	write_unlock_bh(&ip_set_ref_lock);
>  }
>  

I'm not sure I get this, why aren't regular atomic ops working
here?

  reply	other threads:[~2011-03-28 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 10:42 [PATCH 0/2] netfilter:ipset fixes: list:set and refcounting Jozsef Kadlecsik
2011-03-25 10:42 ` [PATCH 1/2] netfilter:ipset: list:set timeout variant fixes Jozsef Kadlecsik
2011-03-25 10:42   ` [PATCH 2/2] netfilter:ipset: References are protected by rwlock instead of mutex Jozsef Kadlecsik
2011-03-28 12:35     ` Patrick McHardy [this message]
2011-03-28 13:33       ` Jozsef Kadlecsik
2011-04-04 13:20         ` Patrick McHardy
2011-03-28 12:25   ` [PATCH 1/2] netfilter:ipset: list:set timeout variant fixes Patrick McHardy

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=4D908075.1010008@trash.net \
    --to=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).