[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081011181728.GA5309@localhost>
Date: Sat, 11 Oct 2008 21:17:29 +0300
From: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
To: Tom Zanussi <zanussi@...cast.net>
Cc: Pekka Enberg <penberg@...helsinki.fi>, jens.axboe@...cle.com,
linux-kernel@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists