On Mon, 12 Nov 2018, Masami Hiramatsu wrote:

> > text_mutex is currently expected to be held before text_poke() is 
> > called, but we kgdb does not take the mutex, and instead *supposedly* 
> > ensures the lock is not taken and will not be acquired by any other 
> > core while text_poke() is running.
> > 
> > The reason for the "supposedly" comment is that it is not entirely clear
> > that this would be the case if gdb_do_roundup is zero.
> > 
> > This patch creates two wrapper functions, text_poke() and
> > text_poke_kgdb() which do or do not run the lockdep assertion
> > respectively.
> > 
> > While we are at it, change the return code of text_poke() to something
> > meaningful. One day, callers might actually respect it and the existing
> > BUG_ON() when patching fails could be removed. For kgdb, the return
> > value can actually be used.
> 
> Hm, this looks reasonable and good to me.
> 
> Reviewed-by: Masami Hiramatsu <mhira...@kernel.org>

Yes, I guess this is much better than putting the 'enforcement by comment' 
back in place :)

        Acked-by: Jiri Kosina <jkos...@suse.cz>

Thanks.

-- 
Jiri Kosina
SUSE Labs

Reply via email to