lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 03 Feb 2015 10:57:23 +0100
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Vishnu Pratap Singh <vishnu.ps@...sung.com>,
	Pintu Kumar <pintu.k@...sung.com>,
	Michal Nazarewicz <mina86@...a86.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] mm/page_alloc.c: Pull out init code from build_all_zonelists

On Tue, Feb 03 2015, David Rientjes <rientjes@...gle.com> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ