From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542Ab2GFJUf (ORCPT ); Fri, 6 Jul 2012 05:20:35 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:6202 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143Ab2GFJUc (ORCPT ); Fri, 6 Jul 2012 05:20:32 -0400 Message-ID: <4FF6A21C.9010509@huawei.com> Date: Fri, 6 Jul 2012 16:30:20 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Christoph Lameter CC: Jiang Liu , Pekka Enberg , Matt Mackall , Mel Gorman , Yinghai Lu , Tony Luck , KAMEZAWA Hiroyuki , KOSAKI Motohiro , David Rientjes , Minchan Kim , Keping Chen , , Subject: Re: [RFC PATCH 2/4] mm: make consistent use of PG_slab flag References: <1341287837-7904-1-git-send-email-jiang.liu@huawei.com> <1341287837-7904-2-git-send-email-jiang.liu@huawei.com> <4FF5BD9D.9040101@gmail.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.108.108.229] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2012-7-6 1:37, Christoph Lameter wrote: >> Hi Chris, >> I think there's a little difference with SLUB and SLOB for compound page. >> For SLOB, it relies on the page allocator to allocate compound page to fulfill >> request bigger than one page. For SLUB, it relies on the page allocator if the >> request is bigger than two pages. So SLUB may allocate a 2-pages compound page >> to host SLUB managed objects. >> My proposal may be summarized as below: >> 1) PG_slab flag marks a memory object is allocated from slab allocator. >> 2) PG_slabobject marks a (compound) page hosts SLUB/SLOB managed objects. >> 3) Only set PG_slab/PG_slabobject on the head page of compound pages. >> 4) For SLAB, PG_slabobject is redundant and so not used. >> >> A summary of proposed usage of PG_slab(S) and PG_slabobject(O) with >> SLAB/SLUB/SLOB allocators as below: >> pagesize SLAB SLUB SLOB >> 1page S S,O S,O >> 2page S S,O S >>> =4page S S S > > There is no point of recognizing such objects because those will be > kmalloc objects and they can only be freed in a subsystem specific way. > There is no standard way to even figure out which subsystem allocated > them. So for all practical purposes those are unrecoverable. Hi Chris, This patch is not for hotplug, but is to fix some issues in current kernel, such as: 1) make show_mem() on ARM and unicore32 report consistent information no matter which slab allocator is used. 2) make /proc/kpagecount and /proc/kpageflags return accurate information. 3) Get rid of risks in mm/memory_failure.c and arch/ia64/kernel/mca_drv.c Thanks!