Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3589099imu; Tue, 18 Dec 2018 00:31:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/VuSxQ6br0GIu9VZtWNHti5MGvsfAmdUc8UNe6A4Ss0SbinHTPsdbbCZnCT4XVsfzUrv3i2 X-Received: by 2002:a17:902:4681:: with SMTP id p1mr16092063pld.184.1545121899571; Tue, 18 Dec 2018 00:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121899; cv=none; d=google.com; s=arc-20160816; b=C3c50CdUkPafvYza9nTV5qztoCZRfwLbJ8q0HNSTYoxDGrXJ9unLUID16EW5j5eURl ArY/uFjhxLlBC7tjlc1b4NI9dDi0gHcTAzBgkCWW1jtGlJGWVWl72zdXDTnwAJyCTHLw tzqcBw2JOheW+4TH9b0ypvYkbTISViiHZ2psn0R3n8w603o+AxviVxOHRRqSSaqoo5Al nqBHzJWCEMrPp+4xvaVKGT0tH2lszB4gkaMzrLY19fLJKOX26xZWKYETFDnjuHD2NSZs KyXrKo12L4SJoEneXaWh9CH30ZgeOzKbpwXGrvehpovet0qqChXi9rpOFdoquXR4sWuu dzCg== 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=6vtoAZDWB6d72bsfhuRuDAYI2YAn1wAXF262N6zlQ9g=; b=RLNC9or+HLiOUES5VxptbaW79QokdupHosY+M+Knj7PBpQKia1K197YKKZwCPyVj6Y vhl1RUV7+GACiNWvYgu9zHhZu7kEg+rzVX/NeU/bU4g2kxX5UoVKVIUIt/bYuUm0j0to OTVyDuuoEqODNJeeh9WLwYbvZj8FyhxCmhG5rnTuNphmdM8cnZZqrcsfwo1/bP8I6j9n Ukqz58BDCjkgmi1WaUJFqQoygObS4Whq2gHRD9nAZWltSVOxkuM3a8j6/dIotQ9Dl3Uk IZbZhVxHiRVg4oP8D5Aapz/Zmw0M9byxhrbm9UbArPOXYJtDTpCwgUrOtArUMmfWeZir t1eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=rzXuX6wl; 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 n33si13432886pgl.336.2018.12.18.00.31.23; Tue, 18 Dec 2018 00:31:39 -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=rzXuX6wl; 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 S1726469AbeLRIaf (ORCPT + 99 others); Tue, 18 Dec 2018 03:30:35 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41279 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbeLRIae (ORCPT ); Tue, 18 Dec 2018 03:30:34 -0500 Received: by mail-wr1-f66.google.com with SMTP id x10so14921149wrs.8 for ; Tue, 18 Dec 2018 00:30:33 -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=6vtoAZDWB6d72bsfhuRuDAYI2YAn1wAXF262N6zlQ9g=; b=rzXuX6wl9UWOz3eHzTzw0freV0en0/eEaOLG3mFK8/DsJW5scR2lR89esXb0rXU+Sv LP91c7XkqG67r0APqeusPjaDFaR4c94tNQgiUCXemUk9sT1xRhcvSaado3z304heWHba nB+rh1dAJ7TZf3Nt+BtUz1WpsY+BmxQaNIT74ihBgdxAtbDasjLQ70+HsfwX6ixsVGwm 1CA7I/vjFoY5GHQBkz0NTT09SI1n3pFArqkEg0rVC5xQf48eMDqKAb4ykOiV9DrmzyWT 3nf5Jm64kkkZSpMc/5PovTRqcgWTxnxP4v71PrrdN6Yk2kRXckFcFKRk6jQDALz0toag T5zQ== 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=6vtoAZDWB6d72bsfhuRuDAYI2YAn1wAXF262N6zlQ9g=; b=WlMktVcueX9FvookYGpjIMxwprVcwE2oxrHkmTaY4w2afcF0ePMULvTh8KpZlIzKus Kpu4gU//MCPODPku8mVoOvOhDHtwPWbQzhmpykE78P+AEcm7KBA/k/Dxqrt3BiEheFSN 2bbrgwd3JncLdUj4Se67U1x0cgDdtyypYiFieJDGvEyuo/ESvSXY6Cyuwob9KUyGOAFv 0zXU2v9rETx9Ci4740f+NJbVc3jAlH8DwDENRoGqGRBVtG2bsiODpKS5C9+EK/DVzihf USsDoTS6zwoW5VR5742mPWo4NUuwBo987SHPHpiDmXyhxc3Id0ss6V2yLJJG+2GWOpAG RbPA== X-Gm-Message-State: AA+aEWb4dSJ4tXtTWMLdTDMubps0GyXwjg0G/Hf6h9a8kZ/D1u5LPo6L ehOqqoi2x7D2kcixwtLLmhFkz4gGmQ5dW47fAZzvmQ== X-Received: by 2002:adf:ee07:: with SMTP id y7mr14201034wrn.187.1545121832742; Tue, 18 Dec 2018 00:30:32 -0800 (PST) MIME-Version: 1.0 References: <20181130080207.20505-1-anup@brainfault.org> <20181130080207.20505-2-anup@brainfault.org> <20181217182520.GB7086@infradead.org> In-Reply-To: <20181217182520.GB7086@infradead.org> From: Anup Patel Date: Tue, 18 Dec 2018 14:00:21 +0530 Message-ID: Subject: Re: [PATCH v3 1/6] irqchip: sifive-plic: Pre-compute context hart base and enable base 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 Mon, Dec 17, 2018 at 11:55 PM Christoph Hellwig wrote: > > On Fri, Nov 30, 2018 at 01:32:02PM +0530, Anup Patel wrote: > > This patch does following optimizations: > > 1. Pre-compute hart base for each context handler > > 2. Pre-compute enable base for each context handler > > 3. Have enable lock for each context handler instead > > of global plic_toggle_lock > > All of which is pretty obvious from reading the patch. The big question > that needs to be answered in the changelog is why you do that. To compute enable_base and hart_base is two integer additions and one integer multiplication. This micro-optimization simply avoids this repeated operations. Regards, Anup