qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/4] xen: Avoid VLA


From: Paul Durrant
Subject: Re: [Qemu-devel] [PATCH 4/4] xen: Avoid VLA
Date: Tue, 18 Jun 2019 07:50:18 +0000

> -----Original Message-----
> From: Anthony PERARD [mailto:address@hidden]
> Sent: 17 June 2019 18:37
> To: Paul Durrant <address@hidden>
> Cc: address@hidden; address@hidden; Stefano Stabellini <address@hidden>
> Subject: Re: [PATCH 4/4] xen: Avoid VLA
> 
> On Mon, Jun 17, 2019 at 05:39:09PM +0100, Paul Durrant wrote:
> > > @@ -632,6 +633,8 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
> > >          return;
> > >      }
> > >
> > > +    bitmap = g_new0(unsigned long, bitmap_size);
> > > +
> >
> > How hot is this function? It looks (unsurprisingly) like the section
> > size determines the map size so I wonder whether it can instead be
> > allocated once when the section is added?
> 
> I think we can store the bitmap buffer into the `state' where
> `log_for_dirtybit' is already present, and free the bitmap when
> `log_for_dirtybit' is cleared.

That sounds better :-)

Cheers,

  Paul

> 
> Thanks,
> 
> --
> Anthony PERARD



reply via email to

[Prev in Thread] Current Thread [Next in Thread]