[PATCH v1 1/1] mm/ksm: fix interaction with THP

2018-03-12 Thread Claudio Imbrenda
ng if the two pages to merge belong to the same hugepage when attempting to merge them. If so, the hugepage is split safely. This means that the hugepage is not split if not necessary. Signed-off-by: Gerald Schaefer Signed-off-by: Claudio Imbrenda --- mm/ksm.c | 9 - 1 file changed,

[PATCH v3 1/1] mm/ksm: fix interaction with THP

2018-03-20 Thread Claudio Imbrenda
ng if the two pages to merge belong to the same hugepage when attempting to merge them. If so, the hugepage is split safely. This means that the hugepage is not split if not necessary. Co-authored-by: Gerald Schaefer Signed-off-by: Claudio Imbrenda --- mm/ksm.c | 28

Re: [PATCH v1 1/1] mm/ksm: fix interaction with THP

2018-03-13 Thread Claudio Imbrenda
On Mon, 12 Mar 2018 14:22:10 -0700 Andrew Morton wrote: > On Mon, 12 Mar 2018 17:42:17 +0100 Claudio Imbrenda > wrote: > > > This patch fixes a corner case for KSM. When two pages belong or > > belonged to the same transparent hugepage, and they should be > > mer

Re: [PATCH RFC v2] ksm: Assist buddy allocator to assemble 1-order pages

2018-10-15 Thread Claudio Imbrenda
I don't have objections to this patch, but I wonder how much impact it would have. Have you performed any tests? does it really have such a big impact on the availability of order-1 page blocks? Claudio On Mon, 15 Oct 2018 12:33:36 +0300 Kirill Tkhai wrote: > v2: Style improvements > > try_t

[PATCH v1 1/1] mm/ksm: fix inconsistent accounting of zero pages

2018-04-05 Thread Claudio Imbrenda
: e86c59b1b1 ("mm/ksm: improve deduplication of zero pages with colouring") Signed-off-by: Claudio Imbrenda --- mm/ksm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/ksm.c b/mm/ksm.c index 293721f..2d6b352 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1131,6 +1131,13 @@

[PATCH v4 0/2] s390/kvm: fix MVPG when in VSIE

2021-02-23 Thread Claudio Imbrenda
ded small comment to explain what they are about v2->v3 * improved some comments * improved some variable and parameter names for increased readability * fixed missing handling of page faults in the MVPG handler * small readability improvements v1->v2 * complete rewrite Claudio Imbrenda (2

[PATCH v4 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-23 Thread Claudio Imbrenda
, region) tables. PEI_NOT_PTE: indicates that the address of the DAT table entry returned does not refer to a PTE, but to a segment or region table. Signed-off-by: Claudio Imbrenda Cc: sta...@vger.kernel.org Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand --- arch/s390/kvm

[PATCH v4 2/2] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-02-23 Thread Claudio Imbrenda
Correctly handle the MVPG instruction when issued by a VSIE guest. Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda Acked-by: Janosch Frank --- arch/s390/kvm/v

Re: [PATCH v3 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-11 Thread Claudio Imbrenda
On Thu, 11 Feb 2021 10:18:56 +0100 David Hildenbrand wrote: > On 09.02.21 16:43, Claudio Imbrenda wrote: > > Extend kvm_s390_shadow_fault to return the pointer to the valid leaf > > DAT table entry, or to the invalid entry. > > > > Also return some flags in th

[PATCH v2 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-02 Thread Claudio Imbrenda
) tables NOT_PTE: indicates that the address of the DAT table entry returned does not refer to a PTE, but to a segment or region table. Signed-off-by: Claudio Imbrenda Cc: sta...@vger.kernel.org --- arch/s390/kvm/gaccess.c | 26 ++ arch/s390/kvm/gaccess.h | 5

[PATCH v2 2/2] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-02-02 Thread Claudio Imbrenda
Correctly handle the MVPG instruction when issued by a VSIE guest. Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 94 +-

[PATCH v2 0/2] s390/kvm: fix MVPG when in VSIE

2021-02-02 Thread Claudio Imbrenda
The current handling of the MVPG instruction when executed in a nested guest is wrong, and can lead to the nested guest hanging. This patchset fixes the behaviour to be more architecturally correct, and fixes the hangs observed. v1->v2 * complete rewrite Claudio Imbrenda (2): s390/kvm: ext

Re: [PATCH v2 2/2] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-02-03 Thread Claudio Imbrenda
On Tue, 2 Feb 2021 19:00:28 +0100 Claudio Imbrenda wrote: > Correctly handle the MVPG instruction when issued by a VSIE guest. > > Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested > virtualization") Cc: sta...@vger.kernel.org > Signed-off-by: Claudi

Re: [PATCH v2 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-05 Thread Claudio Imbrenda
On Thu, 4 Feb 2021 17:34:00 +0100 Janosch Frank wrote: > On 2/2/21 7:00 PM, Claudio Imbrenda wrote: > > Extend kvm_s390_shadow_fault to return the pointer to the valid leaf > > DAT table entry, or to the invalid entry. > > > > Also return some flags in th

Re: [PATCH v2 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-05 Thread Claudio Imbrenda
On Thu, 4 Feb 2021 18:05:15 +0100 Janosch Frank wrote: > On 2/4/21 5:34 PM, Janosch Frank wrote: > > On 2/2/21 7:00 PM, Claudio Imbrenda wrote: > >> Extend kvm_s390_shadow_fault to return the pointer to the valid > >> leaf DAT table entry, or to the invalid entry.

Re: [PATCH v2 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-05 Thread Claudio Imbrenda
On Fri, 5 Feb 2021 13:56:53 +0100 Janosch Frank wrote: > On 2/5/21 1:15 PM, Claudio Imbrenda wrote: > > On Thu, 4 Feb 2021 17:34:00 +0100 > > Janosch Frank wrote: > > > >> On 2/2/21 7:00 PM, Claudio Imbrenda wrote: > >>> Extend kvm_s390_shado

[PATCH v3 2/2] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-02-09 Thread Claudio Imbrenda
Correctly handle the MVPG instruction when issued by a VSIE guest. Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 93 +-

[PATCH v3 0/2] s390/kvm: fix MVPG when in VSIE

2021-02-09 Thread Claudio Imbrenda
and parameter names for increased readability * fixed missing handling of page faults in the MVPG handler * small readability improvements v1->v2 * complete rewrite Claudio Imbrenda (2): s390/kvm: extend kvm_s390_shadow_fault to return entry pointer s390/kvm: VSIE: correctly handle MVPG when i

[PATCH v3 1/2] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-02-09 Thread Claudio Imbrenda
) tables NOT_PTE: indicates that the address of the DAT table entry returned does not refer to a PTE, but to a segment or region table. Signed-off-by: Claudio Imbrenda Cc: sta...@vger.kernel.org --- arch/s390/kvm/gaccess.c | 30 +- arch/s390/kvm/gaccess.h | 5

Re: [PATCH 2/2] s390: mm: Fix secure storage access exception handling

2021-01-19 Thread Claudio Imbrenda
On Tue, 19 Jan 2021 05:04:02 -0500 Janosch Frank wrote: > Turns out that the bit 61 in the TEID is not always 1 and if that's > the case the address space ID and the address are > unpredictable. Without an address and it's address space ID we can't *its Reviewed-by: Cla

Re: [PATCH 1/2] s390: uv: Fix sysfs max number of VCPUs reporting

2021-01-19 Thread Claudio Imbrenda
; limit. > > The naming of the field is a bit misleading. Number in this context is > used like ID and starts at 0. The query field denotes the maximum > number that can be put into the VCPU number field in the "create > secure CPU" UV call. once you address Christian'

[PATCH v1 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-19 Thread Claudio Imbrenda
;) Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 48aab6290a77..92864f9b3d84 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c

[PATCH v1 0/2] s390/kvm: VSIE: fix prefixing and MSO for MVPG

2021-03-19 Thread Claudio Imbrenda
The guest real address needs to pass through prefixing in order to yield the absolute address. The absolute address needs to be offset by the MSO in order to get the host virtual address. Claudio Imbrenda (2): s390/kvm: split kvm_s390_real_to_abs s390/kvm: VSIE: fix MVPG handling for

[PATCH v1 1/2] s390/kvm: split kvm_s390_real_to_abs

2021-03-19 Thread Claudio Imbrenda
A new function _kvm_s390_real_to_abs will apply prefixing to a real address with a given prefix value. The old kvm_s390_real_to_abs becomes now a wrapper around the new function. This is needed to avoid code duplication in vSIE. Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda

Re: [PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-23 Thread Claudio Imbrenda
On Tue, 23 Mar 2021 16:16:18 +0100 Christian Borntraeger wrote: > On 23.03.21 16:11, David Hildenbrand wrote: > > On 23.03.21 16:07, Christian Borntraeger wrote: > >> > >> > >> On 22.03.21 15:05, Claudio Imbrenda wrote: > >>> Prefixing

[PATCH v2 1/2] s390/kvm: split kvm_s390_real_to_abs

2021-03-22 Thread Claudio Imbrenda
A new function _kvm_s390_real_to_abs will apply prefixing to a real address with a given prefix value. The old kvm_s390_real_to_abs becomes now a wrapper around the new function. This is needed to avoid code duplication in vSIE. Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda

[PATCH v2 0/2] s390/kvm: VSIE: fix prefixing and MSO for MVPG

2021-03-22 Thread Claudio Imbrenda
to improve readability Claudio Imbrenda (2): s390/kvm: split kvm_s390_real_to_abs s390/kvm: VSIE: fix MVPG handling for prefixing and MSO arch/s390/kvm/gaccess.h | 23 +-- arch/s390/kvm/vsie.c| 6 +- 2 files changed, 22 insertions(+), 7 deletions(-) -- 2.26.2

[PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-22 Thread Claudio Imbrenda
;) Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda Reported-by: Janosch Frank --- arch/s390/kvm/vsie.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 48aab6290a77..ac86f11e46dc 100644 --- a/arch/s390/kvm/vsie.c +++ b/arc

[PATCH v1 0/4] s390/kvm: fix MVPG when in VSIE

2020-12-18 Thread Claudio Imbrenda
The current handling of the MVPG instruction when executed in a nested guest is wrong, and can lead to the nested guest hanging. This patchset fixes the behaviour to be more architecturally correct, and fixes the hangs observed. Claudio Imbrenda (4): s390/kvm: VSIE: stop leaking host addresses

[PATCH v1 1/4] s390/kvm: VSIE: stop leaking host addresses

2020-12-18 Thread Claudio Imbrenda
s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 4f3cbf6003a9..ada49583e530 100644 --- a/arc

[PATCH v1 2/4] s390/kvm: extend guest_translate for MVPG interpretation

2020-12-18 Thread Claudio Imbrenda
Extend guest_translate to optionally return the address of the guest DAT table which caused the exception, and change the return value to int. Also return the appropriate values in the low order bits of the address indicating protection or EDAT. Cc: sta...@vger.kernel.org Signed-off-by: Claudio

[PATCH v1 3/4] s390/kvm: add kvm_s390_vsie_mvpg_check needed for VSIE MVPG

2020-12-18 Thread Claudio Imbrenda
Add kvm_s390_vsie_mvpg_check to perform the necessary checks in case an MVPG instruction intercepts in a VSIE guest. Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/gaccess.c | 55 + arch/s390/kvm/gaccess.h | 3 +++ 2 files

[PATCH v1 4/4] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2020-12-18 Thread Claudio Imbrenda
Correctly handle the MVPG instruction when issued by a VSIE guest. Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 73 ++

[PATCH v5 2/3] s390/kvm: extend kvm_s390_shadow_fault to return entry pointer

2021-03-02 Thread Claudio Imbrenda
, region) tables. PEI_NOT_PTE: indicates that the address of the DAT table entry returned does not refer to a PTE, but to a segment or region table. Signed-off-by: Claudio Imbrenda Cc: sta...@vger.kernel.org Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand --- arch/s390/kvm

[PATCH v5 3/3] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-03-02 Thread Claudio Imbrenda
Correctly handle the MVPG instruction when issued by a VSIE guest. Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested virtualization") Cc: sta...@vger.kernel.org Signed-off-by: Claudio Imbrenda Acked-by: Janosch Frank Reviewed-by: David Hildenbrand --- arch/s390/

[PATCH v5 1/3] s390/kvm: split kvm_s390_logical_to_effective

2021-03-02 Thread Claudio Imbrenda
needed to avoid code duplication for vSIE. Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/gaccess.h | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/arch/s390/kvm/gaccess.h b/arch/s390/kvm/gaccess.h index f4c51756c462..107fdfd2eadd 100644 --- a

[PATCH v5 0/3] s390/kvm: fix MVPG when in VSIE

2021-03-02 Thread Claudio Imbrenda
variable and parameter names for increased readability * fixed missing handling of page faults in the MVPG handler * small readability improvements v1->v2 * complete rewrite Claudio Imbrenda (3): s390/kvm: split kvm_s390_logical_to_effective s390/kvm: extend kvm_s390_shadow_fault to return e

Re: [PATCH v5 0/3] s390/kvm: fix MVPG when in VSIE

2021-03-08 Thread Claudio Imbrenda
On Mon, 8 Mar 2021 16:26:58 +0100 Janosch Frank wrote: > On 3/8/21 4:19 PM, Christian Borntraeger wrote: > > On 02.03.21 18:44, Claudio Imbrenda wrote: > >> The current handling of the MVPG instruction when executed in a > >> nested guest is wrong, and can lead

Re: [PATCH v2 2/2] s390: mm: Fix secure storage access exception handling

2021-01-22 Thread Claudio Imbrenda
} else > + panic("Unexpected PGM 0x3d with TEID bit > 61=0"); > + } > + > switch (get_fault_type(regs)) { > case USER_FAULT: > mm = current->mm; Reviewed-by: Claudio Imbrenda

Re: [PATCH v2 2/2] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-02-05 Thread Claudio Imbrenda
On Thu, 4 Feb 2021 18:10:01 +0100 Janosch Frank wrote: > On 2/2/21 7:00 PM, Claudio Imbrenda wrote: > > Correctly handle the MVPG instruction when issued by a VSIE guest. > > > > Fixes: a3508fbe9dc6d ("KVM: s390: vsie: initial support for nested > > virtualizat

Re: [PATCH v1 4/4] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-01-04 Thread Claudio Imbrenda
On Sun, 20 Dec 2020 11:13:57 +0100 David Hildenbrand wrote: > On 18.12.20 15:18, Claudio Imbrenda wrote: > > Correctly handle the MVPG instruction when issued by a VSIE guest. > > > > I remember that MVPG SIE documentation was completely crazy and full > of corner

Re: [PATCH v1 0/4] s390/kvm: fix MVPG when in VSIE

2021-01-04 Thread Claudio Imbrenda
On Sun, 20 Dec 2020 10:40:27 +0100 David Hildenbrand wrote: > On 18.12.20 15:18, Claudio Imbrenda wrote: > > The current handling of the MVPG instruction when executed in a > > nested guest is wrong, and can lead to the nested guest hanging. > > Hi, > > thanks for

Re: [PATCH v1 1/4] s390/kvm: VSIE: stop leaking host addresses

2021-01-04 Thread Claudio Imbrenda
On Sun, 20 Dec 2020 10:44:56 +0100 David Hildenbrand wrote: > On 18.12.20 15:18, Claudio Imbrenda wrote: > > The addresses in the SIE control block of the host should not be > > forwarded to the guest. They are only meaningful to the host, and > > moreover it would be a

Re: [PATCH v1 4/4] s390/kvm: VSIE: correctly handle MVPG when in VSIE

2021-01-04 Thread Claudio Imbrenda
On Mon, 4 Jan 2021 17:08:15 +0100 David Hildenbrand wrote: > On 04.01.21 16:22, Claudio Imbrenda wrote: > > On Sun, 20 Dec 2020 11:13:57 +0100 > > David Hildenbrand wrote: > > > >> On 18.12.20 15:18, Claudio Imbrenda wrote: > >>> Correctly handle

Re: [PATCH] kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset()

2019-09-10 Thread Claudio Imbrenda
gt; + } > > /* > > * The second half of the bitmap is only used on > > x86, > > * and would be wasted otherwise, so we put it to > > good Otherwise it looks good. Claudio Imbrenda

Re: [PATCH] KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset()

2019-09-10 Thread Claudio Imbrenda
>memslots + slotnr; > + if (!ms->dirty_bitmap) > + return -EINVAL; > /* >* The second half of the bitmap is only used on x86, >* and would be wasted otherwise, so we put it to > good Reviewed-by: Claudio Imbrenda

[PATCH v2 1/1] fs/splice: add missing callback for inaccessible pages

2020-04-30 Thread Claudio Imbrenda
that do not need to deal with inaccessible pages. Fixes: f28d43636d6f ("mm/gup/writeback: add callbacks for inaccessible pages") Signed-off-by: Claudio Imbrenda --- fs/splice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/splice.c b/fs/splice.c index 4735defc46ee..f026e0ce9

Re: [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages

2020-04-30 Thread Claudio Imbrenda
On Wed, 29 Apr 2020 16:52:46 -0700 Dave Hansen wrote: > On 4/29/20 3:53 PM, Claudio Imbrenda wrote: > >> Actually, that's the problem. You've gone through all these > >> careful checks and made the page inaccessible. *After* that > >> process, how do yo

[PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages

2020-04-28 Thread Claudio Imbrenda
issue. Fixes: f28d43636d6f ("mm/gup/writeback: add callbacks for inaccessible pages") Signed-off-by: Claudio Imbrenda --- fs/splice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/splice.c b/fs/splice.c index 4735defc46ee..f026e0ce9acd 100644 --- a/fs/splice.c +++ b/fs/splice.c

Re: [PATCH v4 2/2] mm/gup/writeback: add callbacks for inaccessible pages

2020-04-28 Thread Claudio Imbrenda
On Tue, 28 Apr 2020 12:43:45 -0700 Dave Hansen wrote: > On 4/21/20 2:31 PM, Dave Hansen wrote: > > On 4/16/20 12:02 PM, Dave Hansen wrote: > >> On 4/16/20 9:34 AM, Claudio Imbrenda wrote: > >>>> Ahh, so this is *just* intended to precede I/O done on the page,

Re: [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages

2020-04-29 Thread Claudio Imbrenda
On Wed, 29 Apr 2020 10:55:52 -0700 Dave Hansen wrote: > On 4/29/20 10:31 AM, Christian Borntraeger wrote: > > On 29.04.20 18:07, Dave Hansen wrote: > >> On 4/28/20 3:50 PM, Claudio Imbrenda wrote: > >>> If a page is inaccesible and it is used for things like se

Re: [PATCH] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-05-03 Thread Claudio Imbrenda
) continue; > > - if (!rwc->rmap_one(page, vma, > - rmap_item->address, > rwc->arg)) { > + if (addr & STABLE_FLAG) > + addr &= ~KSM_FLAG_MASK; then you would not need the IF above, and it would be more readable. > + > + if (!rwc->rmap_one(page, vma, addr, > rwc->arg)) { anon_vma_unlock_read(anon_vma); > return; > } best regards, Claudio Imbrenda

[PATCH v2 1/1] mm/ksm: fix interaction with THP

2018-03-16 Thread Claudio Imbrenda
ng if the two pages to merge belong to the same hugepage when attempting to merge them. If so, the hugepage is split safely. This means that the hugepage is not split if not necessary. Co-authored-by: Gerald Schaefer Signed-off-by: Claudio Imbrenda --- mm/ksm.c | 28

Re: [PATCH v1 1/1] mm/ksm: improve deduplication of zero pages with colouring

2017-01-18 Thread Claudio Imbrenda
Hi Andrea, On 12/01/17 18:21, Andrea Arcangeli wrote: > Hello Claudio, > > On Thu, Jan 12, 2017 at 05:17:14PM +0100, Claudio Imbrenda wrote: >> +#ifdef __HAVE_COLOR_ZERO_PAGE >> +/* >> + * Same checksum as an empty page. We attempt to merge it with the >&

Re: [PATCH v1 1/1] mm/ksm: improve deduplication of zero pages with colouring

2017-01-18 Thread Claudio Imbrenda
On 18/01/17 17:29, Andrea Arcangeli wrote: > It's still good to be able to exercise this code on all archs (if > nothing else for debugging purposes). There's nothing arch dependent > in it after all. If it's fine for you, I'm definitely not going to complain :) >> ZERO_PAGE() would save exactly

[PATCH v2 1/1] mm/ksm: improve deduplication of zero pages with colouring

2017-01-19 Thread Claudio Imbrenda
coloured zero pages. The default value is disabled, for backwards compatibility. With this patch, the performance with KSM is the same as with non COW-broken actual zero pages, which is also the same as without KSM. Signed-off-by: Claudio Imbrenda --- mm/ksm.c | 68

[PATCH v3 1/1] mm/ksm: documentation for coloured zero pages deduplication

2017-01-20 Thread Claudio Imbrenda
This patch adds the needed documentation for the use_zero_pages property. Signed-off-by: Claudio Imbrenda --- Documentation/vm/ksm.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt index f34a8ee..0c64a81d 100644 --- a

[PATCH v1 1/1] mm/ksm: improve deduplication of zero pages with colouring

2017-01-12 Thread Claudio Imbrenda
: Claudio Imbrenda --- mm/ksm.c | 29 + 1 file changed, 29 insertions(+) diff --git a/mm/ksm.c b/mm/ksm.c index 9ae6011..b0cfc30 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -223,6 +223,11 @@ struct rmap_item { /* Milliseconds ksmd should sleep between batches */ static unsigned

Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait

2016-03-11 Thread Claudio Imbrenda
ons. This patch shrinks the influence of prepare_to_wait to the area where it is strictly needed, therefore relaxing the no-sleep restriction there. Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/af_vsock.c | 158 +-- 1 file changed, 85 insertions(+

[PATCH v3 0/2] AF_VSOCK: Shrink the area influenced by prepare_to_wait

2016-03-22 Thread Claudio Imbrenda
checked but before the sleep happens, and we miss it. ( A description of the problem can be found here: http://www.makelinux.net/ldd3/chp-6-sect-2 ). The first patch reverts the previous broken patch, while the second patch properly fixes the sleep-while-waiting issue. Claudio Imbrenda (2): Revert

[PATCH v3 1/2] Revert "vsock: Fix blocking ops call in prepare_to_wait"

2016-03-22 Thread Claudio Imbrenda
nd the schedule) but at least it will not miss wakeups. The next patch in the series actually fixes the behaviour. Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/af_vsock.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c

[PATCH v3 2/2] AF_VSOCK: Shrink the area influenced by prepare_to_wait

2016-03-22 Thread Claudio Imbrenda
influence of prepare_to_wait to the area where it is strictly needed, therefore relaxing the no-sleep restriction there. Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/af_vsock.c | 158 +-- 1 file changed, 85 insertions(+), 73 deletions(-) diff --git a

[PATCH v2 2/2] AF_VSOCK: Shrink the area influenced by prepare_to_wait

2016-03-19 Thread Claudio Imbrenda
influence of prepare_to_wait to the area where it is strictly needed, therefore relaxing the no-sleep restriction there. Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/af_vsock.c | 158 +-- 1 file changed, 85 insertions(+), 73 deletions(-) diff --git a

[PATCH v2 1/2] Revert "vsock: Fix blocking ops call in prepare_to_wait"

2016-03-19 Thread Claudio Imbrenda
This reverts commit 5988818008257ca42010d6b43a3e0e48afec9898 ("vsock: Fix blocking ops call in prepare_to_wait") Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/af_vsock.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/net/vmw_vsock/af_vso

[PATCH v2 0/2] AF_VSOCK: Shrink the area influenced by prepare_to_wait

2016-03-19 Thread Claudio Imbrenda
I'm resending as requested. This patchset applies on net-next. And sorry for the mis-formatting of the previous message. Claudio Imbrenda (2): Revert "vsock: Fix blocking ops call in prepare_to_wait" AF_VSOCK: Shrink the area influenced by prepare_to_wait net/vmw_vsock/a

[PATCH v1 1/1] KVM: add missing kvm_put_kvm in case of failure

2017-06-27 Thread Claudio Imbrenda
s") This patch simply restores the call to kvm_put_kvm, so that the kvm object is destroyed before returning an error. Signed-off-by: Claudio Imbrenda Fixes: 506cfba9e726 ("KVM: don't use anon_inode_getfd() before possible failures") --- virt/kvm/kvm_main.c | 1 + 1 file ch

[PATCH v5 0/1] KVM: trigger uevents when creating or destroying a VM

2017-07-12 Thread Claudio Imbrenda
v3: * added EVENT * shortened the names of the other variables v1 -> v2: * added KVM_VM_PID and KVM_VM_STATS_PATH * some cleanup, the patch should look nicer now * rebased on 4.12 Claudio Imbrenda (1): KVM: trigger uevents when creating or destroying

[PATCH v5 1/1] KVM: trigger uevents when creating or destroying a VM

2017-07-12 Thread Claudio Imbrenda
erspace to deal with the creation or destruction of VMs as needed. Signed-off-by: Claudio Imbrenda --- virt/kvm/kvm_main.c | 69 + 1 file changed, 69 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f0fe9d0..24ad3f5 1

[PATCH v3 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-10 Thread Claudio Imbrenda
erspace to deal with the creation or destruction of VMs as needed. Signed-off-by: Claudio Imbrenda --- virt/kvm/kvm_main.c | 59 + 1 file changed, 59 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f0fe9d0..7c39783 1

[PATCH v3 0/1]

2017-07-10 Thread Claudio Imbrenda
erspace to deal with the creation or destruction of VMs as needed. v2 -> v3: * added EVENT * shortened the names of the other variables v1 -> v2: * added KVM_VM_PID and KVM_VM_STATS_PATH * some cleanup, the patch should look nicer now * rebased on 4.12 *** BLURB HERE *** Claudio Imbrenda (

Re: [PATCH v3 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-10 Thread Claudio Imbrenda
On Mon, 10 Jul 2017 11:40:55 +0200 David Hildenbrand wrote: > On 10.07.2017 11:20, Claudio Imbrenda wrote: > > Minor minor nit: > > The subject should state "creating or destroying a VM" I'll fix it [...] > > +static void kvm_uevent_notify_change(un

[PATCH v4 0/1] KVM: trigger uevents when creating or destroying a VM

2017-07-11 Thread Claudio Imbrenda
t; v2: * added KVM_VM_PID and KVM_VM_STATS_PATH * some cleanup, the patch should look nicer now * rebased on 4.12 Claudio Imbrenda (1): KVM: trigger uevents when creating or destroying a VM virt/kvm/kvm_main.c | 74 + 1 file changed, 74 insertions(+) -- 2.7.4

[PATCH v4 1/1] KVM: trigger uevents when creating or destroying a VM

2017-07-11 Thread Claudio Imbrenda
erspace to deal with the creation or destruction of VMs as needed. Signed-off-by: Claudio Imbrenda --- virt/kvm/kvm_main.c | 74 + 1 file changed, 74 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f0fe9d0..4a7a632 1

[PATCH v2 0/1]

2017-07-06 Thread Claudio Imbrenda
creation or destruction of VMs as needed. v1 -> v2: * added KVM_VM_PID and KVM_VM_STATS_PATH * some cleanup, the patch should look nicer now * rebased on 4.12 Claudio Imbrenda (1): KVM: trigger uevents when starting or stopping a VM virt/kvm/kvm_main.c |

[PATCH v2 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-06 Thread Claudio Imbrenda
creation or destruction of VMs as needed. Signed-off-by: Claudio Imbrenda --- virt/kvm/kvm_main.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 6e3b12c..f4cf7d2 100644 --- a/virt/kvm/kvm_main.c

Re: [PATCH v5 1/1] KVM: trigger uevents when creating or destroying a VM

2017-07-17 Thread Claudio Imbrenda
On Mon, 17 Jul 2017 17:53:51 +0200 David Hildenbrand wrote: > > + add_uevent_var(env, "CREATED=%llu", created); > > + add_uevent_var(env, "COUNT=%llu", active); > > I like that much better. > > > + > > + if (type == KVM_EVENT_CREATE_VM) > > + add_uevent_var(env, "EVENT=create"

[RFC v1 1/2] VS1544 KSM generic memory comparison functions

2017-09-25 Thread Claudio Imbrenda
This is just a refactoring of the existing code: * Split the page checksum and page comparison functions from ksm.c into a new asm-generic header (page_memops.h) * Add a line in every Kbuild of every arch, to use the generic version of page_memops.h Signed-off-by: Claudio Imbrenda

[RFC v1 2/2] VS1544 KSM s390-specific memory comparison functions

2017-09-25 Thread Claudio Imbrenda
Introduce s390 specific page comparison and checksumming functions: The s390-specific functions use the CKSM instruction to quickly calculate the checksum of a page. This provides a measurable reduction on CPU load when KSM is active. Signed-off-by: Claudio Imbrenda --- arch/s390/include/asm

[RFC v1 0/2] Per-arch page checksumming and comparison

2017-09-25 Thread Claudio Imbrenda
gh I did not see any performance regressions in my tests). While there is a crypto API to choose between different hash functions, there is nothing like that for page comparison. I think at this point we need to coordinate a little, to avoid reinventing the wheel three times and in differe

[PATCH v2 1/1] KVM: make pid available for uevents without debugfs

2017-07-24 Thread Claudio Imbrenda
("KVM: trigger uevents when creating or destroying a VM") Signed-off-by: Claudio Imbrenda --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 35 --- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/include/linux/kvm_host.h

[PATCH v1 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-04 Thread Claudio Imbrenda
active. Specific udev rules can be then set up in userspace to deal with the creation or destruction of VMs as needed. Signed-off-by: Claudio Imbrenda --- virt/kvm/kvm_main.c | 25 + 1 file changed, 25 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

Re: [PATCH v1 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-04 Thread Claudio Imbrenda
On Tue, 4 Jul 2017 11:23:36 +0200 Paolo Bonzini wrote: > On 04/07/2017 11:03, Claudio Imbrenda wrote: > > This patch adds a few lines to the KVM common code to fire a > > KOBJ_CHANGE uevent whenever a KVM VM is created or destroyed. The > > event carries two

Re: [PATCH v1 1/1] KVM: trigger uevents when starting or stopping a VM

2017-07-04 Thread Claudio Imbrenda
On Tue, 4 Jul 2017 11:27:44 +0200 Paolo Bonzini wrote: > On 04/07/2017 11:25, Christian Borntraeger wrote: > > On 07/04/2017 11:23 AM, Paolo Bonzini wrote: > >> > >> > >> On 04/07/2017 11:03, Claudio Imbrenda wrote: > >>> This patch a