lkml.org 
[lkml]   [2008]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PROBLEM] hard-lock with kmemtrace, relayfs, and splice
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



\
 
 \ /
  Last update: 2008-10-11 20:19    [W:0.118 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site