From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx158.postini.com [74.125.245.158]) by kanga.kvack.org (Postfix) with SMTP id 077EA6B0181 for ; Mon, 12 Dec 2011 09:41:10 -0500 (EST) Received: by vcbfk26 with SMTP id fk26so5090511vcb.14 for ; Mon, 12 Dec 2011 06:41:10 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Subject: Re: [PATCH 04/11] mm: compaction: export some of the functions References: <1321634598-16859-1-git-send-email-m.szyprowski@samsung.com> <1321634598-16859-5-git-send-email-m.szyprowski@samsung.com> <20111212142906.GE3277@csn.ul.ie> Date: Mon, 12 Dec 2011 15:41:04 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Michal Nazarewicz" Message-ID: In-Reply-To: <20111212142906.GE3277@csn.ul.ie> Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski , Mel Gorman Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org, Kyungmin Park , Russell King , Andrew Morton , KAMEZAWA Hiroyuki , Ankita Garg , Daniel Walker , Arnd Bergmann , Jesse Barker , Jonathan Corbet , Shariq Hasnain , Chunsang Jeong , Dave Hansen On Mon, 12 Dec 2011 15:29:07 +0100, Mel Gorman wrote: > On Fri, Nov 18, 2011 at 05:43:11PM +0100, Marek Szyprowski wrote: >> From: Michal Nazarewicz >> >> This commit exports some of the functions from compaction.c file >> outside of it adding their declaration into internal.h header >> file so that other mm related code can use them. >> >> This forced compaction.c to always be compiled (as opposed to being >> compiled only if CONFIG_COMPACTION is defined) but as to avoid >> introducing code that user did not ask for, part of the compaction.c >> is now wrapped in on #ifdef. >> >> Signed-off-by: Michal Nazarewicz >> Signed-off-by: Marek Szyprowski >> --- >> mm/Makefile | 3 +- >> mm/compaction.c | 112 +++++++++++++++++++++++----------------------= ---------- >> mm/internal.h | 35 +++++++++++++++++ >> 3 files changed, 83 insertions(+), 67 deletions(-) >> >> diff --git a/mm/Makefile b/mm/Makefile >> index 50ec00e..24ed801 100644 >> --- a/mm/Makefile >> +++ b/mm/Makefile >> @@ -13,7 +13,7 @@ obj-y :=3D filemap.o mempool.o oom_kill.o fadvise= .o \ >> readahead.o swap.o truncate.o vmscan.o shmem.o \ >> prio_tree.o util.o mmzone.o vmstat.o backing-dev.o \ >> page_isolation.o mm_init.o mmu_context.o percpu.o \ >> - $(mmu-y) >> + $(mmu-y) compaction.o > > That should be > > compaction.o $(mmu-y) > > for consistency. > > Overall, this patch implies that CMA is always compiled in. Not really. But yes, it produces some bloat when neither CMA nor compaction are compiled. I assume that linker will be able to deal with that (since the functions are not EXPORT_SYMBOL'ed). Note also that the was majority of compaction.c is #ifdef'd though so only a handful of functions are compiled. > Why not just make CMA depend on COMPACTION to keep things simplier? I could imagine that someone would want to have CMA but not compaction, hence I decided to give that choice. > For example, if you enable CMA and do not enable COMPACTION, you > lose things like the vmstat counters that can aid debugging. In > fact, as parts of compaction.c are using defines like COMPACTBLOCKS, > I'm not even sure compaction.c can compile without CONFIG_COMPACTION > because of the vmstat stuff. -- = Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz= (o o) ooo +------------------ooO--(_)--Ooo-- -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org