Re: [PATCH v3 1/6] irqchip: sifive-plic: Pre-compute context hart base and enable base

From: Anup Patel
Date: Tue Dec 18 2018 - 03:30:36 EST


On Mon, Dec 17, 2018 at 11:55 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> 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