[Devel] [PATCH rh7 v2] ve/vznetstat: Don't destroy statistics until explicitly asked
Cyrill Gorcunov
gorcunov at virtuozzo.com
Fri Jul 24 09:05:05 PDT 2015
On Fri, Jul 24, 2015 at 06:50:49PM +0300, Vladimir Davydov wrote:
> On Fri, Jul 24, 2015 at 06:48:52PM +0300, Cyrill Gorcunov wrote:
> > On Fri, Jul 24, 2015 at 06:39:27PM +0300, Vladimir Davydov wrote:
> > > >
> > > > Yes. There might be several nets.
> > >
> > > Hmm, correct. Then you'd better check this explicitly:
> > >
> > > if (ve->ve_netns == net)
> > > ...
> > >
> > > Otherwise, you can omit clearing ve->stat if you race with e.g.
> > > VZCTL_TC_CLEAR_STAT, which also increments/decrements ->users.
> >
> > I would rather prefer take write lock @tc_lock here.
>
> Why?
Because it's more reliable I think, I mean venetstat module does
own counting for users and we can follow this rule -- use counter
for anythig. Sure ve->ve_netns can be used here as well but I
prefer counter. What's the profit of using @ve_netns instead?
More information about the Devel
mailing list