Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbbD3Sq2 (ORCPT ); Thu, 30 Apr 2015 14:46:28 -0400 Received: from resqmta-ch2-08v.sys.comcast.net ([69.252.207.40]:50475 "EHLO resqmta-ch2-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbbD3Sq0 (ORCPT ); Thu, 30 Apr 2015 14:46:26 -0400 Date: Thu, 30 Apr 2015 13:46:22 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: "Luis R. Rodriguez" cc: Borislav Petkov , Kyle McMartin , Alok N Kataria , Shobhit Dayal , Shai Fultheim , Andrew Morton , "Luis R. Rodriguez" , mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, daniel.vetter@intel.com, airlied@linux.ie, dledford@redhat.com, awalls@md.metrocast.net, syrjala@sci.fi, luto@amacapital.net, mst@redhat.com, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, Juergen Gross , Daniel Vetter , Dave Airlie , Bjorn Helgaas , x86@kernel.org Subject: Re: [PATCH v4 2/8] init.h: add __read_mostly to early_param_on_off() In-Reply-To: <20150430183200.GW5622@wotan.suse.de> Message-ID: References: <1430343867-1001-1-git-send-email-mcgrof@do-not-panic.com> <1430343867-1001-3-git-send-email-mcgrof@do-not-panic.com> <20150430160044.GF5117@pd.tnic> <20150430183200.GW5622@wotan.suse.de> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1055 Lines: 22 On Thu, 30 Apr 2015, Luis R. Rodriguez wrote: > > But for every param declared this way? I'm not sure we want that... > > I'm glad you bring this up, Christoph can you or anyone else can you provide > advise since you added __read_mostly ? Well it should be reseved for data that is actually used frequently in hot paths. Initially we only moved variables into __read_mostly after we saw in performance traces that there was contention on an item because a neighboring variable was frequently written to. You want the __read_mostly data to be tighly packed. In the best case multiple frequently read variables for a hot path will be next to each other in order to reduce the number of cachelines needed to execute a critical path. That means being selective and aware of which variables actually benefit. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/