From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399AbbEIJRn (ORCPT ); Sat, 9 May 2015 05:17:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:42474 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbbEIJRj (ORCPT ); Sat, 9 May 2015 05:17:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,395,1427785200"; d="scan'208";a="692312951" Date: Sat, 9 May 2015 02:17:39 -0700 From: Andi Kleen To: Rasmus Villemoes Cc: Ingo Molnar , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [RFC] init.h: mark init functions hot instead of cold Message-ID: <20150509091739.GX13605@tassilo.jf.intel.com> References: <1431125101-16273-1-git-send-email-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431125101-16273-1-git-send-email-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 09, 2015 at 12:45:01AM +0200, Rasmus Villemoes wrote: > attribute((cold)) causes gcc to optimize the function for size rather > than speed. But since __init functions will be discarded anyway, I > don't see why memory should be a concern. On the contrary, everybody It makes the bzImage smaller. A lot of people on smaller systems are interested in flash size. > wants their box to boot faster. Using the opposite attribute, hot, > causes gcc to optimize the functions more aggressively, possibly at > the expense of larger (.init).text. A completely unscientific test > showed about 2% faster boot time: I booted a kernel in qemu with and > without this patch five times each; the boot times were very stable in > each case, so I think the 2% is ok, but of course only applies to that > specific .config running in a virtual machine on my hardware. 2% on boot is basically noise. -Andi