Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590Ab3H2Cmb (ORCPT ); Wed, 28 Aug 2013 22:42:31 -0400 Received: from mail-oa0-f53.google.com ([209.85.219.53]:35249 "EHLO mail-oa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772Ab3H2Cm3 (ORCPT ); Wed, 28 Aug 2013 22:42:29 -0400 MIME-Version: 1.0 In-Reply-To: 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> <52146c58.a3e2440a.0f5a.ffffed8dSMTPIN_ADDED_BROKEN@mx.google.com> <521600cc.22ab440a.2703.53f1SMTPIN_ADDED_BROKEN@mx.google.com> Date: Wed, 28 Aug 2013 19:42:29 -0700 X-Google-Sender-Auth: 62t52E6yLIdnkEf-0Rkxt2cDD7U 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: multipart/mixed; boundary=047d7bfea09a9d9f5a04e50d0e79 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7156 Lines: 112 --047d7bfea09a9d9f5a04e50d0e79 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 28, 2013 at 7:34 PM, Yinghai Lu wrote: > On Wed, Aug 28, 2013 at 7:18 PM, Yinghai Lu wrote: >> please change to function pointer to >> void (*alloc_func)(void *data, >> unsigned long pnum_begin, >> unsigned long pnum_end, >> unsigned long map_count, int nodeid) >> >> pnum_begin, pnum_end, map_coun, nodeid, should not be in the struct. > > looks like that is what is your first version did. > > I updated it a little bit. please check it. > removed more lines. Yinghai --047d7bfea09a9d9f5a04e50d0e79 Content-Type: application/octet-stream; name="0001-sparse_v3.patch" Content-Disposition: attachment; filename="0001-sparse_v3.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkxdae1d1 RnJvbSBhNzhlMTJhOWZmMzFmMmE3M2I4NzE0NWNlN2FkOTQzYTBmNzEyNzA4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogV2FucGVuZyBMaSA8bGl3YW5wQGxpbnV4LnZuZXQuaWJtLmNv bT4NCkRhdGU6IFdlZCwgMjEgQXVnIDIwMTMgMTU6MjM6MDggKzA4MDANClN1YmplY3Q6IFtQQVRD SF0gbW0vc3BhcnNlOiBpbnRyb2R1Y2UgYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAgZml4IA0KDQpQ YXNzIGZ1bmN0aW9uIHBvaW50ZXIgdG8gYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAoKSBpbnN0ZWFk IG9mIHRydWUvZmFsc2UuIA0KDQpTaWduZWQtb2ZmLWJ5OiBXYW5wZW5nIExpIDxsaXdhbnBAbGlu dXgudm5ldC5pYm0uY29tPg0KLS0tDQogbW0vc3BhcnNlLmMgfCAgIDU0ICsrKysrKysrKysrKysr KysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KIDEgZmlsZXMgY2hhbmdl ZCwgMjUgaW5zZXJ0aW9ucygrKSwgMjkgZGVsZXRpb25zKC0pDQoNCmRpZmYgLS1naXQgYS9tbS9z cGFyc2UuYyBiL21tL3NwYXJzZS5jDQppbmRleCA1NWU1NzUyLi4wNmFkZjNjIDEwMDY0NA0KLS0t IGEvbW0vc3BhcnNlLmMNCisrKyBiL21tL3NwYXJzZS5jDQpAQCAtMzM5LDE0ICszMzksMTUgQEAg c3RhdGljIHZ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wXG4iKTsNCi0JYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAodXNlbWFwX21hcCwg dHJ1ZSk7DQorCWFsbG9jX3VzZW1hcF9hbmRfbWVtbWFwKHNwYXJzZV9lYXJseV91c2VtYXBzX2Fs bG9jX25vZGUsDQorCQkJCQkJKHZvaWQgKil1c2VtYXBfbWFwKTsNCiANCiAjaWZkZWYgQ09ORklH X1NQQVJTRU1FTV9BTExPQ19NRU1fTUFQX1RPR0VUSEVSDQogCXNpemUyID0gc2l6ZW9mKHN0cnVj dCBwYWdlICopICogTlJfTUVNX1NFQ1RJT05TOw0KIAltYXBfbWFwID0gYWxsb2NfYm9vdG1lbShz aXplMik7DQogCWlmICghbWFwX21hcCkNCiAJCXBhbmljKCJjYW4gbm90IGFsbG9jYXRlIG1hcF9t YXBcbiIpOw0KLQlhbGxvY191c2VtYXBfYW5kX21lbW1hcCgodW5zaWduZWQgbG9uZyAqKiltYXBf bWFwLCBmYWxzZSk7DQorCWFsbG9jX3VzZW1hcF9hbmRfbWVtbWFwKHNwYXJzZV9lYXJseV9tZW1f bWFwc19hbGxvY19ub2RlLA0KKwkJCQkJCSh2b2lkICopbWFwX21hcCk7DQogI2VuZGlmDQogDQog CWZvciAocG51bSA9IDA7IHBudW0gPCBOUl9NRU1fU0VDVElPTlM7IHBudW0rKykgew0KLS0gDQox LjcuNy42DQoNCg== --047d7bfea09a9d9f5a04e50d0e79-- -- 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/