Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757561AbYB0IOp (ORCPT ); Wed, 27 Feb 2008 03:14:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753909AbYB0IOe (ORCPT ); Wed, 27 Feb 2008 03:14:34 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:45496 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbYB0IOd (ORCPT ); Wed, 27 Feb 2008 03:14:33 -0500 Subject: Re: [PATCH 00/28] Swap over NFS -v16 From: Peter Zijlstra To: Pekka Enberg 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 In-Reply-To: <84144f020802270005p3bfbd04ar9da2875218ef98c4@mail.gmail.com> 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> Content-Type: text/plain Date: Wed, 27 Feb 2008 09:14:19 +0100 Message-Id: <1204100059.6242.360.camel@lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.21.90 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1524 Lines: 32 On Wed, 2008-02-27 at 10:05 +0200, Pekka Enberg wrote: > Hi Peter, > > On Wed, Feb 27, 2008 at 9:58 AM, Peter Zijlstra wrote: > > > 1/ I note there is no way to tell if memory returned by kmalloc is > > > from the emergency reserve - which contrasts with alloc_page > > > which does make that information available through page->reserve. > > > This seems a slightly unfortunate aspect of the interface. > > > > Yes, but alas there is no room to store such information in kmalloc(). > > That is, in a sane way. I think it was Daniel Phillips who suggested > > encoding it in the return pointer by flipping the low bit - but that is > > just too ugly and breaks all current kmalloc sites to boot. > > Why can't you add a kmem_is_emergency() to SLUB that looks up the > cache/slab/page (whatever is the smallest unit of the emergency pool > here) for the object and use that? There is an idea.. :-) It would mean preserving page->reserved, but SLUB has plenty of page flags to pick from. Or maybe I should move the thing to a page flag anyway. If we do that SLAB would allow something similar, just look up the page for whatever address you get and look at PG_emerg or something. Having this would clean things up. I'll go work on this. -- 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/