public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Erik Jacobson <erikj@sgi.com>
Cc: guillaume.thouvenin@bull.net, matthltc@us.ibm.com,
	linux-kernel@vger.kernel.org, zaitcev@redhat.com
Subject: Re: [PATCH] connector: Some fixes for ia64 unaligned access errors
Date: Sat, 9 Dec 2006 18:34:09 -0800	[thread overview]
Message-ID: <20061209183409.67b54d01.zaitcev@redhat.com> (raw)
In-Reply-To: <20061209210913.GA15159@sgi.com>

On Sat, 9 Dec 2006 15:09:13 -0600, Erik Jacobson <erikj@sgi.com> wrote:

> > Please try to declare u64 timestamp_ns, then copy it into the *ev
> > instead of copying whole *ev. This ought to fix the problem if
> > buffer[] ends aligned to 32 bits or better.
> 
> So I took this suggestion for a spin and met with the same result.
> The unaligned access messages are still produced.

I see. And I see you went a few steps forward with dignosing it:

> dbg fork after timespec_to_ns call, b4 memcpy
> kernel unaligned access to 0xe000003076b6fbe4, ip=0xa0000001004f1480
> dbg fork after memcpy, b4 other ev settings...

> a0000001004f1470 <proc_fork_connector+0x1f0> [MMI]       ld8 r40=[r14]
> a0000001004f1476 <proc_fork_connector+0x1f6>             ld8 r38=[r38]
> a0000001004f147c <proc_fork_connector+0x1fc>             nop.i 0x0;;
> a0000001004f1480 <proc_fork_connector+0x200> [MIB]       st8 [r39]=r40
> a0000001004f1486 <proc_fork_connector+0x206>             nop.i 0x0
> a0000001004f148c <proc_fork_connector+0x20c>             br.call.sptk.many b0=a0000001000a36c0 <printk>;;

It seems rather strange that memcpy gets optimized this way. I could
not have foreseen it. Still, it was worth a try, even if putting 32
extra bytes on stack and running memcpy on them does not seem too
onerous, for a fork(). Thanks for doing it, and let's go with your
original patch then... if Matt Helsley does not mind.

Thank you,
-- Pete

P.S. This syntax seems to cry for being expressed in diff -u:

>    ktime_get_ts(&ts); /* get high res monotonic timestamp */
>    //ev->timestamp_ns = timespec_to_ns(&ts); removed
>    printk("dbg fork before timestamp_to_ns call\n");
>    timestamp_ns = timespec_to_ns(&ts); //added
>    printk("dbg fork after timespec_to_ns call, b4 memcpy\n");
>    memcpy(&ev->timestamp_ns, &timestamp_ns, sizeof(ev->timestamp_ns)); //added
>    printk("dbg fork after memcpy, b4 other ev settings...\n");


  reply	other threads:[~2006-12-10  2:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07 23:22 [PATCH] connector: Some fixes for ia64 unaligned access errors Erik Jacobson
2006-12-09  3:20 ` Pete Zaitcev
2006-12-09  7:47   ` Matt Helsley
2006-12-09 21:09   ` Erik Jacobson
2006-12-10  2:34     ` Pete Zaitcev [this message]
2006-12-11 23:52       ` Matt Helsley
2006-12-12  1:29         ` Pete Zaitcev
2006-12-12  1:50           ` David Miller
2006-12-12  3:09             ` Matt Helsley
2006-12-12  3:41               ` David Miller
2006-12-12  2:07           ` Chen, Kenneth W
2006-12-11 23:52 ` Matt Helsley
2006-12-12 17:54   ` Erik Jacobson
2006-12-13  0:45     ` Andrew Morton
2006-12-13  2:31       ` Erik Jacobson
2006-12-13  2:38         ` Andrew Morton
2006-12-13  6:08           ` Erik Jacobson

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=20061209183409.67b54d01.zaitcev@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=erikj@sgi.com \
    --cc=guillaume.thouvenin@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthltc@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