From: Nitesh Narayan Lal Subject: [Query] Deadlock condition due to virtqueue_add buffer allocation Date: Fri, 28 Jul 2017 16:34:35 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Cc: Rik van Riel To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58730 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbdG1Ueg (ORCPT ); Fri, 28 Jul 2017 16:34:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33FFEC0BE7E2 for ; Fri, 28 Jul 2017 20:34:36 +0000 (UTC) Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: Hi, I am working on the guest page hinting support with Rik. As per my implementation when pages are freed, they are added to a cpu-local list. Once that list fills up, the pages need to be passed to the hypervisor. I am currently using a seqlock to ensure page allocation does not allocate pages while they are being freed by the hypervisor. This list is passed to the hypervisor using virtio_balloon infrastructure. As per the current flow virtqueue_add() requires a memory allocation, which leads to a deadlock condition. What should be the right way to get around this? Looking forward for the suggestions. -- Regards Nitesh