RE: [PATCH v8 00/14] Guest LBR Enabling

2019-09-06 Thread Wang, Wei W
A polite ping for comments on this version, thanks! On Tuesday, August 6, 2019 3:16 PM, Wei Wang wrote: > Last Branch Recording (LBR) is a performance monitor unit (PMU) feature on > Intel CPUs that captures branch related info. This patch series enables this > feature to KVM guests. > > Each

RE: [PATCH v3 2/2] balloon: fix up comments

2019-07-18 Thread Wang, Wei W
On Thursday, July 18, 2019 8:24 PM, Michael S. Tsirkin wrote: > /* > * balloon_page_alloc - allocates a new page for insertion into the balloon > - * page list. > + * page list. > * > - * Driver must call it to properly allocate a new enlisted balloon

RE: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Wang, Wei W
On Wednesday, July 17, 2019 7:21 PM, Michael S. Tsirkin wrote: > > Wei, others, > > ATM virtio_balloon_shrinker_scan will only get registered when deflate on > oom feature bit is set. > > Not sure whether that's intentional. Yes, we wanted to follow the old oom behavior, which allows the oom

RE: [PATCH v1 6/6] virtio-balloon: Add support for aerating memory via hinting

2019-07-16 Thread Wang, Wei W
On Tuesday, July 16, 2019 10:41 PM, Hansen, Dave wrote: > Where is the page allocator integration? The set you linked to has 5 patches, > but only 4 were merged. This one is missing: > > https://lore.kernel.org/patchwork/patch/961038/ For some reason, we used the regular page allocation

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-15 Thread Wang, Wei W
On Thursday, February 14, 2019 6:01 PM, David Hildenbrand wrote: > And how to preload without locking? The memory is preload per-CPU. It's usually called outside the lock. Best, Wei

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-15 Thread Wang, Wei W
On Thursday, February 14, 2019 5:43 PM, David Hildenbrand wrote: > Yes indeed, that is the important bit. They must not be put pack to the > buddy before they have been processed by the hypervisor. But as the pages > are not in the buddy, no one allocating a page will stumble over such a page >

RE: [PATCH v5 10/12] KVM/x86/lbr: lazy save the guest lbr stack

2019-02-15 Thread Wang, Wei W
On Friday, February 15, 2019 9:50 AM, Like Xu wrote: > To: Wang, Wei W ; linux-kernel@vger.kernel.org; > k...@vger.kernel.org; pbonz...@redhat.com; a...@linux.intel.com; > pet...@infradead.org > Cc: Liang, Kan ; mi...@redhat.com; > rkrc...@redhat.com; Xu, Like ; ja...@google.c

RE: [PATCH v5 12/12] KVM/VMX/vPMU: support to report GLOBAL_STATUS_LBRS_FROZEN

2019-02-15 Thread Wang, Wei W
On Friday, February 15, 2019 12:32 AM, Andi Kleen wrote: > > > +static void intel_pmu_get_global_status(struct kvm_pmu *pmu, > > + struct msr_data *msr_info) > > +{ > > + u64 guest_debugctl, freeze_lbr_bits = > DEBUGCTLMSR_FREEZE_LBRS_ON_PMI | > > +

RE: [PATCH v5 07/12] perf/x86: no counter allocation support

2019-02-15 Thread Wang, Wei W
On Friday, February 15, 2019 12:26 AM, Andi Kleen wrote: > > diff --git a/include/uapi/linux/perf_event.h > > b/include/uapi/linux/perf_event.h index 9de8780..ec97a70 100644 > > --- a/include/uapi/linux/perf_event.h > > +++ b/include/uapi/linux/perf_event.h > > @@ -372,7 +372,8 @@ struct

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-14 Thread Wang, Wei W
On Wednesday, February 13, 2019 5:19 PM, David Hildenbrand wrote: > If you have to resize/alloc/coordinate who will report, you will need locking. > Especially, I doubt that there is an atomic xbitmap (prove me wrong :) ). Yes, we need change xbitmap to support it. Just thought of another

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-14 Thread Wang, Wei W
On Wednesday, February 13, 2019 8:07 PM, Nitesh Narayan Lal wrote: > Once the host free the pages. All the isolated pages are returned back > to the buddy. (This is implemented in hyperlist_ready()) This actually has the same issue: the isolated pages have to wait to return to the buddy after

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-13 Thread Wang, Wei W
On Tuesday, February 5, 2019 4:19 AM, Nitesh Narayan Lal wrote: > The following patch-set proposes an efficient mechanism for handing freed > memory between the guest and the host. It enables the guests with no page > cache to rapidly free and reclaims memory to and from the host respectively. >

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-13 Thread Wang, Wei W
On Tuesday, February 12, 2019 5:24 PM, David Hildenbrand wrote: > Global means all VCPUs will be competing potentially for a single lock when > freeing/allocating a page, no? What if you have 64VCPUs allocating/freeing > memory like crazy? I think the key point is that the 64 vcpus won't

RE: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting

2019-02-12 Thread Wang, Wei W
On Tuesday, February 5, 2019 4:19 AM, Nitesh Narayan Lal wrote: > The following patch-set proposes an efficient mechanism for handing freed > memory between the guest and the host. It enables the guests with no page > cache to rapidly free and reclaims memory to and from the host respectively. >

RE: [PATCH v4 04/10] KVM/x86: intel_pmu_lbr_enable

2019-01-05 Thread Wang, Wei W
On Friday, January 4, 2019 11:54 PM, Jim Mattson wrote: > On Fri, Jan 4, 2019 at 2:03 AM Wei Wang wrote: > > > > On 01/03/2019 11:34 PM, Jim Mattson wrote: > > > Fast forward to, say, 2021. You're decommissioning all Broadwell > > > servers in your data center. You have to migrate the running VMs

RE: [PATCH v2 1/2] virtio-balloon: tweak config_changed implementation

2019-01-04 Thread Wang, Wei W
On Friday, January 4, 2019 11:45 PM, Michael S. Tsirkin wrote: > > struct virtio_balloon { > > struct virtio_device *vdev; > > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq, *free_page_vq; > > @@ -77,6 +81,8 @@ struct virtio_balloon { > > /* Prevent updating balloon when it is

RE: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2018-12-30 Thread Wang, Wei W
On Sunday, December 30, 2018 2:06 PM, Halil Pasic wrote: > > I guess you are the first one trying to read virtio config from within > interrupt > context. AFAICT this never worked. I'm not sure about "never worked". It seems to work well with virtio-pci. But looking forward to hearing a solid

RE: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack II

2018-12-28 Thread Wang, Wei W
On Friday, December 28, 2018 4:53 AM, Andi Kleen wrote: > Actually forgot one case. > > In Arch Perfmon v4 the LBR freezing is also controlled through a > GLOBAL_CTRL bit. > I didn't see any code handling that bit? That GLOBAL_STATUS.LBR_FRZ bit hasn't been supported yet. I'll add that, thanks.

RE: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2018-12-28 Thread Wang, Wei W
On Friday, December 28, 2018 3:57 PM, Christian Borntraeger wrote: > On 28.12.2018 03:26, Wei Wang wrote: > > Some vqs don't need to be allocated when the related feature bits are > > disabled. Callers notice the vq allocation layer by setting the > > related names[i] to be NULL. > > > > This

RE: [PATCH v1 1/8] perf/x86: add support to mask counters from host

2018-11-05 Thread Wang, Wei W
On Monday, November 5, 2018 8:14 PM, Peter Zijlstra wrote: > The answer for PEBS is really simple; PEBS does not virtualize (Andi tried and > can tell you why; IIRC it has something to do with how the hardware asks for > a Linear Address instead of a Physical Address). So the problem will not >

RE: [PATCH v1 1/8] perf/x86: add support to mask counters from host

2018-11-05 Thread Wang, Wei W
On Monday, November 5, 2018 8:14 PM, Peter Zijlstra wrote: > The answer for PEBS is really simple; PEBS does not virtualize (Andi tried and > can tell you why; IIRC it has something to do with how the hardware asks for > a Linear Address instead of a Physical Address). So the problem will not >

RE: [PATCH v1] KVM/x86/vPMU: Guest PMI Optimization

2018-10-14 Thread Wang, Wei W
On Sunday, October 14, 2018 8:41 PM, Wei Wang wrote: > Here is the plan I have in mind: > #1 Creates a host perf event on the guest's first bit-setting to > MSR_CORE_PERF_GLOBAL_CTRL; Meanwhile, disable the intercept of guest > access to this perf counter related MSRs (i.e. config_base and

RE: [PATCH v1] KVM/x86/vPMU: Guest PMI Optimization

2018-10-14 Thread Wang, Wei W
On Sunday, October 14, 2018 8:41 PM, Wei Wang wrote: > Here is the plan I have in mind: > #1 Creates a host perf event on the guest's first bit-setting to > MSR_CORE_PERF_GLOBAL_CTRL; Meanwhile, disable the intercept of guest > access to this perf counter related MSRs (i.e. config_base and

RE: [PATCH v1] KVM/x86/vPMU: Guest PMI Optimization

2018-10-12 Thread Wang, Wei W
On Saturday, October 13, 2018 12:31 AM, Andi Kleen wrote: > > 4. Results > > - Without this optimization, the guest pmi handling time is > > ~450 ns, and the max sampling rate is reduced to 250. > > - With this optimization, the guest pmi handling time is ~9000 ns > > (i.e.

RE: [PATCH v1] KVM/x86/vPMU: Guest PMI Optimization

2018-10-12 Thread Wang, Wei W
On Saturday, October 13, 2018 12:31 AM, Andi Kleen wrote: > > 4. Results > > - Without this optimization, the guest pmi handling time is > > ~450 ns, and the max sampling rate is reduced to 250. > > - With this optimization, the guest pmi handling time is ~9000 ns > > (i.e.

RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:08 PM, Gonglei (Arei) wrote: > > +static bool guest_access_lbr_msr(struct kvm_vcpu *vcpu, > > +struct msr_data *msr_info, > > +bool set) > > +{ > > + bool ret = false; > > + > > + if

RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:08 PM, Gonglei (Arei) wrote: > > +static bool guest_access_lbr_msr(struct kvm_vcpu *vcpu, > > +struct msr_data *msr_info, > > +bool set) > > +{ > > + bool ret = false; > > + > > + if

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:32 PM, Peter Zijlstra wrote: > On Thu, Sep 20, 2018 at 06:05:58PM +0800, Wei Wang wrote: > How do you deal with that situation, where the LBR is in use by a host event? I guess you were referring to this use case: "perf record -b qemu-system-x86_64..", where the

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:32 PM, Peter Zijlstra wrote: > On Thu, Sep 20, 2018 at 06:05:58PM +0800, Wei Wang wrote: > How do you deal with that situation, where the LBR is in use by a host event? I guess you were referring to this use case: "perf record -b qemu-system-x86_64..", where the

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Friday, September 21, 2018 12:24 AM, Peter Zijlstra wrote: > On Thu, Sep 20, 2018 at 08:30:35AM -0700, Andi Kleen wrote: > > > +int intel_pmu_enable_save_guest_lbr(struct kvm_vcpu *vcpu) { > > > + struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); > > > + struct perf_event *event; > > > + struct

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Friday, September 21, 2018 12:24 AM, Peter Zijlstra wrote: > On Thu, Sep 20, 2018 at 08:30:35AM -0700, Andi Kleen wrote: > > > +int intel_pmu_enable_save_guest_lbr(struct kvm_vcpu *vcpu) { > > > + struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); > > > + struct perf_event *event; > > > + struct

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 11:31 PM, Andi Kleen wrote: > > +int intel_pmu_enable_save_guest_lbr(struct kvm_vcpu *vcpu) { > > + struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); > > + struct perf_event *event; > > + struct perf_event_attr attr = { > > + .type = PERF_TYPE_RAW, > > +

RE: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 11:31 PM, Andi Kleen wrote: > > +int intel_pmu_enable_save_guest_lbr(struct kvm_vcpu *vcpu) { > > + struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); > > + struct perf_event *event; > > + struct perf_event_attr attr = { > > + .type = PERF_TYPE_RAW, > > +

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Saturday, September 8, 2018 4:05 AM, Andi Kleen wrote: > > How would you realize the function of saving/restoring the lbr stack on the > host? > > > > Here, we create a perf event on the host (please see > guest_lbr_event_create on patch 7), which essentially satisfies all the > conditions

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Saturday, September 8, 2018 4:05 AM, Andi Kleen wrote: > > How would you realize the function of saving/restoring the lbr stack on the > host? > > > > Here, we create a perf event on the host (please see > guest_lbr_event_create on patch 7), which essentially satisfies all the > conditions

RE: [PATCH v2 7/8] KVM: PMU: support to save/restore the guest lbr stack on vCPU switching

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:37 PM, Jann Horn wrote: > On Fri, Sep 7, 2018 at 4:28 PM Wei Wang wrote: > > This patch adds support to KVM to save/restore the lbr stack on vCPU > > context switching. > > > > When the guest sets the ACTIVE bit of MSR_KVM_PV_LBR_CTRL, a perf > > event is created

RE: [PATCH v2 7/8] KVM: PMU: support to save/restore the guest lbr stack on vCPU switching

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:37 PM, Jann Horn wrote: > On Fri, Sep 7, 2018 at 4:28 PM Wei Wang wrote: > > This patch adds support to KVM to save/restore the lbr stack on vCPU > > context switching. > > > > When the guest sets the ACTIVE bit of MSR_KVM_PV_LBR_CTRL, a perf > > event is created

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:11 PM, Andi Kleen wrote: > > This could achieve the above #1, but how would it solve #2 above? That > > is, after the guest uses the lbr feature for a while, the lbr stack > > has been passed through, then the guest doesn't use lbr any more, but > > the vCPU will

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:11 PM, Andi Kleen wrote: > > This could achieve the above #1, but how would it solve #2 above? That > > is, after the guest uses the lbr feature for a while, the lbr stack > > has been passed through, then the guest doesn't use lbr any more, but > > the vCPU will

RE: [PATCH] KVM: x86: Expose CLDEMOTE CPU feature to guest VM

2018-05-09 Thread Wang, Wei W
On Wednesday, May 9, 2018 7:52 PM, Paolo Bonzini wrote: > On 08/05/2018 04:03, Liu, Jingqi wrote: > > Hi Paolo, > > Thanks. > > Will you help to modify the Signed-off-by chain ? > > Or do I need to submit the second version after modifying the Signed-off- > by chain ? > > Can you explain your

RE: [PATCH] KVM: x86: Expose CLDEMOTE CPU feature to guest VM

2018-05-09 Thread Wang, Wei W
On Wednesday, May 9, 2018 7:52 PM, Paolo Bonzini wrote: > On 08/05/2018 04:03, Liu, Jingqi wrote: > > Hi Paolo, > > Thanks. > > Will you help to modify the Signed-off-by chain ? > > Or do I need to submit the second version after modifying the Signed-off- > by chain ? > > Can you explain your

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-05 Thread Wang, Wei W
On Friday, April 6, 2018 2:30 AM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 03:47:28PM +0000, Wang, Wei W wrote: > > On Thursday, April 5, 2018 10:04 PM, Michael S. Tsirkin wrote: > > > On Thu, Apr 05, 2018 at 02:05:03AM +, Wang, Wei W wrote: > > > > O

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-05 Thread Wang, Wei W
On Friday, April 6, 2018 2:30 AM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 03:47:28PM +0000, Wang, Wei W wrote: > > On Thursday, April 5, 2018 10:04 PM, Michael S. Tsirkin wrote: > > > On Thu, Apr 05, 2018 at 02:05:03AM +, Wang, Wei W wrote: > > > > O

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-05 Thread Wang, Wei W
On Thursday, April 5, 2018 10:04 PM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 02:05:03AM +0000, Wang, Wei W wrote: > > On Thursday, April 5, 2018 9:12 AM, Michael S. Tsirkin wrote: > > > On Thu, Apr 05, 2018 at 12:30:27AM +, Wang, Wei W wrote: > > > >

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-05 Thread Wang, Wei W
On Thursday, April 5, 2018 10:04 PM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 02:05:03AM +0000, Wang, Wei W wrote: > > On Thursday, April 5, 2018 9:12 AM, Michael S. Tsirkin wrote: > > > On Thu, Apr 05, 2018 at 12:30:27AM +, Wang, Wei W wrote: > > > >

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-04 Thread Wang, Wei W
On Thursday, April 5, 2018 9:12 AM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 12:30:27AM +0000, Wang, Wei W wrote: > > On Wednesday, April 4, 2018 10:08 PM, Michael S. Tsirkin wrote: > > > On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > > > > On

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-04 Thread Wang, Wei W
On Thursday, April 5, 2018 9:12 AM, Michael S. Tsirkin wrote: > On Thu, Apr 05, 2018 at 12:30:27AM +0000, Wang, Wei W wrote: > > On Wednesday, April 4, 2018 10:08 PM, Michael S. Tsirkin wrote: > > > On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > > > > On

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-04 Thread Wang, Wei W
On Wednesday, April 4, 2018 10:08 PM, Michael S. Tsirkin wrote: > On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > > On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: > > > On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: > > > > +static int add_one_sg(struct virtqueue *vq,

RE: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-04 Thread Wang, Wei W
On Wednesday, April 4, 2018 10:08 PM, Michael S. Tsirkin wrote: > On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > > On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: > > > On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: > > > > +static int add_one_sg(struct virtqueue *vq,

RE: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-03-25 Thread Wang, Wei W
On Monday, March 26, 2018 10:40 AM, Wang, Wei W wrote: > Subject: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled > to kernel modules > > In some usages, e.g. virtio-balloon, a kernel module needs to know if page > poisoning is in use. This patch exposes the page_po

RE: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-03-25 Thread Wang, Wei W
On Monday, March 26, 2018 10:40 AM, Wang, Wei W wrote: > Subject: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled > to kernel modules > > In some usages, e.g. virtio-balloon, a kernel module needs to know if page > poisoning is in use. This patch exposes the page_po

RE: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-27 Thread Wang, Wei W
On Friday, January 26, 2018 11:00 PM, Michael S. Tsirkin wrote: > On Fri, Jan 26, 2018 at 11:29:15AM +0800, Wei Wang wrote: > > On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: > > > On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > > > > This patch adds support to walk through the free

RE: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-27 Thread Wang, Wei W
On Friday, January 26, 2018 11:00 PM, Michael S. Tsirkin wrote: > On Fri, Jan 26, 2018 at 11:29:15AM +0800, Wei Wang wrote: > > On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: > > > On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > > > > This patch adds support to walk through the free

RE: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-27 Thread Wang, Wei W
On Saturday, January 27, 2018 5:44 AM, Michael S. Tsirkin wrote: > On Fri, Jan 26, 2018 at 05:00:09PM +0200, Michael S. Tsirkin wrote: > > On Fri, Jan 26, 2018 at 11:29:15AM +0800, Wei Wang wrote: > > > On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: > > > > On Wed, Jan 24, 2018 at 06:42:41PM

RE: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-27 Thread Wang, Wei W
On Saturday, January 27, 2018 5:44 AM, Michael S. Tsirkin wrote: > On Fri, Jan 26, 2018 at 05:00:09PM +0200, Michael S. Tsirkin wrote: > > On Fri, Jan 26, 2018 at 11:29:15AM +0800, Wei Wang wrote: > > > On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: > > > > On Wed, Jan 24, 2018 at 06:42:41PM

RE: [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wang, Wei W
On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: > On Wed, Dec 20, 2017 at 06:34:36PM +0800, Wei Wang wrote: > > On 12/19/2017 10:05 PM, Tetsuo Handa wrote: > > > I think xb_find_set() has a bug in !node path. > > > > I think we can probably remove the "!node" path for now. It would

RE: [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wang, Wei W
On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: > On Wed, Dec 20, 2017 at 06:34:36PM +0800, Wei Wang wrote: > > On 12/19/2017 10:05 PM, Tetsuo Handa wrote: > > > I think xb_find_set() has a bug in !node path. > > > > I think we can probably remove the "!node" path for now. It would

RE: [PATCH v19 3/7] xbitmap: add more operations

2017-12-17 Thread Wang, Wei W
On Saturday, December 16, 2017 3:22 AM, Matthew Wilcox wrote: > On Fri, Dec 15, 2017 at 10:49:15AM -0800, Matthew Wilcox wrote: > > Here's the API I'm looking at right now. The user need take no lock; > > the locking (spinlock) is handled internally to the implementation. Another place I saw

RE: [PATCH v19 3/7] xbitmap: add more operations

2017-12-17 Thread Wang, Wei W
On Saturday, December 16, 2017 3:22 AM, Matthew Wilcox wrote: > On Fri, Dec 15, 2017 at 10:49:15AM -0800, Matthew Wilcox wrote: > > Here's the API I'm looking at right now. The user need take no lock; > > the locking (spinlock) is handled internally to the implementation. Another place I saw

RE: [PATCH v19 3/7] xbitmap: add more operations

2017-12-17 Thread Wang, Wei W
> -Original Message- > From: Tetsuo Handa [mailto:penguin-ker...@i-love.sakura.ne.jp] > Sent: Sunday, December 17, 2017 6:22 PM > To: Wang, Wei W <wei.w.w...@intel.com>; wi...@infradead.org > Cc: virtio-...@lists.oasis-open.org; linux-kernel@vger.kernel.org; qem

RE: [PATCH v19 3/7] xbitmap: add more operations

2017-12-17 Thread Wang, Wei W
> -Original Message- > From: Tetsuo Handa [mailto:penguin-ker...@i-love.sakura.ne.jp] > Sent: Sunday, December 17, 2017 6:22 PM > To: Wang, Wei W ; wi...@infradead.org > Cc: virtio-...@lists.oasis-open.org; linux-kernel@vger.kernel.org; qemu- > de...@nongn

RE: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Wang, Wei W
On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > On 11/30/2017 06:34 PM, Tetsuo Handa wrote: > > > Wei Wang wrote: > > >> + * @start: the start of the bit range, inclusive > > >> + * @end: the end of the bit range, inclusive > > >> + * > > >> + * This function is used

RE: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Wang, Wei W
On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > On 11/30/2017 06:34 PM, Tetsuo Handa wrote: > > > Wei Wang wrote: > > >> + * @start: the start of the bit range, inclusive > > >> + * @end: the end of the bit range, inclusive > > >> + * > > >> + * This function is used

RE: [PATCH v18 07/10] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-11-30 Thread Wang, Wei W
On Thursday, November 30, 2017 6:36 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > +static inline int xb_set_page(struct virtio_balloon *vb, > > + struct page *page, > > + unsigned long *pfn_min, > > + unsigned long

RE: [PATCH v18 07/10] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-11-30 Thread Wang, Wei W
On Thursday, November 30, 2017 6:36 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > +static inline int xb_set_page(struct virtio_balloon *vb, > > + struct page *page, > > + unsigned long *pfn_min, > > + unsigned long

RE: [virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-11-17 Thread Wang, Wei W
On Friday, November 17, 2017 8:45 PM, Michael S. Tsirkin wrote: > On Fri, Nov 17, 2017 at 07:35:03PM +0800, Wei Wang wrote: > > On 11/16/2017 09:27 PM, Wei Wang wrote: > > > On 11/16/2017 04:32 AM, Michael S. Tsirkin wrote: > > > > On Fri, Nov 03, 2017 at 04:13:06PM +0800, Wei Wang wrote: > > > >

RE: [virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-11-17 Thread Wang, Wei W
On Friday, November 17, 2017 8:45 PM, Michael S. Tsirkin wrote: > On Fri, Nov 17, 2017 at 07:35:03PM +0800, Wei Wang wrote: > > On 11/16/2017 09:27 PM, Wei Wang wrote: > > > On 11/16/2017 04:32 AM, Michael S. Tsirkin wrote: > > > > On Fri, Nov 03, 2017 at 04:13:06PM +0800, Wei Wang wrote: > > > >

RE: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ

2017-10-02 Thread Wang, Wei W
On Sunday, October 1, 2017 11:19 AM, Michael S. Tsirkin wrote: > On Sat, Sep 30, 2017 at 12:05:54PM +0800, Wei Wang wrote: > > +static void ctrlq_send_cmd(struct virtio_balloon *vb, > > + struct virtio_balloon_ctrlq_cmd *cmd, > > + bool inbuf) > > +{ > > +

RE: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ

2017-10-02 Thread Wang, Wei W
On Sunday, October 1, 2017 11:19 AM, Michael S. Tsirkin wrote: > On Sat, Sep 30, 2017 at 12:05:54PM +0800, Wei Wang wrote: > > +static void ctrlq_send_cmd(struct virtio_balloon *vb, > > + struct virtio_balloon_ctrlq_cmd *cmd, > > + bool inbuf) > > +{ > > +

RE: [PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-10-02 Thread Wang, Wei W
On Monday, October 2, 2017 12:30 PM, Michael S. Tsirkin wrote: > On Sat, Sep 30, 2017 at 12:05:52PM +0800, Wei Wang wrote: > > +static int send_balloon_page_sg(struct virtio_balloon *vb, > > +struct virtqueue *vq, > > +void *addr, > > +

RE: [PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-10-02 Thread Wang, Wei W
On Monday, October 2, 2017 12:30 PM, Michael S. Tsirkin wrote: > On Sat, Sep 30, 2017 at 12:05:52PM +0800, Wei Wang wrote: > > +static int send_balloon_page_sg(struct virtio_balloon *vb, > > +struct virtqueue *vq, > > +void *addr, > > +

RE: [PATCH v15 2/5] lib/xbitmap: add xb_find_next_bit() and xb_zero()

2017-09-29 Thread Wang, Wei W
On Monday, September 11, 2017 9:27 PM, Matthew Wilcox wrote > On Mon, Aug 28, 2017 at 06:08:30PM +0800, Wei Wang wrote: > > +/** > > + * xb_zero - zero a range of bits in the xbitmap > > + * @xb: the xbitmap that the bits reside in > > + * @start: the start of the range, inclusive > > + *

RE: [PATCH v15 2/5] lib/xbitmap: add xb_find_next_bit() and xb_zero()

2017-09-29 Thread Wang, Wei W
On Monday, September 11, 2017 9:27 PM, Matthew Wilcox wrote > On Mon, Aug 28, 2017 at 06:08:30PM +0800, Wei Wang wrote: > > +/** > > + * xb_zero - zero a range of bits in the xbitmap > > + * @xb: the xbitmap that the bits reside in > > + * @start: the start of the range, inclusive > > + *

RE: [PATCH v15 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ

2017-09-05 Thread Wang, Wei W
Ping for comments if possible. Thanks. On Monday, August 28, 2017 6:09 PM, Wang, Wei W wrote: > [PATCH v15 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ > > Add a new vq, ctrl_vq, to handle commands between the host and guest. > With this feature, we will be able to have the c

RE: [PATCH v15 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ

2017-09-05 Thread Wang, Wei W
Ping for comments if possible. Thanks. On Monday, August 28, 2017 6:09 PM, Wang, Wei W wrote: > [PATCH v15 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ > > Add a new vq, ctrl_vq, to handle commands between the host and guest. > With this feature, we will be able to have the c

RE: [PATCH] MAINTAINERS: copy virtio on balloon_compaction.c

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:36 PM, Rafael Aquini wrote: > On Thu, Aug 03, 2017 at 03:42:52PM +0300, Michael S. Tsirkin wrote: > > Changes to mm/balloon_compaction.c can easily break virtio, and virtio > > is the only user of that interface. Add a line to MAINTAINERS so > > whoever changes that

RE: [PATCH] MAINTAINERS: copy virtio on balloon_compaction.c

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:36 PM, Rafael Aquini wrote: > On Thu, Aug 03, 2017 at 03:42:52PM +0300, Michael S. Tsirkin wrote: > > Changes to mm/balloon_compaction.c can easily break virtio, and virtio > > is the only user of that interface. Add a line to MAINTAINERS so > > whoever changes that

RE: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > As I've said earlier. Start simple optimize incrementally with some numbers to > justify a more subtle code. > -- OK. Let's start with the simple implementation as you suggested. Best, Wei

RE: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > As I've said earlier. Start simple optimize incrementally with some numbers to > justify a more subtle code. > -- OK. Let's start with the simple implementation as you suggested. Best, Wei

RE: [PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 10:23 PM, Michael S. Tsirkin wrote: > On Thu, Aug 03, 2017 at 02:38:17PM +0800, Wei Wang wrote: > > +static void send_one_sg(struct virtio_balloon *vb, struct virtqueue *vq, > > + void *addr, uint32_t size) > > +{ > > + struct scatterlist sg; > > +

RE: [PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 10:23 PM, Michael S. Tsirkin wrote: > On Thu, Aug 03, 2017 at 02:38:17PM +0800, Wei Wang wrote: > > +static void send_one_sg(struct virtio_balloon *vb, struct virtqueue *vq, > > + void *addr, uint32_t size) > > +{ > > + struct scatterlist sg; > > +

RE: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-30 Thread Wang, Wei W
On Sunday, July 30, 2017 12:23 PM, Michael S. Tsirkin wrote: > On Sat, Jul 29, 2017 at 08:47:08PM +0800, Wei Wang wrote: > > On 07/29/2017 07:08 AM, Michael S. Tsirkin wrote: > > > On Thu, Jul 27, 2017 at 10:50:11AM +0800, Wei Wang wrote: > > > > > > > OK I thought this over. While we might need

RE: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-30 Thread Wang, Wei W
On Sunday, July 30, 2017 12:23 PM, Michael S. Tsirkin wrote: > On Sat, Jul 29, 2017 at 08:47:08PM +0800, Wei Wang wrote: > > On 07/29/2017 07:08 AM, Michael S. Tsirkin wrote: > > > On Thu, Jul 27, 2017 at 10:50:11AM +0800, Wei Wang wrote: > > > > > > > OK I thought this over. While we might need

RE: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-26 Thread Wang, Wei W
On Wednesday, July 26, 2017 7:55 PM, Michal Hocko wrote: > On Wed 26-07-17 19:44:23, Wei Wang wrote: > [...] > > I thought about it more. Probably we can use the callback function > > with a little change like this: > > > > void walk_free_mem(void *opaque1, void (*visit)(void *opaque2, > >

RE: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-26 Thread Wang, Wei W
On Wednesday, July 26, 2017 7:55 PM, Michal Hocko wrote: > On Wed 26-07-17 19:44:23, Wei Wang wrote: > [...] > > I thought about it more. Probably we can use the callback function > > with a little change like this: > > > > void walk_free_mem(void *opaque1, void (*visit)(void *opaque2, > >

RE: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wang, Wei W
On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: > On Tue 25-07-17 19:56:24, Wei Wang wrote: > > On 07/25/2017 07:25 PM, Michal Hocko wrote: > > >On Tue 25-07-17 17:32:00, Wei Wang wrote: > > >>On 07/24/2017 05:00 PM, Michal Hocko wrote: > > >>>On Wed 19-07-17 20:01:18, Wei Wang wrote: > >

RE: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wang, Wei W
On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: > On Tue 25-07-17 19:56:24, Wei Wang wrote: > > On 07/25/2017 07:25 PM, Michal Hocko wrote: > > >On Tue 25-07-17 17:32:00, Wei Wang wrote: > > >>On 07/24/2017 05:00 PM, Michal Hocko wrote: > > >>>On Wed 19-07-17 20:01:18, Wei Wang wrote: > >

RE: [PATCH v11 0/6] Virtio-balloon Enhancement

2017-06-09 Thread Wang, Wei W
On Friday, June 9, 2017 6:42 PM, Wang, Wei W wrote: > To: virtio-...@lists.oasis-open.org; linux-kernel@vger.kernel.org; qemu- > de...@nongnu.org; virtualizat...@lists.linux-foundation.org; > k...@vger.kernel.org; linux...@kvack.org; m...@redhat.com; > da...@redhat.com; Hansen, Da

RE: [PATCH v11 0/6] Virtio-balloon Enhancement

2017-06-09 Thread Wang, Wei W
On Friday, June 9, 2017 6:42 PM, Wang, Wei W wrote: > To: virtio-...@lists.oasis-open.org; linux-kernel@vger.kernel.org; qemu- > de...@nongnu.org; virtualizat...@lists.linux-foundation.org; > k...@vger.kernel.org; linux...@kvack.org; m...@redhat.com; > da...@redhat.com; Hansen, Dave ;

RE: [PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:21 AM, Michael S. Tsirkin wrote: > On Thu, Apr 27, 2017 at 02:33:44PM +0800, Wei Wang wrote: > > On 04/14/2017 01:08 AM, Michael S. Tsirkin wrote: > > > On Thu, Apr 13, 2017 at 05:35:08PM +0800, Wei Wang wrote: > > > > Add a new vq, miscq, to handle miscellaneous requests between

RE: [PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:21 AM, Michael S. Tsirkin wrote: > On Thu, Apr 27, 2017 at 02:33:44PM +0800, Wei Wang wrote: > > On 04/14/2017 01:08 AM, Michael S. Tsirkin wrote: > > > On Thu, Apr 13, 2017 at 05:35:08PM +0800, Wei Wang wrote: > > > > Add a new vq, miscq, to handle miscellaneous requests between

RE: [PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:29 AM, Michael S. Tsirkin wrote: > On Thu, May 04, 2017 at 04:50:12PM +0800, Wei Wang wrote: > > Add a new feature, VIRTIO_BALLOON_F_PAGE_CHUNKS, which enables the > > transfer of the ballooned (i.e. inflated/deflated) pages in chunks to > > the host. > > > > The implementation of

RE: [PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:29 AM, Michael S. Tsirkin wrote: > On Thu, May 04, 2017 at 04:50:12PM +0800, Wei Wang wrote: > > Add a new feature, VIRTIO_BALLOON_F_PAGE_CHUNKS, which enables the > > transfer of the ballooned (i.e. inflated/deflated) pages in chunks to > > the host. > > > > The implementation of

RE: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:26 AM, Michael S. Tsirkin wrote: > On Thu, Apr 27, 2017 at 02:31:49PM +0800, Wei Wang wrote: > > On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: > > > On Wed, Apr 26, 2017 at 11:03:34AM +, Wang, Wei W wrote: > > > > Hi Michael, could you please

RE: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-05-07 Thread Wang, Wei W
On 05/06/2017 06:26 AM, Michael S. Tsirkin wrote: > On Thu, Apr 27, 2017 at 02:31:49PM +0800, Wei Wang wrote: > > On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: > > > On Wed, Apr 26, 2017 at 11:03:34AM +, Wang, Wei W wrote: > > > > Hi Michael, could you please

RE: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-26 Thread Wang, Wei W
Hi Michael, could you please give some feedback? On Monday, April 17, 2017 11:35 AM, Wei Wang wrote: > On 04/15/2017 05:38 AM, Michael S. Tsirkin wrote: > > On Fri, Apr 14, 2017 at 04:37:52PM +0800, Wei Wang wrote: > >> On 04/14/2017 12:34 AM, Michael S. Tsirkin wrote: > >>> On Thu, Apr 13, 2017

RE: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-26 Thread Wang, Wei W
Hi Michael, could you please give some feedback? On Monday, April 17, 2017 11:35 AM, Wei Wang wrote: > On 04/15/2017 05:38 AM, Michael S. Tsirkin wrote: > > On Fri, Apr 14, 2017 at 04:37:52PM +0800, Wei Wang wrote: > >> On 04/14/2017 12:34 AM, Michael S. Tsirkin wrote: > >>> On Thu, Apr 13, 2017

RE: [PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-04-05 Thread Wang, Wei W
On Wednesday, April 5, 2017 12:31 PM, Wei Wang wrote: > On Wednesday, April 5, 2017 11:54 AM, Michael S. Tsirkin wrote: > > On Wed, Apr 05, 2017 at 03:31:36AM +0000, Wang, Wei W wrote: > > > On Thursday, March 16, 2017 3:09 PM Wei Wang wrote: > > > > The implem

RE: [PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-04-05 Thread Wang, Wei W
On Wednesday, April 5, 2017 12:31 PM, Wei Wang wrote: > On Wednesday, April 5, 2017 11:54 AM, Michael S. Tsirkin wrote: > > On Wed, Apr 05, 2017 at 03:31:36AM +0000, Wang, Wei W wrote: > > > On Thursday, March 16, 2017 3:09 PM Wei Wang wrote: > > > > The implem

RE: [PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-04-04 Thread Wang, Wei W
On Wednesday, April 5, 2017 11:54 AM, Michael S. Tsirkin wrote: > On Wed, Apr 05, 2017 at 03:31:36AM +0000, Wang, Wei W wrote: > > On Thursday, March 16, 2017 3:09 PM Wei Wang wrote: > > > The implementation of the current virtio-balloon is not very > > > efficient,

  1   2   >