From patchwork Fri Jan 13 08:25:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Liu X-Patchwork-Id: 135773 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id B0D0EB7735 for ; Fri, 13 Jan 2012 21:09:08 +1100 (EST) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe002.messaging.microsoft.com [216.32.181.182]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 1414DB6F6F for ; Fri, 13 Jan 2012 20:07:11 +1100 (EST) Received: from mail36-ch1-R.bigfish.com (10.43.68.246) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.23; Fri, 13 Jan 2012 09:07:06 +0000 Received: from mail36-ch1 (localhost [127.0.0.1]) by mail36-ch1-R.bigfish.com (Postfix) with ESMTP id 66A1C2E0072; Fri, 13 Jan 2012 09:07:06 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zz13e6Kc8kzz1202hzz8275bhz2dhc1ahc1bh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 13, Received: from mail36-ch1 (localhost.localdomain [127.0.0.1]) by mail36-ch1 (MessageSwitch) id 1326445626280564_9893; Fri, 13 Jan 2012 09:07:06 +0000 (UTC) Received: from CH1EHSMHS013.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.253]) by mail36-ch1.bigfish.com (Postfix) with ESMTP id 35A422C008E; Fri, 13 Jan 2012 09:07:06 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS013.bigfish.com (10.43.70.13) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 13 Jan 2012 09:07:05 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.355.3; Fri, 13 Jan 2012 03:07:04 -0600 Received: from localhost (tank.ap.freescale.net [10.193.20.104]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id q0D972VQ001999; Fri, 13 Jan 2012 03:07:03 -0600 (CST) From: Qiang Liu To: , , , Subject: [PATCH][SDK v1.2] sata: I/O load balancing Date: Fri, 13 Jan 2012 16:25:47 +0800 Message-ID: <1326443147-26645-1-git-send-email-qiang.liu@freescale.com> X-Mailer: git-send-email 1.6.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Mailman-Approved-At: Fri, 13 Jan 2012 21:08:51 +1100 Cc: Qiang Liu , Qiang Liu X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Qiang Liu Reduce interrupt singnals through reset Interrupt Coalescing Control Reg. Increase the threshold value of interrupt and timer will reduce the number of complete interrupt sharply. Improve the system performance effectively. Signed-off-by: Qiang Liu --- Description: 1. sata-fsl interrupt will be raised 130 thousand times when write 8G file (dd if=/dev/zero of=/dev/sda2 bs=128K count=65536); 2. most of interrupts raised because of only 1-4 commands completed; 3. only 30 thousand times will be raised after set max interrupt threshold, more interrupts are coalesced as the description of ICC; Performance Improvement: use top command, [root@p2020ds root]# dd if=/dev/zero of=/dev/sda2 bs=128K count=65536 & [root@p2020ds root]# top CPU % | dd | flush-8:0 | softirq --------------------------------------- before | 20-22 | 17-19 | 7 --------------------------------------- after | 18-21 | 15-16 | 5 --------------------------------------- drivers/ata/sata_fsl.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) -- 1.6.4 diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 3547000..93f8b00 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -6,7 +6,7 @@ * Author: Ashish Kalra * Li Yang * - * Copyright (c) 2006-2007, 2011 Freescale Semiconductor, Inc. + * Copyright (c) 2006-2007, 2011-2012 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -162,6 +162,16 @@ enum { }; /* + * Interrupt Coalescing Control Register bitdefs + */ +enum { + ICC_MIN_INT_THRESHOLD_COUNT = (1 << 24), + ICC_MAX_INT_THRESHOLD_COUNT = (((1 << 4) - 1) << 24), + ICC_MIN_INT_THRESHOLD_TIMER = 1, + ICC_MAX_INT_THRESHOLD_TIMER = ((1 << 18) - 1), +}; + +/* * SATA Superset Registers */ enum { @@ -460,6 +470,13 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc) /* Simply queue command to the controller/device */ iowrite32(1 << tag, CQ + hcr_base); + /* + * reset the number of command complete bits which will cause the + * interrupt to be signaled + */ + iowrite32(ICC_MAX_INT_THRESHOLD_COUNT | ICC_MAX_INT_THRESHOLD_TIMER, + ICC + hcr_base); + VPRINTK("xx_qc_issue called, tag=%d, CQ=0x%x, CA=0x%x\n", tag, ioread32(CQ + hcr_base), ioread32(CA + hcr_base));