netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v2 nf-next 4/7] netfilter: conntrack: add gc worker to remove timed-out entries
Date: Wed, 24 Aug 2016 22:11:39 +0200	[thread overview]
Message-ID: <20160824201139.GA14379@breakpoint.cc> (raw)
In-Reply-To: <1472060441.14381.106.camel@edumazet-glaptop3.roam.corp.google.com>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2016-08-24 at 13:55 +0200, Florian Westphal wrote:
> > Conntrack gc worker to evict stale entries.
> 
> 
> >  static struct nf_conn *
> >  __nf_conntrack_alloc(struct net *net,
> >  		     const struct nf_conntrack_zone *zone,
> > @@ -1527,6 +1597,7 @@ static int untrack_refs(void)
> >  
> >  void nf_conntrack_cleanup_start(void)
> >  {
> > +	conntrack_gc_work.exiting = true;
> >  	RCU_INIT_POINTER(ip_ct_attach, NULL);
> >  }
> >  
> > @@ -1536,6 +1607,9 @@ void nf_conntrack_cleanup_end(void)
> >  	while (untrack_refs() > 0)
> >  		schedule();
> >  
> > +	cancel_delayed_work_sync(&conntrack_gc_work.dwork);
> > +	/* can be re-scheduled once */
> 
> Are you sure ?
> 
> As conntrack_gc_work.exiting = true, I do not see how this can happen ?

nf_conntrack_cleanup_start() sets exiting = true

current cpu blocks in

cancel_delayed_work_sync(&conntrack_gc_work.dwork);

Iff the work queue was running on other cpu but was already past
gc_work->exiting check then when cancel_delayed_work_sync() (first one)
returns it will have re-armed itself via schedule_delayed_work().

So I think the 2nd cancel_delayed_work_sync is needed.

Let me know if you'd like to see a v3 with more verbose
comment about this.

Thanks!

  reply	other threads:[~2016-08-24 20:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 11:55 [PATCH nf-next v2 0/7] netfilter: get rid of per-object conntrack timers Florian Westphal
2016-08-24 11:55 ` [PATCH v2 nf-next 1/7] netfilter: don't rely on DYING bit to detect when destroy event was sent Florian Westphal
2016-08-24 17:05   ` Eric Dumazet
2016-08-24 11:55 ` [PATCH v2 nf-next 2/7] netfilter: conntrack: get rid of conntrack timer Florian Westphal
2016-08-24 17:11   ` Eric Dumazet
2016-08-24 11:55 ` [PATCH v2 nf-next 3/7] netfilter: evict stale entries on netlink dumps Florian Westphal
2016-08-24 17:33   ` Eric Dumazet
2016-08-24 11:55 ` [PATCH v2 nf-next 4/7] netfilter: conntrack: add gc worker to remove timed-out entries Florian Westphal
2016-08-24 17:40   ` Eric Dumazet
2016-08-24 20:11     ` Florian Westphal [this message]
2016-08-24 20:30       ` Eric Dumazet
2016-08-24 23:50         ` Florian Westphal
2016-08-24 11:55 ` [PATCH v2 nf-next 5/7] netfilter: conntrack: resched gc again if eviction rate is high Florian Westphal
2016-08-24 11:55 ` [PATCH v2 nf-next 6/7] netfilter: remove __nf_ct_kill_acct helper Florian Westphal
2016-08-24 11:55 ` [PATCH nf-next 7/7] netfilter: restart search if moved to other chain Florian Westphal
2016-08-24 13:20   ` Eric Dumazet

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=20160824201139.GA14379@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --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).