[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1276088757.2442.128.camel@edumazet-laptop>
Date: Wed, 09 Jun 2010 15:05:57 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jarek Poplawski <jarkao2@...il.com>
Cc: Changli Gao <xiaosuo@...il.com>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Stephen Hemminger <shemminger@...tta.com>,
Patrick McHardy <kaber@...sh.net>
Subject: Re: [PATCH] pkt_sched: gen_kill_estimator() rcu fixes
Le mercredi 09 juin 2010 à 12:50 +0000, Jarek Poplawski a écrit :
> On Wed, Jun 09, 2010 at 02:09:23PM +0200, Eric Dumazet wrote:
> > Le mercredi 09 juin 2010 ?? 10:41 +0000, Jarek Poplawski a écrit :
> >
> > > Spelling suggestion: xt_rateest_free_rcu?
> > >
> > > Since it's only 3 places I'd consider adding little comments,
> > > who needs this call_rcu (like in qdisc_destroy).
> > >
> > > Anyway this patch looks OK to me.
> > >
> >
> > Thanks for reviewing, you are right about typo and adding some comments.
> >
> > What about following ?
>
> Very nice! (But let's remember these comments aren't very precise
> wrt. bstats at the moment ;-)
Yes, I anticipated a bit next patch ;)
BTW, I think using qdisc spinlock to update stats or reading them is not
really needed, particularly in xt_rateest/xt_RATEEST case, where
per_cpu bstats would be good
We could have one seqcount_t used by (bytes/packets) bstats producer,
and one seqcount_t used by est_timer when computing rates.
bstats updates :
write_seqcount_begin(&bstats->abs_seq);
bstats->bytes += len;
bstats->packets++;
write_seqcount_end(&bstats->abs_seq);
est_timer() would really run lockless, only rcu protected.
(No more spinlock, only the actual rcu_read_lock())
do {
seq = read_seqcount_begin(&bstats->abs_seq);
abs_bytes = bstats->bytes;
abs_packets = bstats->packets;
} while (read_seqcount_retry(&bstats->abs_seq, seq));
write_seqcount_begin(&s->rate_seq);
/* compute rate estimation and store it */
...
write_seqcount_end(&s->rate_seq);
This would mean bstats should be rcu protected too...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists