Re: [patch] pipe: add support for shrinking and growing pipes

From: Andi Kleen
Date: Thu May 20 2010 - 08:52:29 EST


Miklos Szeredi <miklos@xxxxxxxxxx> writes:
> +
> + /*
> + * We can shrink the pipe, if arg >= pipe->nrbufs. Since we don't
> + * expect a lot of shrink+grow operations, just free and allocate
> + * again like we would do for growing. If the pipe currently
> + * contains more buffers than arg, then return busy.
> + */
> + if (arg < pipe->nrbufs)
> + return -EBUSY;
> +
> + bufs = kcalloc(arg, sizeof(struct pipe_buffer), GFP_KERNEL);

While this is conceptually like socket buffers, socket buffers
have sophisticated mechanisms to throttle their memory use
under low memory conditions. That's not there here?

It means every user could pin a lot of memory.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/