[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220811095046.0f303eac@gandalf.local.home>
Date: Thu, 11 Aug 2022 09:50:46 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Oded Gabbay <ogabbay@...nel.org>
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
Ohad Sharabi <osharabi@...ana.ai>
Subject: Re: [PATCH 2/3] habanalabs: trace MMU map/unmap page
On Thu, 11 Aug 2022 14:39:52 +0300
Oded Gabbay <ogabbay@...nel.org> wrote:
> @@ -259,7 +261,12 @@ int hl_mmu_unmap_page(struct hl_ctx *ctx, u64 virt_addr, u32 page_size, bool flu
> if (flush_pte)
> mmu_funcs->flush(ctx);
>
> - return rc;
> + if (rc)
> + return rc;
If you want to avoid the condition if tracing is disabled (for a
micro-optimization) you can instead do:
if (trace_habanalabs_mmu_unmap_enabled() && !rc)
trace_habanalabs_mmu_unmap(hdev->dev, virt_addr, 0, page_size, flush_pte);
return rc;
This way the above trace_habanalabs_mmu_unmap_enabled() is a static_branch,
and will become a nop falling into the "return rc", and when the tracepoint
is enabled, it will jump to a compare of "!rc".
-- Steve
> +
> + trace_habanalabs_mmu_unmap(hdev->dev, virt_addr, 0, page_size, flush_pte);
> +
> + return 0;
> }
>
Powered by blists - more mailing lists