From patchwork Fri Nov 27 03:13:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 63261 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAR3HSOZ028327 for ; Fri, 27 Nov 2009 03:17:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753885AbZK0DRV (ORCPT ); Thu, 26 Nov 2009 22:17:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753864AbZK0DRV (ORCPT ); Thu, 26 Nov 2009 22:17:21 -0500 Received: from ozlabs.org ([203.10.76.45]:39895 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753887AbZK0DRU (ORCPT ); Thu, 26 Nov 2009 22:17:20 -0500 Received: by ozlabs.org (Postfix, from userid 1010) id 743051007D1; Fri, 27 Nov 2009 14:17:26 +1100 (EST) Date: Fri, 27 Nov 2009 14:13:20 +1100 From: Anton Blanchard To: Hoang-Nam Nguyen , Christoph Raisch , Stefan Roscher , Alexander Schmidt , Joachim Fenkes Cc: linux-rdma@vger.kernel.org Subject: [PATCH] IB/ehca: Reduce number of spin_lock/spin_unlocks in ehca_poll_eqs Message-ID: <20091127031320.GV32182@kryten> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Index: linux.trees.git/drivers/infiniband/hw/ehca/ehca_main.c =================================================================== --- linux.trees.git.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-11-27 10:17:29.000000000 +1100 +++ linux.trees.git/drivers/infiniband/hw/ehca/ehca_main.c 2009-11-27 10:19:08.000000000 +1100 @@ -957,15 +957,17 @@ void ehca_poll_eqs(unsigned long data) int max = 3; volatile u64 q_ofs, q_ofs2; unsigned long flags; + spin_lock_irqsave(&eq->spinlock, flags); + q_ofs = eq->ipz_queue.current_q_offset; - spin_unlock_irqrestore(&eq->spinlock, flags); do { - spin_lock_irqsave(&eq->spinlock, flags); q_ofs2 = eq->ipz_queue.current_q_offset; - spin_unlock_irqrestore(&eq->spinlock, flags); max--; } while (q_ofs == q_ofs2 && max > 0); + + spin_unlock_irqrestore(&eq->spinlock, flags); + if (q_ofs == q_ofs2) ehca_process_eq(shca, 0); }