From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755955Ab1BAKEj (ORCPT ); Tue, 1 Feb 2011 05:04:39 -0500 Received: from zene.cmpxchg.org ([85.214.230.12]:45031 "EHLO zene.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918Ab1BAKEh (ORCPT ); Tue, 1 Feb 2011 05:04:37 -0500 Date: Tue, 1 Feb 2011 11:04:34 +0100 From: Johannes Weiner To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michael J Wolf , Andrea Arcangeli Subject: Re: [RFC][PATCH 2/6] pagewalk: only split huge pages when necessary Message-ID: <20110201100433.GH19534@cmpxchg.org> References: <20110201003357.D6F0BE0D@kernel> <20110201003359.8DDFF665@kernel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110201003359.8DDFF665@kernel> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2011 at 04:33:59PM -0800, Dave Hansen wrote: > > Right now, if a mm_walk has either ->pte_entry or ->pmd_entry > set, it will unconditionally split and transparent huge pages > it runs in to. In practice, that means that anyone doing a > > cat /proc/$pid/smaps > > will unconditionally break down every huge page in the process > and depend on khugepaged to re-collapse it later. This is > fairly suboptimal. > > This patch changes that behavior. It teaches each ->pmd_entry > handler (there are three) that they must break down the THPs > themselves. Also, the _generic_ code will never break down > a THP unless a ->pte_entry handler is actually set. > > This means that the ->pmd_entry handlers can now choose to > deal with THPs without breaking them down. Makes perfect sense. But you forgot to push down the splitting into the two handlers in mm/memcontrol.c.