Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841Ab3HUE2b (ORCPT ); Wed, 21 Aug 2013 00:28:31 -0400 Received: from mail-oa0-f52.google.com ([209.85.219.52]:32938 "EHLO mail-oa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623Ab3HUE2a (ORCPT ); Wed, 21 Aug 2013 00:28:30 -0400 MIME-Version: 1.0 In-Reply-To: <52142ffe.84c0440a.57e5.02acSMTPIN_ADDED_BROKEN@mx.google.com> References: <1376981696-4312-1-git-send-email-liwanp@linux.vnet.ibm.com> <1376981696-4312-2-git-send-email-liwanp@linux.vnet.ibm.com> <20130820160735.b12fe1b3dd64b4dc146d2fa0@linux-foundation.org> <52142ffe.84c0440a.57e5.02acSMTPIN_ADDED_BROKEN@mx.google.com> Date: Tue, 20 Aug 2013 21:28:29 -0700 X-Google-Sender-Auth: RuH0NR0F3gWyAC6QwfbcgQBzefM Message-ID: Subject: Re: [PATCH v2 2/4] mm/sparse: introduce alloc_usemap_and_memmap From: Yinghai Lu To: Wanpeng Li Cc: Dave Hansen , Rik van Riel , Fengguang Wu , Joonsoo Kim , Johannes Weiner , Tejun Heo , Yasuaki Ishimatsu , David Rientjes , KOSAKI Motohiro , Jiri Kosina , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1147 Lines: 28 On Tue, Aug 20, 2013 at 8:11 PM, Wanpeng Li wrote: > Hi Yinghai, > On Tue, Aug 20, 2013 at 05:02:17PM -0700, Yinghai Lu wrote: >>>> - /* ok, last chunk */ >>>> - sparse_early_usemaps_alloc_node(usemap_map, pnum_begin, NR_MEM_SECTIONS, >>>> - usemap_count, nodeid_begin); >>>> + alloc_usemap_and_memmap(usemap_map, true); >> >>alloc_usemap_and_memmap() is somehow confusing. >> >>Please check if you can pass function pointer instead of true/false. >> > > sparse_early_usemaps_alloc_node and sparse_early_mem_maps_alloc_node is > similar, however, one has a parameter unsigned long ** and the other has > struct page **. function pointer can't help, isn't it? ;-) you could have one generic function pointer like void *alloc_func(void *data); and in the every alloc function, have own struct data to pass in/out... Yinghai -- 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/