From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by kanga.kvack.org (Postfix) with ESMTP id 7F9566B0031 for ; Fri, 20 Dec 2013 17:30:27 -0500 (EST) Received: by mail-gg0-f178.google.com with SMTP id n5so695521ggj.9 for ; Fri, 20 Dec 2013 14:30:27 -0800 (PST) Received: from comal.ext.ti.com (comal.ext.ti.com. [198.47.26.152]) by mx.google.com with ESMTPS id v3si8065100yhd.138.2013.12.20.14.30.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 14:30:26 -0800 (PST) Message-ID: <52B4C4FF.1020009@ti.com> Date: Fri, 20 Dec 2013 17:30:23 -0500 From: Santosh Shilimkar MIME-Version: 1.0 Subject: Re: [PATCH v3 08/23] mm/memblock: Add memblock memory allocation apis References: <1386625856-12942-1-git-send-email-santosh.shilimkar@ti.com> <1386625856-12942-9-git-send-email-santosh.shilimkar@ti.com> <20131213213735.GM27070@htj.dyndns.org> <52ABABDA.4020808@ti.com> <20131214110844.GB17954@htj.dyndns.org> <52ACB608.3050802@ti.com> In-Reply-To: <52ACB608.3050802@ti.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Tejun Heo Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-arm-kernel@lists.infradead.org" , Yinghai Lu , Andrew Morton , "Strashko, Grygorii" On Saturday 14 December 2013 02:48 PM, Santosh Shilimkar wrote: > On Saturday 14 December 2013 06:08 AM, Tejun Heo wrote: >> Hello, Santosh. >> >> On Fri, Dec 13, 2013 at 07:52:42PM -0500, Santosh Shilimkar wrote: >>>>> +static void * __init memblock_virt_alloc_internal( >>>>> + phys_addr_t size, phys_addr_t align, >>>>> + phys_addr_t min_addr, phys_addr_t max_addr, >>>>> + int nid) >>>>> +{ >>>>> + phys_addr_t alloc; >>>>> + void *ptr; >>>>> + >>>>> + if (nid == MAX_NUMNODES) >>>>> + pr_warn("%s: usage of MAX_NUMNODES is depricated. Use NUMA_NO_NODE\n", >>>>> + __func__); >>>> >>>> Why not use WARN_ONCE()? Also, shouldn't nid be set to NUMA_NO_NODE >>>> here? >>>> >>> You want all the users using MAX_NUMNODES to know about it so that >>> the wrong usage can be fixed. WARN_ONCE will hide that. >> >> Well, it doesn't really help anyone to be printing multiple messages >> without any info on who was the caller and if this thing is gonna be >> in mainline triggering of the warning should be rare anyway. It's >> more of a tool to gather one-off cases in the wild. WARN_ONCE() >> usually is the better choice as otherwise the warnings can swamp the >> machine and console output in certain cases. >> > Fair enough. > >>>> ... >>>>> + if (nid != NUMA_NO_NODE) { >>>> >>>> Otherwise, the above test is broken. >>>> >>> So the idea was just to warn the users and allow them to fix >>> the code. Well we are just allowing the existing users of using >>> either MAX_NUMNODES or NUMA_NO_NODE continue to work. Thats what >>> we discussed, right ? >> >> Huh? Yeah, sure. You're testing @nid against MAX_NUMNODES at the >> beginning of the function. If it's MAX_NUMNODES, you print a warning >> but nothing else, so the if() conditional above, which should succeed, >> would fail. Am I missing sth here? >> > I get it now. Sorry I missed your point in first part. We will fix this. > Posted an incremental fix based on above discussion. You have been copied on the patch. Regards, Santosh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org