Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbdC1JBY (ORCPT ); Tue, 28 Mar 2017 05:01:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:39926 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755095AbdC1JBV (ORCPT ); Tue, 28 Mar 2017 05:01:21 -0400 Date: Tue, 28 Mar 2017 11:00:49 +0200 (CEST) From: Miroslav Benes To: Zhou Chengming cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, jeyu@redhat.com, jikos@kernel.org, pmladek@suse.com, huawei.libin@huawei.com Subject: Re: [PATCH] reduce the time of finding symbols for module In-Reply-To: <1490666535-19192-1-git-send-email-zhouchengming1@huawei.com> Message-ID: References: <1490666535-19192-1-git-send-email-zhouchengming1@huawei.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 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: 673 Lines: 23 Hi, On Tue, 28 Mar 2017, Zhou Chengming wrote: > It's reported that the time of insmoding a klp.ko for one of our > out-tree modules is too long. > > ~ time sudo insmod klp.ko > real 0m23.799s > user 0m0.036s > sys 0m21.256s Is this stable through several (>=10) runs? 23 seconds are really suspicious. Yes, there is a linear search through all the kallsyms in kallsyms_on_each_symbol(), but there are something like 70k symbols on my machine (that is, way less than 1M). 23 seconds are somewhat unexpected. If it is a problem, can we fix kallsyms_on_each_symbol() and replace the linear search with something better? All users would benefit... Thanks, Miroslav