From: bsuparna@in.ibm.com
To: paul.mckenney@us.ibm.com
Cc: lse-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org,
ak@suse.de, dipankar.sarma@in.ibm.com
Subject: Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel
Date: Mon, 9 Apr 2001 18:16:57 +0530 [thread overview]
Message-ID: <CA256A29.0047C346.00@d73mta05.au.ibm.com> (raw)
>One question:
>isn't it the case that the alternative to using synchronize_kernel()
>is to protect the read side with explicit locks, which will themselves
>suppress preemption? If so, why not just suppress preemption on the read
>side in preemptible kernels, and thus gain the simpler implementation
>of synchronize_kernel()? You are not losing any preemption latency
>compared to a kernel that uses traditional locks, in fact, you should
>improve latency a bit since the lock operations are more expensive than
>are simple increments and decrements. As usual, what am I missing
>here? ;-)
>...
>...
>I still prefer suppressing preemption on the read side, though I
>suppose one could claim that this is only because I am -really-
>used to it. ;-)
Since this point has come up , I just wanted to mention that it may still
be nice to be able to do without explicit locks on the read-side. This is
not so much for performance reasons (I agree with your assessment on that
point) as for convinience / flexibility in the kind of situations where
this concept (i.e. synchronize_kernel or read-copy-update) could be used.
For example, consider situations where it is an executable code block that
is being protected. The read side is essentially the execution of that code
block - i.e. every entry/exit into the code block.
This is perhaps the case with module unload races. Having to acquire a
read-lock explicitly before every entry point seems to reduce the
simplicity of the solution, doesn't it ?
This is also the case with kernel code patching, which I agree, may appear
to be a rather unlikely application of this concept to handle races in
multi-byte code patching on a running kernel, a rather difficult problem,
otherwise. In this case, the read-side is totally unaware of the
possibility of an updater modifying the code, so it isn't even possible for
a read-lock to be acquired explicitly (if we wish to have the flexibility
of being able to patch any portion of the code).
Have been discussing this with Dipankar last week, so I realize that the
above situations were perhaps not what these locking mechanisms were
intended for, but just thought I'd bring up this perspective.
As you've observed, with the approach of waiting for all pre-empted tasks
to synchronize, the possibility of a task staying pre-empted for a long
time could affect the latency of an update/synchonize (though its hard for
me to judge how likely that is). Besides, as Andi pointed out, there
probably are a lot of situations where the readers are not pre-emptible
anyway, so that waiting for all pre-empted tasks may be superfluos.
Given these possibilities, does it make sense to simply let the
updater/synchronize kernel specify an option indicating whether it would
wait for pre-empted tasks or not ?
Regards
Suparna
Suparna Bhattacharya
IBM Software Lab, India
E-mail : bsuparna@in.ibm.com
Phone : 91-80-5267117, Extn : 2525
next reply other threads:[~2001-04-09 13:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-09 12:46 bsuparna [this message]
2001-04-09 23:28 ` Nigel Gamble
-- strict thread matches above, loose matches on Subject: below --
2001-04-22 13:38 Paul McKenney
2001-04-11 4:08 Paul McKenney
2001-04-11 5:22 ` yodaiken
2001-04-11 8:37 ` Nigel Gamble
2001-04-11 8:19 ` Nigel Gamble
2001-04-10 22:08 Paul McKenney
2001-04-10 23:49 ` Nigel Gamble
2001-04-07 23:59 Paul McKenney
2001-04-07 23:54 Paul McKenney
2001-04-10 15:21 ` Rusty Russell
2001-04-07 1:25 Paul McKenney
2001-04-07 21:25 ` [Lse-tech] " Andi Kleen
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=CA256A29.0047C346.00@d73mta05.au.ibm.com \
--to=bsuparna@in.ibm.com \
--cc=ak@suse.de \
--cc=dipankar.sarma@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=paul.mckenney@us.ibm.com \
/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
all inboxes | Powered by JetHome®