lkml.org 
[lkml]   [2023]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 04/10] ftrace: Store direct called addresses in their ops
On Tue,  7 Feb 2023 19:21:29 +0100
Florent Revest <revest@chromium.org> wrote:

> @@ -5445,6 +5445,7 @@ __modify_ftrace_direct(struct ftrace_ops *ops, unsigned long addr)
> /* Enable the tmp_ops to have the same functions as the direct ops */
> ftrace_ops_init(&tmp_ops);
> tmp_ops.func_hash = ops->func_hash;
> + tmp_ops.direct_call = addr;
>
> err = register_ftrace_function_nolock(&tmp_ops);
> if (err)
> @@ -5466,6 +5467,7 @@ __modify_ftrace_direct(struct ftrace_ops *ops, unsigned long addr)
> entry->direct = addr;
> }
> }
> + WRITE_ONCE(ops->direct_call, addr);

I'm curious about the use of WRITE_ONCE(). It should not go outside the
mutex barrier.

-- Steve

>
> mutex_unlock(&ftrace_lock);
>

\
 
 \ /
  Last update: 2023-03-27 01:02    [W:0.161 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site