mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <Nikita@Namesys.COM>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <Linux-Kernel@Vger.Kernel.ORG>
Subject: Re: kernel thread exit race
Date: Wed, 7 Aug 2002 15:30:17 +0400	[thread overview]
Message-ID: <15697.1225.84051.277799@laputa.namesys.com> (raw)
In-Reply-To: <1028722283.18156.274.camel@irongate.swansea.linux.org.uk>

Alan Cox writes:
 > On Wed, 2002-08-07 at 11:05, Nikita Danilov wrote:
 > > Ah I see, thank you and Russell. But this depends on no architecture
 > > ever accessing spinlock data after letting waiters to run, otherwise
 > > there still is (tiny) window for race at the end of complete() call,
 > > right?
 > 
 > complete() as opposed to spinlocks/semaphores is defined to be safe to
 > free the object once the complete finishes

So, complete() is not-arch dependent because spinlocks are "good" in all
architectures? complete() ends with spin_unlock_irqrestore() so it
cannot be any better than spinlocks, until there is some hidden magic.

Let me clarify this. Suppose there is some obscure architecture that
maintains in spinlocks some additional data for debugging. Then,

complete_and_exit()->complete()->spin_unlock_irqrestore() 

"wakes up" thread on another CPU and proceeds to access spin-lock data
(to check/update debugging information, for example), but by this time
woken up thread manages to unload module and to un-map page containing
spin-lock data.

 > 

Nikita.

  reply	other threads:[~2002-08-07 11:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-07  9:22 Nikita Danilov
2002-08-07  9:38 ` Russell King
2002-08-07 11:18 ` Alan Cox
2002-08-07 10:05   ` Nikita Danilov
2002-08-07 12:11     ` Alan Cox
2002-08-07 11:30       ` Nikita Danilov [this message]
2002-08-07 12:12         ` Russell King
2002-08-07 13:22         ` Alan Cox

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=15697.1225.84051.277799@laputa.namesys.com \
    --to=nikita@namesys.com \
    --cc=Linux-Kernel@Vger.Kernel.ORG \
    --cc=alan@lxorguk.ukuu.org.uk \
    /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®