All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  kvm/arm: return 0 when the number of objects is not less than min
@ 2018-12-05  1:15 ` Peng Hao
  0 siblings, 0 replies; 11+ messages in thread
From: Peng Hao @ 2018-12-05  1:15 UTC (permalink / raw)
  To: christoffer.dall, marc.zyngier
  Cc: linux-arm-kernel, kvmarm, linux-kernel, Peng Hao

Return 0 when there is enough kvm_mmu_memory_cache object.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 virt/kvm/arm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index ed162a6..fcda0ce 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -127,7 +127,7 @@ static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
 	while (cache->nobjs < max) {
 		page = (void *)__get_free_page(PGALLOC_GFP);
 		if (!page)
-			return -ENOMEM;
+			return cache->nobjs >= min ? 0 : -ENOMEM;
 		cache->objects[cache->nobjs++] = page;
 	}
 	return 0;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-12-10 13:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05  1:15 [PATCH] kvm/arm: return 0 when the number of objects is not less than min Peng Hao
2018-12-05  1:15 ` Peng Hao
2018-12-05  8:32 ` Andrew Jones
2018-12-05  8:32   ` Andrew Jones
2018-12-06  1:56   ` [PATCH] kvm/arm: return 0 when the number of objects is not lessthan min peng.hao2
2018-12-06 14:29     ` Andrew Jones
2018-12-06 14:29       ` Andrew Jones
2018-12-10 13:13     ` Christoffer Dall
2018-12-10 13:13       ` Christoffer Dall
2018-12-07 14:49   ` [PATCH] kvm/arm: return 0 when the number of objects is not less than min Steven Price
2018-12-07 14:49     ` Steven Price

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.