From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:43:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08623E3E; Sat, 6 Sep 2014 19:43:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E839F1D3F; Sat, 6 Sep 2014 19:43:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86JhmTM084403; Sat, 6 Sep 2014 19:43:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86JhmK4084402; Sat, 6 Sep 2014 19:43:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409061943.s86JhmK4084402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 6 Sep 2014 19:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271207 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:43:49 -0000 Author: mav Date: Sat Sep 6 19:43:48 2014 New Revision: 271207 URL: http://svnweb.freebsd.org/changeset/base/271207 Log: Save one register read (AHCI_IS) for AHCI controllers with only one port. For controllers with only one port (like PCIe or M.2 SSDs) interrupt can come from only one source, and skipping read saves few percents of CPU time. MFC after: 1 month H/W donated by: I/O Switch Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Sep 6 19:39:12 2014 (r271206) +++ head/sys/dev/ahci/ahci.c Sat Sep 6 19:43:48 2014 (r271207) @@ -359,7 +359,9 @@ ahci_setup_interrupt(device_t dev) for (i = 0; i < ctlr->numirqs; i++) { ctlr->irqs[i].ctlr = ctlr; ctlr->irqs[i].r_irq_rid = i + (ctlr->msi ? 1 : 0); - if (ctlr->numirqs == 1 || i >= ctlr->channels || + if (ctlr->channels == 1 && !ctlr->ccc) + ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE; + else if (ctlr->numirqs == 1 || i >= ctlr->channels || (ctlr->ccc && i == ctlr->cccv)) ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL; else if (i == ctlr->numirqs - 1)