From patchwork Tue May 19 10:43:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anil Gurumurthy X-Patchwork-Id: 6435941 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B6449F1C1 for ; Tue, 19 May 2015 10:43:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57F1420450 for ; Tue, 19 May 2015 10:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AED1720304 for ; Tue, 19 May 2015 10:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754810AbbESKns (ORCPT ); Tue, 19 May 2015 06:43:48 -0400 Received: from mx0a-0016ce01.pphosted.com ([67.231.148.157]:14518 "EHLO mx0a-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739AbbESKnr (ORCPT ); Tue, 19 May 2015 06:43:47 -0400 Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id t4JAhlXe012576 for ; Tue, 19 May 2015 03:43:47 -0700 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0a-0016ce01.pphosted.com with ESMTP id 1udtwc3yg0-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 19 May 2015 03:43:47 -0700 Received: from AVMB2.qlogic.org ([fe80::cdfd:9ba8:5afa:475c]) by avcashub1.qlogic.org ([::1]) with mapi id 14.03.0235.001; Tue, 19 May 2015 03:43:45 -0700 From: Anil Gurumurthy To: Denys Vlasenko , Vijaya Mohan Guvva CC: Fabian Frederick , Christoph Hellwig , "Guenter Roeck" , Ben Hutchings , "James Bottomley" , linux-kernel , linux-scsi Subject: RE: [PATCH] bfa: deinline __bfa_trc() and __bfa_trc32() Thread-Topic: [PATCH] bfa: deinline __bfa_trc() and __bfa_trc32() Thread-Index: AQHQkUxKVDlpfGvI/EuECe1/1ewy5Z2DHHLw Date: Tue, 19 May 2015 10:43:45 +0000 Message-ID: <20B1A3CBD98F3845B3F5F56D8597EF590101FF45@avmb2.qlogic.org> References: <1431940681-15915-1-git-send-email-dvlasenk@redhat.com> In-Reply-To: <1431940681-15915-1-git-send-email-dvlasenk@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <20B1A3CBD98F3845B3F5F56D8597EF590101FF45@avmb2.qlogic.org> x-originating-ip: [10.1.4.10] disclaimer: bypass MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7805 signatures=670585 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1505190137 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch looks good. You could remove the __bfa_trc32() routine Thanks, Acked-by: Anil Gurumurthy -----Original Message----- From: Denys Vlasenko [mailto:dvlasenk@redhat.com] Sent: 18 May 2015 14:48 To: Vijaya Mohan Guvva Cc: Denys Vlasenko; Fabian Frederick; Anil Gurumurthy; Christoph Hellwig; Guenter Roeck; Ben Hutchings; James Bottomley; linux-kernel; linux-scsi Subject: [PATCH] bfa: deinline __bfa_trc() and __bfa_trc32() __bfa_trc() compiles to 115 bytes of machine code. With this .config: http://busybox.net/~vda/kernel_config there are 1494 calls of __bfa_trc(). __bfa_trc32() is very similar, so it is uninlined too. However, it appears to be unused, therefore this patch ifdefs it out. Change in code size is about 130,000 bytes: text data bss dec hex filename 85975426 22294712 20627456 128897594 7aed23a vmlinux.before 85842882 22294584 20627456 128764922 7accbfa vmlinux Signed-off-by: Denys Vlasenko CC: Fabian Frederick CC: Anil Gurumurthy CC: Christoph Hellwig CC: Guenter Roeck CC: Ben Hutchings CC: James Bottomley CC: linux-kernel@vger.kernel.org CC: linux-scsi@vger.kernel.org --- drivers/scsi/bfa/bfa_core.c | 40 ++++++++++++++++++++++++++++++++++++++++ drivers/scsi/bfa/bfa_cs.h | 41 ++++------------------------------------- 2 files changed, 44 insertions(+), 37 deletions(-) } -static inline void -__bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data) -{ - int tail = trcm->tail; - struct bfa_trc_s *trc = &trcm->trc[tail]; - - if (trcm->stopped) - return; - - trc->fileno = (u16) fileno; - trc->line = (u16) line; - trc->data.u64 = data; - trc->timestamp = BFA_TRC_TS(trcm); - - trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); - if (trcm->tail == trcm->head) - trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); -} - +void +__bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data); -static inline void -__bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data) -{ - int tail = trcm->tail; - struct bfa_trc_s *trc = &trcm->trc[tail]; - - if (trcm->stopped) - return; - - trc->fileno = (u16) fileno; - trc->line = (u16) line; - trc->data.u32.u32 = data; - trc->timestamp = BFA_TRC_TS(trcm); - - trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); - if (trcm->tail == trcm->head) - trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); -} +void +__bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 +data); #define bfa_sm_fault(__mod, __event) do { \ bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \ -- 1.8.1.4 diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index e3f67b0..3657a00 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c @@ -90,6 +90,46 @@ static bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { +void +__bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data) { + int tail = trcm->tail; + struct bfa_trc_s *trc = &trcm->trc[tail]; + + if (trcm->stopped) + return; + + trc->fileno = (u16) fileno; + trc->line = (u16) line; + trc->data.u64 = data; + trc->timestamp = BFA_TRC_TS(trcm); + + trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); + if (trcm->tail == trcm->head) + trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); } + +#if 0 /* UNUSED */ +void +__bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data) +{ + int tail = trcm->tail; + struct bfa_trc_s *trc = &trcm->trc[tail]; + + if (trcm->stopped) + return; + + trc->fileno = (u16) fileno; + trc->line = (u16) line; + trc->data.u32.u32 = data; + trc->timestamp = BFA_TRC_TS(trcm); + + trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); + if (trcm->tail == trcm->head) + trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); } #endif + static void bfa_com_port_attach(struct bfa_s *bfa) { diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h index 91a8aa3..dd3154e 100644 --- a/drivers/scsi/bfa/bfa_cs.h +++ b/drivers/scsi/bfa/bfa_cs.h @@ -107,44 +107,11 @@ bfa_trc_stop(struct bfa_trc_mod_s *trcm) trcm->stopped = 1;