mirror of https://lore.kernel.org/lkml/
 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
  2018-12-05  8:32 ` Andrew Jones
  0 siblings, 1 reply; 5+ 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	[flat|nested] 5+ messages in thread

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

Thread overview: 5+ 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  8:32 ` Andrew Jones
2018-12-07 14:49   ` Steven Price
     [not found]   ` <201812060956304771332@zte.com.cn>
2018-12-06 14:29     ` [PATCH] kvm/arm: return 0 when the number of objects is not lessthan min Andrew Jones
2018-12-10 13:13     ` Christoffer Dall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®