From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USpe8-0004Y1-23 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 10:17:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USpe5-0003qS-W3 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 10:17:07 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:44553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USpe5-0003qO-LC for qemu-devel@nongnu.org; Thu, 18 Apr 2013 10:17:05 -0400 Date: Thu, 18 Apr 2013 10:16:27 -0400 (EDT) From: Paolo Bonzini Message-ID: <1327662508.2685805.1366294587142.JavaMail.root@redhat.com> In-Reply-To: <516F9EAC.6090804@siemens.com> References: <1366187964-14265-1-git-send-email-qemulist@gmail.com> <1366187964-14265-16-git-send-email-qemulist@gmail.com> <516F9EAC.6090804@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v4 15/15] slirp: use lock to protect the slirp_instances List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: mdroth , Stefan Hajnoczi , Liu Ping Fan , Anthony Liguori , qemu-devel@nongnu.org > grep'ing for slirp_instances points to more spots that work with that > list (QTAILQ_FOREACH, QTAILQ_EMPTY, ...). So the same question here: > What are the usage rules? When do I _not_ need it when touching the list > of instances, and why? > > Well, I started reading at the top, but there are more lock-adding > patches in this series. And the more locks we have, the higher the > probability of ABBA gets. Therefore, please document from the beginning > the lock order rules that shall prevent it (which may also be "never > take other locks while holding this one" or "never hold other locks when > taking this one"). Yeah, the only sane ordering rules should be "hold nothing or just the BQL when taking this one". Everything else needs a very good justification... Paolo