From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932369AbdJZLP6 (ORCPT ); Thu, 26 Oct 2017 07:15:58 -0400 Received: from smtprelay0239.hostedemail.com ([216.40.44.239]:38523 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932197AbdJZLP5 (ORCPT ); Thu, 26 Oct 2017 07:15:57 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3873:4362:5007:6248:6261:7576:7875:7903:8603:10004:10400:10848:10967:11026:11232:11289:11473:11658:11914:12050:12296:12663:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:14777:21080:21212:21324:21433:21451:21619:30022:30054:30064:30083:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: wool38_50eca220f6b04 X-Filterd-Recvd-Size: 1682 Date: Thu, 26 Oct 2017 07:15:51 -0400 From: Steven Rostedt To: changbin.du@intel.com Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tracing: Allocate mask_str buffer dynamically Message-ID: <20171026071551.07b1228a@vmware.local.home> In-Reply-To: <1508948428-4969-1-git-send-email-changbin.du@intel.com> References: <1508948428-4969-1-git-send-email-changbin.du@intel.com> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Oct 2017 00:20:28 +0800 changbin.du@intel.com wrote: > From: Changbin Du > > The default NR_CPUS can be very large, but actual possible nr_cpu_ids > usually is very small. For my x86 distribution, the NR_CPUS is 8192 and > nr_cpu_ids is 4. About 2 pages are wasted. > > Most machines don't have so many CPUs, so define a array with NR_CPUS > just wastes memory. So let's allocate the buffer dynamically when need. > > The exact buffer size should be: > DIV_ROUND_UP(nr_cpu_ids, 4) + nr_cpu_ids/32 + 2; > > Example output: > ff,ffffffff > > Signed-off-by: Changbin Du > Thanks for sending this. I'm currently traveling for conferences, and may miss looking at this when I get back. Please send me a friendly ping reply to this email next week, if you don't hear from me sooner. -- Steve