From: Prarit Bhargava <prarit@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
john stultz <johnstul@us.ibm.com>,
Don Zickus <dzickus@redhat.com>,
Larry Woodman <lwoodman@redhat.com>,
gregkh@linuxfoundation.org
Subject: Re: [RFC PATCH] tty, add kref to sysrq handlers
Date: Fri, 04 May 2012 09:00:08 -0400 [thread overview]
Message-ID: <4FA3D2D8.8010906@redhat.com> (raw)
In-Reply-To: <20120427183922.47436912@pyramind.ukuu.org.uk>
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.
>
> I'm not sure I see we need a kref - that looks like overkill, and its
> probably even more elegantly done with RCU ?
Alan,
Thanks for the suggestions. As always they are much appreciated.
I looked into this, and unfortunately the RCU implementation in the kernel is
dynamic-list based. I could do some funky stuff to make it work with an array
or even implement an RCU for arrays but I'm wondering if that is wasted code.
Most arrays in the kernel that require RCU-like locking seem to use seqlocks.
The problem with any lock, unfortunately, is that I would have to still block
irqs, which is exactly what I'm trying to avoid.
I'll submit my patch as a real PATCH and see what everyone thinks of it ...
P.
next prev parent reply other threads:[~2012-05-04 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 17:15 [RFC PATCH] tty, add kref to sysrq handlers Prarit Bhargava
2012-04-27 17:39 ` Alan Cox
2012-04-27 19:46 ` Prarit Bhargava
2012-05-04 13:00 ` Prarit Bhargava [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-04-27 17:15 Prarit Bhargava
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=4FA3D2D8.8010906@redhat.com \
--to=prarit@redhat.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dzickus@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lwoodman@redhat.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox