Lines Matching defs:prealloc
114 static struct page *anon_pipe_prealloc_pop(struct anon_pipe_prealloc *prealloc)
116 if (!prealloc->count)
119 prealloc->count--;
121 return prealloc->pages[prealloc->count];
124 /* Push a page to the prealloc pool. Returns true if added, false if full. */
125 static bool anon_pipe_prealloc_push(struct anon_pipe_prealloc *prealloc,
128 if (prealloc->count >= PIPE_PREALLOC_MAX)
130 prealloc->pages[prealloc->count++] = page;
149 have = min_t(unsigned int, READ_ONCE(pipe->prealloc.count), want);
166 while (n && anon_pipe_prealloc_push(&pipe->prealloc, pages[n - 1]))
186 while (pipe->prealloc.count > PIPE_PREALLOC_KEEP)
187 excess[nexcess++] = anon_pipe_prealloc_pop(&pipe->prealloc);
198 /* Drain the prealloc pool before allocating. Called with mutex held. */
199 page = anon_pipe_prealloc_pop(&pipe->prealloc);
211 anon_pipe_prealloc_push(&pipe->prealloc, page))
903 for (i = 0; i < pipe->prealloc.count; i++)
904 __free_page(pipe->prealloc.pages[i]);