Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-13 Thread Yi Min Zhao
在 2018/9/13 下午4:23, Andrea Bolognani 写道: On Thu, 2018-09-13 at 15:58 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午6:37, Andrea Bolognani 写道: Too bad fid can go all the way to UINT32_MAX, otherwise we could have just stored them in the pointer after offsetting them by one and thus worked around

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-13 Thread Andrea Bolognani
On Thu, 2018-09-13 at 15:58 +0800, Yi Min Zhao wrote: > 在 2018/9/12 下午6:37, Andrea Bolognani 写道: > > Too bad fid can go all the way to UINT32_MAX, otherwise we could > > have just stored them in the pointer after offsetting them by one > > and thus worked around the issue... > > > > I guess

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-13 Thread Yi Min Zhao
在 2018/9/12 下午6:37, Andrea Bolognani 写道: On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午3:35, Yi Min Zhao 写道: This makes sense and seems to work just fine; however, you are allocating and releasing a bunch of small integers, which seems a bit wasteful. vircgroup is

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午6:37, Andrea Bolognani 写道: On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午3:35, Yi Min Zhao 写道: This makes sense and seems to work just fine; however, you are allocating and releasing a bunch of small integers, which seems a bit wasteful. vircgroup is

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Andrea Bolognani
On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: > 在 2018/9/12 下午3:35, Yi Min Zhao 写道: > > > This makes sense and seems to work just fine; however, you are > > > allocating and releasing a bunch of small integers, which seems > > > a bit wasteful. > > > > > > vircgroup is AFAICT avoiding all

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午3:35, Yi Min Zhao 写道: +static void * +virZPCIAddrCopy(const void *name) +{ +    unsigned int *copy; + +    if (VIR_ALLOC(copy) < 0) +    return NULL; + +    *copy = *((unsigned int *)name); +    return (void *)copy; +} + + +static void +virZPCIAddrKeyFree(void *name) +{ +   

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/11 下午7:34, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: This patch provides a caching mechanism for the device address extensions uid and fid on S390. For efficient sparse address allocation, we introduce two hash tables for uid/fid which hold the

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-11 Thread Andrea Bolognani
On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: > This patch provides a caching mechanism for the device address > extensions uid and fid on S390. For efficient sparse address allocation, > we introduce two hash tables for uid/fid which hold the address set > information per domain. Also in

[libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-04 Thread Yi Min Zhao
This patch provides a caching mechanism for the device address extensions uid and fid on S390. For efficient sparse address allocation, we introduce two hash tables for uid/fid which hold the address set information per domain. Also in order to improve performance of searching available value, we