All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Oded Gabbay <ogabbay@kernel.org>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	Ohad Sharabi <osharabi@habana.ai>
Subject: Re: [PATCH 2/3] habanalabs: trace MMU map/unmap page
Date: Thu, 11 Aug 2022 09:50:46 -0400	[thread overview]
Message-ID: <20220811095046.0f303eac@gandalf.local.home> (raw)
In-Reply-To: <20220811113953.1963412-3-ogabbay@kernel.org>

On Thu, 11 Aug 2022 14:39:52 +0300
Oded Gabbay <ogabbay@kernel.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;
>  }
>  

  reply	other threads:[~2022-08-11 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 11:39 [PATCH 0/3] Adding support for trace events to habanalabs Oded Gabbay
2022-08-11 11:39 ` [PATCH 1/3] habanalabs: define trace events Oded Gabbay
2022-08-11 13:44   ` Steven Rostedt
2022-08-11 11:39 ` [PATCH 2/3] habanalabs: trace MMU map/unmap page Oded Gabbay
2022-08-11 13:50   ` Steven Rostedt [this message]
2022-08-11 11:39 ` [PATCH 3/3] habanalabs: trace DMA allocations Oded Gabbay
2022-08-11 13:53   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811095046.0f303eac@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=osharabi@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.