lkml.org 
[lkml]   [2010]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] pipe: add support for shrinking and growing pipes
From
Date
Miklos Szeredi <miklos@szeredi.hu> 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@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2010-05-20 14:55    [W:1.049 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site