All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: adeos-main@gna.org
Subject: Re: [Adeos-main] [PATCHES] cleanup minor quirks for 1.6-01
Date: Thu, 14 Dec 2006 21:53:39 +0100	[thread overview]
Message-ID: <1166129619.23946.164.camel@domain.hid> (raw)
In-Reply-To: <4577546A.7040208@domain.hid>

On Thu, 2006-12-07 at 00:38 +0100, Jan Kiszka wrote:

> > 
> >> If there is actually something to protect, than it should be calling
> >> this proc handler vs. unregistering the domain (and it's proc entry) -
> >> but that is only feasible with something like synchronize_sched, i.e.
> >> waiting a grace period after unregistering so that all handlers are
> >> through. A really uncritical race which exists with a lot of /proc code.
> >>
> > 
> > This race could crash the box, would the descriptor from the
> > unregistered domain belong to a module being unloaded. Since
> > ipipe_register_domain() grabs the critical lock, masking IRQs in
> > the /proc handler would do the trick, but this is a fairly high price to
> > pay for running such a routine. 
> > 
> 
> Better no IRQ lock for this.
> 

Clearly.

> Well, also my synchronize_sched idea is not truly safe (unless the proce
> handler would be called under rcu_read_lock - don't think this is the
> case). I really can't tell how to safely cleanup proc entries that have
> volatile data structures attached. I once asked on LKML for a correct
> pattern but got no reply.

Let's go for a simple mutex excluding the unregistration routine for
now. Not perfect, but still better than the previous situation. It's
been introduced in 1.6-02/x86.

-- 
Philippe.




      reply	other threads:[~2006-12-14 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03 14:13 [Adeos-main] [PATCHES] cleanup minor quirks for 1.6-01 Jan Kiszka
2006-12-03 14:43 ` Philippe Gerum
2006-12-03 14:50   ` Philippe Gerum
2006-12-03 15:05   ` Jan Kiszka
2006-12-03 15:47     ` Philippe Gerum
2006-12-03 18:01       ` Jan Kiszka
2006-12-03 20:22         ` Philippe Gerum
2006-12-06 23:38           ` Jan Kiszka
2006-12-14 20:53             ` Philippe Gerum [this message]

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=1166129619.23946.164.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=adeos-main@gna.org \
    --cc=jan.kiszka@domain.hid \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.