All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Martin Josefsson <gandalf@wlug.westbo.se>
Cc: netfilter-devel <netfilter-devel@lists.netfilter.org>
Subject: Re: [PATCH 11/11] Reduce timer updates in __nf_ct_refresh_acct()
Date: Fri, 03 Nov 2006 14:40:11 +0100	[thread overview]
Message-ID: <454B46BB.9070908@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0611031424520.2974@tux.rsn.bth.se>

Martin Josefsson wrote:
> On Fri, 3 Nov 2006, Patrick McHardy wrote:
> 
>>BTW, the "race avoidance" strikes me as racy,
>>there are multiple locations where we simply do
>>
>>if (del_timer(...))
>>   ct->timeout.function(...)
>>
>>and expect the conntrack to be either destroyed by the
>>ct->timeout.function call or by the expiring timer.
>>But without taking ip_conntrack_lock we could have:
>>
>>CPU1 (refresh)			CPU2
>>
>>if (del_timer) [success]
>>				if (del_timer) [no success]
>>	add_timer()
>>
>>which means the conntrack won't be destroyed. Did I miss
>>something?
> 
> 
> You are absolutely correct. I discussed this with Rusty some time ago and
> he thought it was fine since we mostly aim for "best effort", but I don't
> like it either. I have a patch that adds another variant of mod_timer()
> that doesn't activate an inactive timer, and use this instead of
> del_timer()/add_timer(). This avoids this race and reduces the number of
> locks taken. I'll send this patch to you after this weekend I think.


That sounds like a good way to fix it. I think I saw that patch on the
link you sent me some time ago, IIRC it touches core kernel code, so
you should probably send the timer part seperately to lkml.

  reply	other threads:[~2006-11-03 13:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01 21:08 [PATCH 00/11] Minor Cleanups Martin Josefsson
2006-11-01 21:08 ` [PATCH 01/11] Split out expectation handling Martin Josefsson
2006-11-03 11:49   ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 02/11] Split out helper handling Martin Josefsson
2006-11-03 11:50   ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 03/11] Split out the event cache Martin Josefsson
2006-11-03 11:52   ` Patrick McHardy
2006-11-03 11:57   ` Patrick McHardy
2006-11-03 12:03     ` Martin Josefsson
2006-11-03 12:47   ` Yasuyuki KOZAKAI
     [not found]   ` <200611031247.kA3CleEl011459@toshiba.co.jp>
2006-11-03 12:51     ` Patrick McHardy
2006-11-03 12:57       ` Yasuyuki KOZAKAI
2006-11-03 13:31       ` Martin Josefsson
2006-11-03 13:45         ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 04/11] Split out protocol handling Martin Josefsson
2006-11-03 11:59   ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 05/11] More __read_mostly Martin Josefsson
2006-11-03 12:04   ` Patrick McHardy
2006-11-03 12:05     ` Martin Josefsson
2006-11-03 12:13       ` Patrick McHardy
2006-11-03 12:16         ` Martin Josefsson
2006-11-01 21:08 ` [PATCH 06/11] Rename struct nf_conntrack_protocol Martin Josefsson
2006-11-03 12:07   ` Patrick McHardy
2006-11-03 12:10     ` Martin Josefsson
2006-11-03 12:11     ` Jozsef Kadlecsik
2006-11-03 12:39       ` Patrick McHardy
2006-11-03 12:51   ` Yasuyuki KOZAKAI
     [not found]   ` <200611031251.kA3Cpao9010791@toshiba.co.jp>
2006-11-03 13:53     ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 07/11] More sanity checks in protocol registration/unregistration Martin Josefsson
2006-11-03 12:21   ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 08/11] Remove ASSERT_{READ,WRITE}_LOCK Martin Josefsson
2006-11-03 12:25   ` Patrick McHardy
2006-11-03 12:32     ` Martin Josefsson
2006-11-03 12:42       ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 09/11] Minor __nf_ct_refresh_acct() whitespace cleanup Martin Josefsson
2006-11-01 21:08 ` [PATCH 10/11] Remove unused struct list_head from protocols Martin Josefsson
2006-11-03 12:27   ` Patrick McHardy
2006-11-01 21:08 ` [PATCH 11/11] Reduce timer updates in __nf_ct_refresh_acct() Martin Josefsson
2006-11-03 12:39   ` Patrick McHardy
2006-11-03 13:27     ` Martin Josefsson
2006-11-03 13:40       ` Patrick McHardy [this message]
2006-11-03 13:48         ` Martin Josefsson
2006-11-03 13:54           ` Patrick McHardy
2006-11-03 14:02             ` Martin Josefsson

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=454B46BB.9070908@trash.net \
    --to=kaber@trash.net \
    --cc=gandalf@wlug.westbo.se \
    --cc=netfilter-devel@lists.netfilter.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 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.