From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: possible recursive locking issue Date: Fri, 7 Jul 2017 09:54:13 +0200 Message-ID: <02294617-08c8-5a32-8fb1-9a8ef95ea2c3@redhat.com> References: <17296D9F8FF2234F831FC3DF505A87A9632A2EC7@SHSMSX103.ccr.corp.intel.com> <20170706151005.41085524@w520.home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "kwankhede@nvidia.com" , "kvm@vger.kernel.org" , 'Zhenyu Wang' To: Alex Williamson , "Dong, Chuanxiao" Return-path: Received: from mail-wr0-f195.google.com ([209.85.128.195]:35865 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbdGGHyR (ORCPT ); Fri, 7 Jul 2017 03:54:17 -0400 Received: by mail-wr0-f195.google.com with SMTP id 77so5803967wrb.3 for ; Fri, 07 Jul 2017 00:54:17 -0700 (PDT) In-Reply-To: <20170706151005.41085524@w520.home> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 06/07/2017 23:10, Alex Williamson wrote: > vfio_unpin_pages() also takes a read-lock on > the same. Why is this a problem? We should be able to nest > read-locks. rwsem is fair in that it blocks out new readers if a writer is waiting. In this case nesting causes a deadlock, because the outer read-lock will never be released. Paolo