[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F9AF7AC.1010708@redhat.com>
Date: Fri, 27 Apr 2012 15:46:52 -0400
From: Prarit Bhargava <prarit@...hat.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
CC: linux-kernel@...r.kernel.org, Larry Woodman <lwoodman@...hat.com>,
Jason Baron <jbaron@...hat.com>,
Don Zickus <dzickus@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
john stultz <johnstul@...ibm.com>
Subject: Re: [RFC PATCH] tty, add kref to sysrq handlers
On 04/27/2012 01:39 PM, Alan Cox wrote:
>> If the lock were removed, however, there is one _unlikely_ circumstance in
>> which the array would be left unprotected. That would be the situation in
>> which a module was loaded and the sysrq handler was registered during the
>> execution of the module. Again, the possibility of the scenario is very
>> small and given the existing usage of unregister_sysrq_key() in the tree
>> it seems like removing the lock is sufficient.
>
> It's asking for later disasters I think.
Yeah, you're right.
>
> I'm not sure I see we need a kref - that looks like overkill, and its
> probably even more elegantly done with RCU ?
Possibly -- I'll look into it.
>
>> Of course, I'm more than willing to hear additional suggestions. A rw
>> lock still requires that it be taken with irqs disabled so IMO it is out
>> of the question.
>
> One approach would be to defer the work. Is there any reason a slow sysrq
> handler shouldn't be expected to behave itself and schedule work to run
> later.
The problem with this is, as lwoodman pointed out me privately, deferring a
sysrq-t is not the best idea. When sysrq-t is issued we're trying to take a
snapshot of the system as it is at that particular moment, not after some
indeterminate amount of time. And, if the work scheduler is somehow the problem
(and the reason you're doing a sysrq-t) you won't execute at all.
Thanks for the suggestion Alan -- as always it is much appreciated. I'll see if
RCU is the solution here.
P.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists