From patchwork Tue Aug 14 04:55:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1318331 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8B43E3FC81 for ; Tue, 14 Aug 2012 06:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752404Ab2HNGmI (ORCPT ); Tue, 14 Aug 2012 02:42:08 -0400 Received: from lsd-gw.ic.unicamp.br ([143.106.7.165]:36868 "EHLO boneca.lsd.ic.unicamp.br" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751783Ab2HNGmE (ORCPT ); Tue, 14 Aug 2012 02:42:04 -0400 X-Greylist: delayed 2292 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Aug 2012 02:42:01 EDT Received: from freie (gw-to-emilia.oliva.athome.lsd.ic.unicamp.br [172.31.160.17] (may be forged)) by boneca.lsd.ic.unicamp.br (8.14.5/8.14.5) with ESMTP id q7E64WqJ016834 for ; Tue, 14 Aug 2012 03:04:32 -0300 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id q7E64VGn012815 for ; Tue, 14 Aug 2012 03:04:31 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q7E64UXU026301; Tue, 14 Aug 2012 03:04:30 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q7E64UqV026300; Tue, 14 Aug 2012 03:04:30 -0300 X-Authentication-Warning: livre.localdomain: aoliva set sender to oliva@lsd.ic.unicamp.br using -f From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: Fix local messages and lost wake-up in SimpleMessenger Date: Tue, 14 Aug 2012 01:55:11 -0300 Organization: Free thinker, not speaking for University of Campinas Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Don't wait for a signal if the dispatch queue is non-empty already, and support a non-NULL pipe for local responses. If we were to require pipe to be NULL for that, the response would be lost. Signed-off-by: Alexandre Oliva --- src/msg/SimpleMessenger.cc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 53e36cd..973219f 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -373,7 +373,7 @@ void SimpleMessenger::DispatchQueue::entry() } lock.Lock(); } - if (!stop) + if (queued_pipes.empty() && !stop) cond.Wait(lock); //wait for something to be put on queue } lock.Unlock(); @@ -2477,7 +2477,7 @@ void SimpleMessenger::submit_message(Message *m, Connection *con, const entity_a } // local? - if (!pipe && my_inst.addr == dest_addr) { + if (my_inst.addr == dest_addr) { if (!destination_stopped) { // local ldout(cct,20) << "submit_message " << *m << " local" << dendl;