[Libguestfs] [PATCH libnbd 7/8] copy: Track worker queue size

Nir Soffer nsoffer at redhat.com
Mon Feb 21 13:35:23 UTC 2022


On Mon, Feb 21, 2022 at 12:17 PM Richard W.M. Jones <rjones at redhat.com> wrote:
>
> On Mon, Feb 21, 2022 at 08:28:54AM +0200, Nir Soffer wrote:
> > On Sun, Feb 20, 2022 at 8:53 PM Richard W.M. Jones <rjones at redhat.com> wrote:
> > >
> > > On Sun, Feb 20, 2022 at 02:14:02PM +0200, Nir Soffer wrote:
> > > > +static inline void
> > > > +increase_queue_size(struct worker *worker, size_t len)
> > >
> > >                       ^ space
> > >
> > > and the same in the next function:
> >
> > Sure will fix before pushing.
> >
> > Do we have a way to format the source automatically with spaces
> > before ()?
>
> I don't think anyone was written GNU indent rules yet ..

Seems that it is supported:

       -pcs, --space-after-procedure-calls
           Insert a space between the name of the procedure being
called and the ‘(’.
           See  STATEMENTS.

>
> > > > +{
> > > > +  worker->queue_size += len;
> > > > +}
> > > > +
> > > > +static inline void
> > > > +decrease_queue_size(struct worker *worker, size_t len)
> > > > +{
> > > > +  assert (worker->queue_size >= len);
> > > > +  worker->queue_size -= len;
> > > > +}
> > >
> > > Do we not need any locking here?
> >
> > Since every worker thread accesses only its data, no locking is needed.
>
> OK
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-df lists disk usage of guests without needing to install any
> software inside the virtual machine.  Supports Linux and Windows.
> http://people.redhat.com/~rjones/virt-df/
>





More information about the Libguestfs mailing list