From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755347AbbBCJ5a (ORCPT ); Tue, 3 Feb 2015 04:57:30 -0500 Received: from mail-la0-f42.google.com ([209.85.215.42]:57155 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751365AbbBCJ50 (ORCPT ); Tue, 3 Feb 2015 04:57:26 -0500 From: Rasmus Villemoes To: David Rientjes Cc: Andrew Morton , Vishnu Pratap Singh , Pintu Kumar , Michal Nazarewicz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] mm/page_alloc.c: Pull out init code from build_all_zonelists Organization: D03 References: <1422921016-27618-1-git-send-email-linux@rasmusvillemoes.dk> <1422921016-27618-3-git-send-email-linux@rasmusvillemoes.dk> X-Hashcash: 1:20:150203:linux-kernel@vger.kernel.org::UPwttk3C6x2h/STU:0000000000000000000000000000000002mjK X-Hashcash: 1:20:150203:linux-mm@kvack.org::74Odi8shWln2ZGiQ:00000000000000000000000000000000000000000007StU X-Hashcash: 1:20:150203:pintu.k@samsung.com::gUV4Zb/qbu+Cbswo:0000000000000000000000000000000000000000001q+T X-Hashcash: 1:20:150203:vishnu.ps@samsung.com::uv1qi93SsSKKmc6k:00000000000000000000000000000000000000002Pud X-Hashcash: 1:20:150203:akpm@linux-foundation.org::fHZTpzAHD33IbzZ7:0000000000000000000000000000000000005Jos X-Hashcash: 1:20:150203:rientjes@google.com::FbuhPITykOonAGLW:0000000000000000000000000000000000000000007OXc X-Hashcash: 1:20:150203:mina86@mina86.com::terIjXVrf+fBv/6P:00000000000000000000000000000000000000000000BWbG Date: Tue, 03 Feb 2015 10:57:23 +0100 In-Reply-To: (David Rientjes's message of "Mon, 2 Feb 2015 16:25:25 -0800 (PST)") Message-ID: <871tm7jp18.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 03 2015, David Rientjes wrote: > On Tue, 3 Feb 2015, Rasmus Villemoes wrote: > >> Pulling the code protected by if (system_state == SYSTEM_BOOTING) into >> its own helper allows us to shrink .text a little. This relies on >> build_all_zonelists already having a __ref annotation. Add a comment >> explaining why so one doesn't have to track it down through git log. >> > > I think we should see the .text savings in the changelog to decide whether > we want a __ref function (granted, with comment) calling an __init > function in the source code. Well, the real saving comes in 3/5, (mm/mm_init.c: Mark mminit_verify_zonelist as __init), where one saves about 400 bytes. I originally did just that, while still adding a comment to build_all_zonelists to explain both the old and new cause of __ref. Then I noticed that cpuset_init_current_mems_allowed is also only called from build_all_zonelists and could thus also be __init. But then the __ref would cover two __init functions, both defined elsewhere, so I thought it would be a little cleaner to make these calls from a single __init function defined very close to its user. That it also happens to shave a few bytes from build_all_zonelists is just gravy. A better commit log would have been something like Pulling the code protected by if (system_state == SYSTEM_BOOTING) into its own helper allows us to shrink .text by a few bytes. But more importantly, this provides a (somewhat) clean way of annotating mminit_verify_zonelist and cpuset_init_current_mems_allowed with __init, thus saving around 450 bytes of .text. This relies on build_all_zonelists already having a __ref annotation. Add a comment explaining both uses so one doesn't have to track it down through git log. Rasmus