[Devel] [PATCH rh7 v2] ve/vznetstat: Don't destroy statistics until explicitly asked
Vladimir Davydov
vdavydov at parallels.com
Fri Jul 24 08:39:27 PDT 2015
On Fri, Jul 24, 2015 at 06:26:29PM +0300, Cyrill Gorcunov wrote:
> On Fri, Jul 24, 2015 at 06:21:36PM +0300, Vladimir Davydov wrote:
> > On Fri, Jul 24, 2015 at 06:10:10PM +0300, Cyrill Gorcunov wrote:
> >
> > > @@ -1098,10 +1098,8 @@ static void __net_exit net_exit_acct(str
> > >
> > > if (ve->stat) {
> > > venet_acct_put_stat(ve->stat);
> > > - if (atomic_read(&ve->stat->users) == 0) {
> >
> > Is there any point in checking this?
>
> Yes. There might be several 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.
More information about the Devel
mailing list