Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755988AbbGPVdu (ORCPT ); Thu, 16 Jul 2015 17:33:50 -0400 Received: from mga11.intel.com ([192.55.52.93]:49177 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbbGPVdt (ORCPT ); Thu, 16 Jul 2015 17:33:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,490,1432623600"; d="scan'208";a="730353230" Message-ID: <1437082414.12633.52.camel@tzanussi-mobl.amr.corp.intel.com> Subject: Re: [PATCH v9 07/22] tracing: Add lock-free tracing_map From: Tom Zanussi To: Peter Zijlstra Cc: rostedt@goodmis.org, daniel.wagner@bmw-carit.de, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, josh@joshtriplett.org, andi@firstfloor.org, linux-kernel@vger.kernel.org Date: Thu, 16 Jul 2015 16:33:34 -0500 In-Reply-To: <20150716180348.GI12596@twins.programming.kicks-ass.net> References: <777bd36975a1dd904fd6b72c4048474dd2327a65.1437066836.git.tom.zanussi@linux.intel.com> <20150716180348.GI12596@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1031 Lines: 25 On Thu, 2015-07-16 at 20:03 +0200, Peter Zijlstra wrote: > On Thu, Jul 16, 2015 at 12:22:40PM -0500, Tom Zanussi wrote: > > + map->map = kcalloc(map->map_size, sizeof(struct tracing_map_entry), > > + GFP_KERNEL); > > In a later email you state the max map size to be 128k, with a 16 byte > struct, that is 2m of memory for this allocation. > > Isn't that a tad big for a kmalloc() ? Yeah, that is a bit big for kmalloc (actually it's double that), though I never ran into problems in my testing (of course that would depend on the state of the system, and I mainly tested on a newly booted system). It would probably make sense to make it page-based, which means a bit more complicated mapping for the array (can't use vmalloc here) but that shouldn't be too big a deal. Tom -- 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/