All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Pending patches
Date: Tue, 27 Jan 2009 14:29:32 +0100	[thread overview]
Message-ID: <497F0C3C.5040004@domain.hid> (raw)
In-Reply-To: <497F07D2.6080501@domain.hid>

Jan Kiszka wrote:
> Philippe Gerum wrote:
>> We should indeed postpone this just in case the upper layer indexes the extra
>> state on the minor value. We can also simplify a few things doing so.
>>
>> --- ksrc/nucleus/pipe.c	(revision 4565)
>> +++ ksrc/nucleus/pipe.c	(working copy)
>> @@ -77,11 +77,9 @@
>>
>>  static inline void xnpipe_minor_free(int minor)
>>  {
>> -	if (minor < 0 || minor >= XNPIPE_NDEVS)
>> -		return;
>> -
>> -	__clrbits(xnpipe_bitmap[minor / BITS_PER_LONG],
>> -		  1UL << (minor % BITS_PER_LONG));
>> +	/* May be called with nklock free. */
>> +	clrbits(xnpipe_bitmap[minor / BITS_PER_LONG],
>> +		1UL << (minor % BITS_PER_LONG));
> 
> Bad news: This doesn't fly as is. All modifying operations on
> xnpipe_bitmap must be atomic and xnpipe_bitmap has to be
> xnarch_atomic_t. But then find_first_zero_bit breaks. Is there some
> version for atomic arrays? I guess we have to open-code this, at least
> down to word-level...
> 

#define clrbits(flags,mask)  xnarch_atomic_clear_mask(&(flags),mask)

which is either translated to atomic_clear_mask() on x86 which works on a long
value, or to any Xenomai-local implementation that work the same way for other
archs. IOW, clrbits() shall be an atomic op by essence in our implementation.

The thing is that Linux atomic_set/clear_mask() on x86_64 is broken
(s,andl,andq), so we may have to provide ours.

> Jan
> 


-- 
Philippe.


  parent reply	other threads:[~2009-01-27 13:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 10:19 [Xenomai-core] Pending patches Jan Kiszka
2009-01-15 10:30 ` Gilles Chanteperdrix
2009-01-15 11:00   ` Gilles Chanteperdrix
2009-01-15 11:31     ` Jan Kiszka
2009-01-15 13:02       ` Gilles Chanteperdrix
2009-01-15 14:12         ` Jan Kiszka
2009-01-15 11:28   ` Jan Kiszka
2009-01-15 13:09     ` Gilles Chanteperdrix
2009-01-15 14:17       ` Jan Kiszka
2009-01-15 21:46         ` Jan Kiszka
2009-01-15 10:49 ` Philippe Gerum
2009-01-15 11:24   ` Jan Kiszka
2009-01-15 12:09     ` Philippe Gerum
2009-01-15 13:55       ` Jan Kiszka
2009-01-15 14:16         ` Philippe Gerum
2009-01-19 23:18           ` Philippe Gerum
2009-01-19 23:35             ` Jan Kiszka
2009-01-20  8:49               ` Philippe Gerum
2009-01-20  9:06                 ` Jan Kiszka
2009-01-20  9:18                   ` Jan Kiszka
2009-01-20  9:22                   ` Philippe Gerum
2009-01-27 13:10                 ` Jan Kiszka
2009-01-27 13:26                   ` Jan Kiszka
2009-01-27 13:28                     ` Gilles Chanteperdrix
2009-01-27 13:29                   ` Philippe Gerum [this message]
2009-01-27 13:40                     ` Gilles Chanteperdrix
2009-01-27 13:40                   ` Philippe Gerum

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=497F0C3C.5040004@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.