All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Harald Welte <laforge@netfilter.org>
Cc: netfilter-devel@lists.netfilter.org, pablo@eurodev.net,
	Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Subject: Re: Question about reference count of expectations in 2.6.14 tree
Date: Thu, 11 Aug 2005 16:40:32 +0200	[thread overview]
Message-ID: <42FB6360.9010003@trash.net> (raw)
In-Reply-To: <20050811135135.GJ4130@rama.de.gnumonks.org>

Harald Welte wrote:
> Looking at it again, and doing some tests: The current code works,
> /proc/slabinfo shows me there is no expectation leak.
> 
> This is because the reference count is also put two times:  in
> unlink_expect, and in expectation_timed_out().  Almost all over the
> place, first unlink_expect() drops the first refcount, and
> ip_conntrack_espect_put() is called explicitly to drop the second.
> 
> So yes, one count seems to be for the timer, the second one for
> ip_conntrack_expect_list.  Two references.

Correct.

> I think it would be possible to remove the second atomic_inc() and all
> the ip_conntrack_put() that immediately follow ulink_expect() - but
> would it be worth the effort?  Isn't it an over-optimization that is
> likely to cause bugs later on?

There is one spot where it isn't possible, in find_expectation
the timer reference isn't dropped but returned to the caller.
Changing it would either require a special version of unlink_expect
or an additional atomic_inc in this function. I don't think its
worth the trouble, we do take two references so this seems the
cleanest way to me.

  reply	other threads:[~2005-08-11 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200508100111.j7A1Bok9010084@toshiba.co.jp>
2005-08-11 13:35 ` Question about reference count of expectations in 2.6.14 tree Harald Welte
2005-08-11 13:51   ` Harald Welte
2005-08-11 14:40     ` Patrick McHardy [this message]
2005-08-11 19:20       ` Harald Welte
2005-08-12  1:19         ` Pablo Neira
2005-08-12  1:19         ` Yasuyuki KOZAKAI
2005-08-10  1:11 Yasuyuki KOZAKAI
  -- strict thread matches above, loose matches on Subject: below --
2005-08-09 10:45 Yasuyuki KOZAKAI

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=42FB6360.9010003@trash.net \
    --to=kaber@trash.net \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@eurodev.net \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.