All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
To: Tom Zanussi <zanussi@comcast.net>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	jens.axboe@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PROBLEM] hard-lock with kmemtrace, relayfs, and splice
Date: Sat, 11 Oct 2008 21:17:29 +0300	[thread overview]
Message-ID: <20081011181728.GA5309@localhost> (raw)
In-Reply-To: <1223701131.7489.25.camel@charm-linux>

On Fri, Oct 10, 2008 at 11:58:51PM -0500, Tom Zanussi wrote:
> It worked for me, but I also had to apply the following patch to
> kmemtraced:
> 
> diff --git a/kmemtraced.c b/kmemtraced.c
> index 217478d..324ced9 100644
> --- a/kmemtraced.c
> +++ b/kmemtraced.c
> @@ -109,6 +109,8 @@ static void *reader_thread(void *data)
>  		if (retval < 0)
>  			panic("splice() (from) failed: %s\n",
>  			      strerror(errno));
> +		if (!retval)
> +			continue;
>  		retval = splice(pipe_fd[0], NULL, log_fd, NULL,
>  				128, SPLICE_F_MOVE);
>  		if (retval < 0)
> 
> Otherwise it would end up hanging kmemtraced in the second splice (pipe
> to log_fd) if the return from the first splice was 0 (i.e. there's no
> data available (and we can never know if there will ever be any
> more)).

Thanks, I'll apply it.

> I'm not sure why kmemtraced is only splicing 128 bytes at a time - it
> seems to defeat the purpose - or why it wouldn't be using poll to know
> when there's at least a whole sub-buffer to splice, but to each his own.
> Hopefully the kernel patch at least fixes the loop. 

Yeah, it was a misguided attempt to fix the strange behavior.

> Tom


	Cheers,
	Eduard


  reply	other threads:[~2008-10-11 18:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23 21:29 [ANNOUNCE] kmemtrace-user repo update Eduard - Gabriel Munteanu
     [not found] ` <1223386477.28348.42.camel@penberg-laptop>
     [not found]   ` <1223623191.8959.26.camel@penberg-laptop>
     [not found]     ` <1223628687.8959.37.camel@penberg-laptop>
     [not found]       ` <1223629803.8959.40.camel@penberg-laptop>
2008-10-10  9:42         ` [PROBLEM] hard-lock with kmemtrace, relayfs, and splice Pekka Enberg
2008-10-10 11:51           ` Eduard - Gabriel Munteanu
2008-10-11  4:58           ` Tom Zanussi
2008-10-11 18:17             ` Eduard - Gabriel Munteanu [this message]
2008-10-13  6:57             ` Pekka Enberg
2008-10-14  4:03               ` Tom Zanussi
2008-10-14  5:13                 ` Pekka Enberg
2008-10-14  5:46                   ` Tom Zanussi
2008-10-14  6:58                     ` Pekka Enberg
2008-10-14  7:30                     ` Eduard - Gabriel Munteanu
2008-10-14  7:05                   ` Pekka Enberg
2008-10-24  4:44           ` Peter Teoh
2008-10-24 14:15             ` Pekka Enberg
2008-10-25  0:56               ` Peter Teoh
2008-10-25 14:04                 ` Eduard - Gabriel Munteanu

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=20081011181728.GA5309@localhost \
    --to=eduard.munteanu@linux360.ro \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=zanussi@comcast.net \
    /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.