Re: [PATCH] Reduce bkl usage in do_coredump

From: Andrew Morton
Date: Mon Aug 09 2004 - 13:25:03 EST


Dave Hansen <haveblue@xxxxxxxxxx> wrote:
>
> > - format_corename(corename, core_pattern, signr);
> > + /*
> > + * lock_kernel() because format_corename() is controlled by sysctl, which
> > + * uses lock_kernel()
> > + */
> > + lock_kernel();
> > + format_corename(corename, core_pattern, signr);
> > + unlock_kernel();
>
> Might be nicer to just put the locking inside of format_corename() if it
> is the function itself that really needs the locking.

Nope. format_corename() just takes a char *. It has no knowledge about
what that char*'s locking rules are. It's the caller who chose to use a
char* which is protected by lock_kernel().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/