Linux PARISC architecture development
 help / color / mirror / Atom feed
From: "Michael S. Zick" <mszick@morethan.org>
To: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Mysterious hangs with parisc (a send_group_sig_info() analysis)
Date: Sat, 22 Jul 2006 18:49:18 -0500	[thread overview]
Message-ID: <200607221849.18925.mszick@morethan.org> (raw)
In-Reply-To: <44C2A23C.8000509@tiscali.be>

On Sat July 22 2006 17:10, Joel Soete wrote:
> 
> Carlos O'Donell wrote:
> >>         Q4: imho the most important: with 2 gcc where is the couple of 
> >> ssm/rsm that jejb introduced in his patch:
> > 
> > 
> > The *most* important piece of imformation is the pre-compiled source.
>     if (flags & 0x00000001) {
>      __asm__ __volatile__("ssm %0,%%r0\n" : : "i" (0x00000001) : "memory" );
>      __asm__ __volatile__("":::"memory");
>      __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (0x00000001) : "memory" );
>     } else
>      __asm__ __volatile__("":::"memory");
> 
> > You *must* determine that both paths of the if/else are different,
> > because if they are the same, then GCC is right to remove one of the
> > paths, and unconditionally call cpu_relax.
> > 

Note: That code is the same when either compiler is used;
_But_ as a separate problem...

My reading of the intent of that added code was:

Busy_Loop:
   If (Interrupts are disabled) {
      Enable interrupts;
      Cpu_relax; /* Long enough to recognize pending interrupts */
      Disable interrupts;
   } else {
      Cpu_relax;
   }

And my complaint was a matter of structure...

The assumption here is that the flag bit in an external variable
is always in-sync with the interrupt status bit in the register.

Obviously a false assumption, this routine is an example...

Inside the first if block, the status bit is changed but the external
variable bit is not.

A general purpose, like we don't know what state the interrupts
are in, and we don't want to trust an external flag bit;

Looks like:

Busy_Loop:
   Save current interrupt status to the external variable;
   Enable interrupts; /* a nop if already enabled */
   Cpu_relax; /* Long enough to recognize pending interrupts */
   Restore interrupt status from external variable;

Our redefining Cpu_relax to a pair of nops was for machines that
delay recognizing interrupts for an instruction after changing
the status bit.  We also included an asm comment in Cpu_relax
just in case we wanted to see that it had not gotten optimized away.

Same reason the mb() was redefined as an asm comment that could
be identified by inspection.

Mike
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2006-07-22 23:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060624015935.GJ12481@quicksilver.road.mcmartin.ca>
     [not found] ` <200606240241.k5O2fALQ001885@hiauly1.hia.nrc.ca>
2006-07-05 16:47   ` [parisc-linux] Mysterious hangs with parisc Kyle McMartin
2006-07-06 18:22     ` Joel Soete
2006-07-06 18:34       ` Kyle McMartin
2006-07-21 20:05         ` [parisc-linux] Mysterious hangs with parisc (a send_group_sig_info() analysis) Joel Soete
2006-07-21 20:21           ` Michael S. Zick
2006-07-22 17:23           ` Carlos O'Donell
2006-07-22 19:11             ` Michael S. Zick
2006-07-22 17:29           ` Carlos O'Donell
2006-07-22 22:10             ` Joel Soete
2006-07-22 23:49               ` Michael S. Zick [this message]
2006-07-24  4:16                 ` Grant Grundler

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=200607221849.18925.mszick@morethan.org \
    --to=mszick@morethan.org \
    --cc=parisc-linux@lists.parisc-linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox