lkml.org 
[lkml]   [2008]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/28] Swap over NFS -v16
On Wed, 27 Feb 2008, Peter Zijlstra wrote:
> Humm, and here I sit staring at the screen. Perhaps I should go get my
> morning juice, but...
>
> if (mem_reserve_kmalloc_charge(my_res, sizeof(*foo), 0)) {
> foo = kmalloc(sizeof(*foo), gfp|__GFP_MEMALLOC)
> if (!kmem_is_emergency(foo))
> mem_reserve_kmalloc_charge(my_res, -sizeof(*foo), 0)
> } else
> foo = kmalloc(sizeof(*foo), gfp);
>
> Just doesn't look too pretty..
>
> And needing to always account the allocation seems wrong.. but I'll take
> poison and see if that wakes up my mind.

Hmm, perhaps this is just hand-waving but why don't you have a
kmalloc_reserve() function in SLUB that does the accounting properly?

Pekka


\
 
 \ /
  Last update: 2008-02-27 09:45    [W:0.240 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site