From: Nitesh Narayan Lal Subject: Re: [Query] Deadlock condition due to virtqueue_add buffer allocation Date: Tue, 1 Aug 2017 09:15:21 -0400 Message-ID: References: <8b774b0a-34a0-7f3a-35f5-fa8300993ec7@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s7EOJjxjk7mSgfwSq330aTFVo55bbINpQ" Cc: Rik van Riel To: Yang Zhang , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752156AbdHANPZ (ORCPT ); Tue, 1 Aug 2017 09:15:25 -0400 In-Reply-To: <8b774b0a-34a0-7f3a-35f5-fa8300993ec7@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --s7EOJjxjk7mSgfwSq330aTFVo55bbINpQ Content-Type: multipart/mixed; boundary="unCSBBfRv3JLFFs81sWX5at6iQM5uXdUd"; protected-headers="v1" From: Nitesh Narayan Lal To: Yang Zhang , kvm@vger.kernel.org Cc: Rik van Riel Message-ID: Subject: Re: [Query] Deadlock condition due to virtqueue_add buffer allocation References: <8b774b0a-34a0-7f3a-35f5-fa8300993ec7@gmail.com> In-Reply-To: <8b774b0a-34a0-7f3a-35f5-fa8300993ec7@gmail.com> --unCSBBfRv3JLFFs81sWX5at6iQM5uXdUd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US On 07/31/2017 11:12 PM, Yang Zhang wrote: > On 2017/7/29 4:34, Nitesh Narayan Lal wrote: >> 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 t= o >> the hypervisor. I am currently using a seqlock to ensure page allocati= on >> 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. >> > > Hi Nitesh, > > I am interesting on the idea. Could you give more details of the > background? What page hinting can help and what's the expected usage > model? > Hi Yang, Basically page hinting support will help in handing of free memory between the guest and the host rapidly and transparently. It will also enable the guest to reuse the memory again with the use of MADV_FREE on the host side. I will be sharing the first patch-set soon, please feel free to make any suggestion which you feel are required. --=20 Regards Nitesh --unCSBBfRv3JLFFs81sWX5at6iQM5uXdUd-- --s7EOJjxjk7mSgfwSq330aTFVo55bbINpQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZgH7qAAoJEKOGQNwGMqM5wWYP/173lV2YS6qKrzQibk/zuM2f 4RP0aKhEx+Bg1oEVe8ZauCovY3uN/FG1EFrGNli/nXnDtOQXsBt7daFv6ixPpaWU ZHyAkRuX+ARb6f6O2AVJWFtTUku9578TpWWwildStFxyVkXho7/CLxrqQDQJYpVC UEsX3UGQAX5iOuwEHHPfoNApWvFNbdUO6v+qTeuu0SmuVY1Y7MA3ZckKRK0kK8QE UeBtGDBY1OE7j/Lshyc2+jJmXib1hld22EpVevBLj9Kogm6o9iy5nhSYsQ8wpXcB z6z9baLHSn+qv1qCzYC5I48YxE7N9rze6cqPLD7sf45TRvBci1EwFKSd2IviDsXE 1KO/fKWwxu1TsSBw+v5sqKoS2pQAdVvVwXf8vX4wIjfxHEdRXf2vG/13GvPM8BqZ eHwp0bZgnfH2OOpZHKyDpfR4WlJjK96qyv471ua37Tl5FDvnOIKQ0IoXVePVrsTa DcmUnWatCDs5kQL7dU7syH7sNR7mrZP5P2ebqVVnI1uJCks6gOKMf22gruIeXKzr CrNSE3g3HXDnfhm5EQPlN9vUQAYEYecGIQ6Bp8vIUnk75PWwnBcpAMWlVXumidYm 4p2Rqh8x7Y6BrK9IpUt1qjfKYC+UD6Y1oLQU0bTvt2y2uKtvR8gTz6A5QaXa+sdE 4/RvRANoZsnEag7O3zVu =ub4P -----END PGP SIGNATURE----- --s7EOJjxjk7mSgfwSq330aTFVo55bbINpQ--