Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbcCWXyk (ORCPT ); Wed, 23 Mar 2016 19:54:40 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35688 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbcCWXyi (ORCPT ); Wed, 23 Mar 2016 19:54:38 -0400 From: Rasmus Villemoes To: Rusty Russell Cc: Oleg Nesterov , Prarit Bhargava , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH resend] init/main.c: Simplify initcall_blacklisted() Organization: D03 References: <54BEA0EE.10304@redhat.com> <1458602066-15255-1-git-send-email-linux@rasmusvillemoes.dk> <87twjzkx9b.fsf@rustcorp.com.au> X-Hashcash: 1:20:160323:akpm@linux-foundation.org::Q+1OPXQdoGKeuqzd:0000000000000000000000000000000000000AQ0 X-Hashcash: 1:20:160323:oleg@redhat.com::qWMrJIJYmhwcDejv:000cGB X-Hashcash: 1:20:160323:rusty@rustcorp.com.au::vuo+QPvAkPCg9srQ:00000000000000000000000000000000000000000fMO X-Hashcash: 1:20:160323:linux-kernel@vger.kernel.org::p/n1+rjmPS5nLdjs:00000000000000000000000000000000022cz X-Hashcash: 1:20:160323:prarit@redhat.com::ni2tNpuJooTiI8+V:000000000000000000000000000000000000000000007p8o Date: Thu, 24 Mar 2016 00:54:35 +0100 In-Reply-To: <87twjzkx9b.fsf@rustcorp.com.au> (Rusty Russell's message of "Tue, 22 Mar 2016 13:57:28 +1030") Message-ID: <878u187nt0.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 854 Lines: 20 On Tue, Mar 22 2016, Rusty Russell wrote: > Rasmus Villemoes writes: >> Using kasprintf to get the function name makes us look up the name >> twice, along with all the vsnprintf overhead of parsing the format >> string etc. It also means there is an allocation failure case to deal >> with. Since symbol_string in vsprintf.c would anyway allocate an array >> of size KSYM_SYMBOL_LEN on the stack, that might as well be done up >> here. >> >> Moreover, since this is a debug feature and the blacklisted_initcalls >> list is usually empty, we might as well test that and thus avoid >> looking up the symbol name even once in the common case. >> >> Signed-off-by: Rasmus Villemoes > > Acked-by: Rusty Russell > Thanks. Andrew, can I get you to take it?