Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3901646imu; Fri, 18 Jan 2019 21:08:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN5zLSkYu2CudgGnwql2Iq/2DUV4yrCTOrf54f2mScJYo6tahN7iuGSEr6SOxBh41r3j3SvI X-Received: by 2002:a62:3888:: with SMTP id f130mr21758956pfa.132.1547874485365; Fri, 18 Jan 2019 21:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547874485; cv=none; d=google.com; s=arc-20160816; b=WwYy2Rpxjl5g7OUCCr2x8ZKOcUPUXdtkklYgnIBC4uvsLn3t67qQW0RTlw7k5LhaDh /sBoh7i/dEmjM10c5QsY6ak4dMD/3OICli/E5tpDMZ3hSyCKjC2eplaoU4QiB2ltq7SY m1EJycV0aLtKH+w5A/+kLoCRa70LQhX26yGVnsP/+sR4Wou4Dh0RT7iPzbpYTu31fmer /FRCk88b6tifjM0SqiD2UlbVibznaCdPy4IFs9bu0O9DZIXngswoFfKuuE3aiUa/cPLz nOVWxfGyX7noXIieK9LQEN3PKWx+n14VQabF4cIojUIJk0ypduI2Mq9Q6q1b6E6dgih2 v40g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dd9uwnCge9rZcDt0ijTnyOKRUuOBLcXVaM7FFtHlqyk=; b=SDOViRF1OKYj9ntz4lBe3pBxFIaLKb/jtE6qrn+WlX0bFrP78606xauPeb+1Vueinm jUES8lJS/E4q8H6NoardQ+I9R75roTeZxYHkhxBN/aLX+1dktEQnbMbfv0eu9y+2jioI RPQ4vVXleGuW3b6LJng4i+UoZSZBCGnnvechRN1j9UqdBNk6tZM1cFjGu1Kiwwk9iMze MqGIa7fW4153DaYYeNPUPySOTApLltMPtcK8xwRGO3amZWuGpb0umLf07GDBvu7kO3pu HvEiRbZXn7aEk1chQA0HaCtdLmMwSIMBRgqlqdNsdFndfsxOmdYYyQJG3amHTmrBKCJz e6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="m/lMndz8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j195si7207756pfd.165.2019.01.18.21.07.11; Fri, 18 Jan 2019 21:08:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="m/lMndz8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbfASFBF (ORCPT + 99 others); Sat, 19 Jan 2019 00:01:05 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35070 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfASFBF (ORCPT ); Sat, 19 Jan 2019 00:01:05 -0500 Received: by mail-wr1-f66.google.com with SMTP id 96so17477922wrb.2 for ; Fri, 18 Jan 2019 21:01:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dd9uwnCge9rZcDt0ijTnyOKRUuOBLcXVaM7FFtHlqyk=; b=m/lMndz86n8qPCJkLnKM+2V8yp2QOlQoYKvQVfqIZxcqVyvkvqo3V3x8YgJZYVYwYV 7Tjt0dCO75NQhDH89M+FgJhxwAynIsLjeh1DVqzpTfoBBP2g1gHFJtfzHb7O7oVulxSG l5/4AXsoG6yPYEcKDmhlbMk1ltUTZvZFtN5ONSsMcishoZZCNgRy3IdlfgRO108TunNv XS28d1OwAsoWpbgFUTfJVKH2mi+qxJ7S/4fPop0F1srTxVFmGJxm8HmAbXqKsKHwAQ9N WBr7MTlrgovfn0E3tTvvcloSTI3VRNatCOhn0CIPMsqQ74W+WkbWUsyyvLrtEwZ6M8++ u70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dd9uwnCge9rZcDt0ijTnyOKRUuOBLcXVaM7FFtHlqyk=; b=Aqq7rJ2CXlxm9cQEZH+9FxB66hqFDuDsjs1V0kQfHE+05Jvaw8qvKapGa7zoiSliG/ ZhhiKo7Q+uF+SQF9zUCG7WQtrpJJD/5RA0vtW+xpqZXNaZumos8kQAML9kszQFIEtoSK u7+jX2NLpkhp9kcxxvrKz+edMc4STmYrOr1GXWI5EOkTNQhJPhXrCCljb0Vlh4r4ByDe XzRTX/t4e1o3Av2fHbPe1O9cHvqRxkO/LNygzhefpjSt+1rxVZ0gCpuZwPkNxQl33cNr Xcyq1zn7VQUzITj+VcsgoQynAld4PTxJE5MDzVA9Drx32UNyD2pOd0HX7LFIuqLbV0PU 8kbQ== X-Gm-Message-State: AJcUukd4+ROlxEnfRnTpmVG4Cx3o4BiSS7cesV8OenK3pSpplJWgr2o8 CGXVPbV8FdYUupZx947l0i+ZeOm9rOQJlI9YNWqe6A== X-Received: by 2002:adf:f5d1:: with SMTP id k17mr20507314wrp.59.1547874063225; Fri, 18 Jan 2019 21:01:03 -0800 (PST) MIME-Version: 1.0 References: <20181227111821.80908-1-anup@brainfault.org> <20181227111821.80908-3-anup@brainfault.org> <20190115155437.GA13095@infradead.org> In-Reply-To: <20190115155437.GA13095@infradead.org> From: Anup Patel Date: Sat, 19 Jan 2019 10:30:52 +0530 Message-ID: Subject: Re: [PATCH v4 2/5] irqchip: sifive-plic: Don't inline plic_toggle() and plic_irq_toggle() To: Christoph Hellwig Cc: Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Marc Zyngier , Atish Patra , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 9:24 PM Christoph Hellwig wrote: > > On Thu, Dec 27, 2018 at 04:48:18PM +0530, Anup Patel wrote: > > The plic_toggle() uses raw_spin_lock() and plic_irq_toggle has a > > for loop so both these functions are not suitable for being inline > > hence this patch removes the inline keyword. > > That is a weird argument for a function which has by design exactly > two callers and is in the hot path. The alternative to the inline > here would be to duplicate the code. It's strange that you see it as weird argument. Both plic_toggle() and plic_irq_toggle() are 5+ lines functions with loops. The loop is clear in plic_irq_toggle() whereas raw_spin_lock() in plic_toggle() expands into inline-assembly spin-loop because raw_spin_lock() is a macro (not function). Further looking at disassembly of both functions, these are 55+ instructions. I think we let GCC decide whether these functions should be inlined or not rather than us explicitly making these functions inline. Regards, Anup