[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2a73a3b11970a4aefd020764e19284ba347cc1c.camel@redhat.com>
Date: Wed, 28 Feb 2024 08:46:01 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
kuni1840@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 04/14] af_unix: Bulk update
unix_tot_inflight/unix_inflight when queuing skb.
On Tue, 2024-02-27 at 18:34 -0800, Kuniyuki Iwashima wrote:
> From: Paolo Abeni <pabeni@...hat.com>
> Date: Tue, 27 Feb 2024 11:47:23 +0100
> > On Fri, 2024-02-23 at 13:39 -0800, Kuniyuki Iwashima wrote:
> > > diff --git a/net/unix/garbage.c b/net/unix/garbage.c
> > > index 96d0b1db3638..e8fe08796d02 100644
> > > --- a/net/unix/garbage.c
> > > +++ b/net/unix/garbage.c
> > > @@ -148,6 +148,7 @@ static void unix_free_vertices(struct scm_fp_list *fpl)
> > > }
> > >
> > > DEFINE_SPINLOCK(unix_gc_lock);
> > > +unsigned int unix_tot_inflight;
> > >
> > > void unix_add_edges(struct scm_fp_list *fpl, struct unix_sock *receiver)
> > > {
> > > @@ -172,7 +173,10 @@ void unix_add_edges(struct scm_fp_list *fpl, struct unix_sock *receiver)
> > > unix_add_edge(fpl, edge);
> > > } while (i < fpl->count_unix);
> > >
> > > + WRITE_ONCE(unix_tot_inflight, unix_tot_inflight + fpl->count_unix);
> > > out:
> > > + WRITE_ONCE(fpl->user->unix_inflight, fpl->user->unix_inflight + fpl->count);
> >
> > I'm unsure if later patches will shed some light, but why the above
> > statement is placed _after_ the 'out' label? fpl->count will be 0 in
> > such path, and the updated not needed. Why don't you place it before
> > the mentioned label?
>
> fpl->count is the total number of fds in skb, and fpl->count_unix
> is the number of AF_UNIX fds.
Ah right you are! Sorry, I misread the variable name. This code looks
good.
Cheers,
Paolo
Powered by blists - more mailing lists