Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932403AbYB2M3m (ORCPT ); Fri, 29 Feb 2008 07:29:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760004AbYB2M3M (ORCPT ); Fri, 29 Feb 2008 07:29:12 -0500 Received: from rv-out-0910.google.com ([209.85.198.187]:1244 "EHLO rv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758929AbYB2M3H (ORCPT ); Fri, 29 Feb 2008 07:29:07 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=cj2N4Ca7dWiTXUt52It/+6vIsP0bqoaKEWdl4UaixDUABVe0WKcQSTEtAsJ0iRfxdaHJWLTUb12a4j4AEBeRmg32RFspzZ0ppeCCkI0XMKJqNJVUjjGcWRH6il85cZ7FtNtY+cUPgFktpOSYGDOWfaysfu+zD2zdI1dvZxOgMeU= Message-ID: <84144f020802290429v25bd4ab2j8ab640e2ccb48140@mail.gmail.com> Date: Fri, 29 Feb 2008 14:29:06 +0200 From: "Pekka Enberg" To: "Peter Zijlstra" Subject: Re: [PATCH 00/28] Swap over NFS -v16 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, "Christoph Lameter" In-Reply-To: <1204287533.6243.105.camel@lappy> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> <1204285912.6243.93.camel@lappy> <84144f020802290358t2774f7bwd87efe79e7bd4235@mail.gmail.com> <1204287533.6243.105.camel@lappy> X-Google-Sender-Auth: 4072f1e8b766abbb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 32 On Fri, Feb 29, 2008 at 2:18 PM, Peter Zijlstra wrote: > Clearing PG_emergency would mean kmem_is_emergency() would return false > in kfree_reserve() and fail to un-charge the object. > > Previously objects would track their account status themselves (when > needed) and freeing PG_emergency wouldn't be a problem. > > > and allocate a new fresh page to the reserves? > > Not sure I understand this properly. We would only do this once the page > watermarks are high enough, so the reserves are full again. The problem with PG_emergency is that, once the watermarks are high again, SLUB keeps holding to the emergency page and it cannot be used for regular kmalloc allocations, right? So the way to fix this is to batch uncharge the objects and clear PG_emergency for the said SLUB pages thus freeing them for regular allocations. And to compensate for the loss in the reserves, we ask the page allocator to give a new one that SLUB knows nothing about. If you don't do this, the reserve page can only contain few objects making them unavailable for regular allocations. So we're might be forced into "emergency mode" even though there's enough memory available to satisfy the allocation. 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/