From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Esben Nielsen <nielsen.esben@googlemail.com>
Cc: mingo@elte.hu, oleg@tv-sign.ru, linux-kernel@vger.kernel.org,
dino@us.ibm.com, tytso@us.ibm.com, dvhltc@us.ibm.com
Subject: Re: [PATCH -rt] catch put_task_struct RCU handling up to mainline
Date: Mon, 10 Jul 2006 10:48:46 -0700 [thread overview]
Message-ID: <20060710174846.GD1446@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0607101855410.14469@localhost.localdomain>
On Mon, Jul 10, 2006 at 07:10:49PM +0100, Esben Nielsen wrote:
> On Mon, 10 Jul 2006, Paul E. McKenney wrote:
> >On Sat, Jul 08, 2006 at 02:59:37PM +0100, Esben Nielsen wrote:
[ . . . ]
> >>The work should be defered to a low priority task. Using rcu is
> >>probably overkill because it also introduces other delays. A tasklet
> >>or a dedicated task would be better.
> >
> >Agreed -- if there is in fact a legitimate non-error code path, then
> >a patch that used some deferral mechanism would be good. But RCU is
> >overkill, and misleading overkill at that!
> >
>
> I think this is a legitimate situation. lock 1 is owned by B which is
> blocked on lock 2 which is owned by C
>
> CPU1: CPU2
> RT task A locks lock 1 C runs something
> A boosts B to RT
> A does get_task_struct B
> A enables interrupts C unlocks lock 2
> An very long interrupt is running B unlocks lock 2
> B unlocks lock 1
> B is deboosted
> B exits
> A gets CPU1 again
> A does put_task_struct B
>
> I don't know if the timing is realistic, but theoretically it is possible.
> It might also be possible the B exits on another CPU even without the long
> interrupt handler. If A has cpu affinity to CPU1 it is enough if a higher
> priority task preempts it on CPU1.
For this to happen, either A has to be at a lower priority than the irq
tasks or the interrupt has to be a hard irq (e.g., scheduling clock
interrupt). In the first case, the added cleanup processing seems
inconsequential compared to (say) an interrupt doing network protocol
processing. In the second case, B does not do its put_task_struct()
until after the hard irq returns (because the put_task_struct() is invoked
from a call_rcu() callback), which makes the above scenario unlikely,
though perhaps not impossible.
If the second scenario is in fact possible, would you be willing to
supply the appropriate deferral code? I believe we both agree that RCU
is not really the right deferral mechanism in this situation.
Thanx, Paul
next prev parent reply other threads:[~2006-07-10 17:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-07 19:29 [PATCH -rt] catch put_task_struct RCU handling up to mainline Paul E. McKenney
2006-07-07 22:56 ` Esben Nielsen
2006-07-07 23:15 ` Paul E. McKenney
2006-07-08 13:59 ` Esben Nielsen
2006-07-10 15:51 ` Paul E. McKenney
2006-07-10 18:10 ` Esben Nielsen
2006-07-10 17:48 ` Paul E. McKenney [this message]
2006-07-10 20:09 ` Esben Nielsen
2006-07-11 17:45 ` Paul E. McKenney
2006-07-26 8:34 ` Ingo Molnar
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=20060710174846.GD1446@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=dino@us.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nielsen.esben@googlemail.com \
--cc=oleg@tv-sign.ru \
--cc=tytso@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