Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758845AbYB0Inp (ORCPT ); Wed, 27 Feb 2008 03:43:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752778AbYB0Inf (ORCPT ); Wed, 27 Feb 2008 03:43:35 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:52643 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127AbYB0Ine (ORCPT ); Wed, 27 Feb 2008 03:43:34 -0500 Date: Wed, 27 Feb 2008 10:43:32 +0200 (EET) From: Pekka J Enberg To: Peter Zijlstra cc: Neil Brown , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, trond.myklebust@fys.uio.no Subject: Re: [PATCH 00/28] Swap over NFS -v16 In-Reply-To: <1204101239.6242.372.camel@lappy> Message-ID: References: <20080220144610.548202000@chello.nl> <20080223000620.7fee8ff8.akpm@linux-foundation.org> <18371.43950.150842.429997@notabene.brown> <1204023042.6242.271.camel@lappy> <18372.64081.995262.986841@notabene.brown> <1204099113.6242.353.camel@lappy> <84144f020802270005p3bfbd04ar9da2875218ef98c4@mail.gmail.com> <1204100059.6242.360.camel@lappy> <1204101239.6242.372.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 954 Lines: 25 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/