linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] fix
@ 2009-03-23 14:53 Martin Peschke
  2009-03-23 18:40 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Peschke @ 2009-03-23 14:53 UTC (permalink / raw)
  To: linux-btrace

Jens,

Tom fixed my "boken trace magic" issue. Please apply.

Thanks,
Martin


From: Tom Zanussi <tzanussi@gmail.com>

Blktrace failed to lock reader threads on the cpu used by the corresponding
writer. This resulted in stale data being consumed when blktrace accidently
read at a position that was being written to at the same time. This issue
surfaced as "bad trace magic" warnings emitted by blktrace tools.

The problem occured on an SMP System z machine. The patch fixes the issue.

Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>

---
 blktrace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/blktrace.c
+++ b/blktrace.c
@@ -610,7 +610,7 @@ static int lock_on_cpu(int cpu)
 
 	CPU_ZERO(&cpu_mask);
 	CPU_SET(cpu, &cpu_mask);
-	if (sched_setaffinity(getpid(), sizeof(cpu_mask), &cpu_mask) < 0)
+	if (sched_setaffinity(0, sizeof(cpu_mask), &cpu_mask) < 0)
 		return errno;
 
 	return 0;



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] fix
  2009-03-23 14:53 [Patch] fix Martin Peschke
@ 2009-03-23 18:40 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2009-03-23 18:40 UTC (permalink / raw)
  To: linux-btrace

On Mon, Mar 23 2009, Martin Peschke wrote:
> Jens,
> 
> Tom fixed my "boken trace magic" issue. Please apply.

Heh well, not sure I'd call that a real fix, but if it makes things,
that is fine. I'll apply it.

> 
> Thanks,
> Martin
> 
> 
> From: Tom Zanussi <tzanussi@gmail.com>
> 
> Blktrace failed to lock reader threads on the cpu used by the corresponding
> writer. This resulted in stale data being consumed when blktrace accidently
> read at a position that was being written to at the same time. This issue
> surfaced as "bad trace magic" warnings emitted by blktrace tools.
> 
> The problem occured on an SMP System z machine. The patch fixes the issue.
> 
> Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
> 
> ---
>  blktrace.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/blktrace.c
> +++ b/blktrace.c
> @@ -610,7 +610,7 @@ static int lock_on_cpu(int cpu)
>  
>  	CPU_ZERO(&cpu_mask);
>  	CPU_SET(cpu, &cpu_mask);
> -	if (sched_setaffinity(getpid(), sizeof(cpu_mask), &cpu_mask) < 0)
> +	if (sched_setaffinity(0, sizeof(cpu_mask), &cpu_mask) < 0)
>  		return errno;
>  
>  	return 0;
> 
> 

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-23 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 14:53 [Patch] fix Martin Peschke
2009-03-23 18:40 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).