From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333AbYKKWQU (ORCPT ); Tue, 11 Nov 2008 17:16:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751486AbYKKWQF (ORCPT ); Tue, 11 Nov 2008 17:16:05 -0500 Received: from gw1.cosmosbay.com ([86.65.150.130]:39739 "EHLO gw1.cosmosbay.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbYKKWQD convert rfc822-to-8bit (ORCPT ); Tue, 11 Nov 2008 17:16:03 -0500 Message-ID: <491A0416.1040809@cosmosbay.com> Date: Tue, 11 Nov 2008 23:15:50 +0100 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Takashi Iwai CC: Rusty Russell , Andreas Gruenbacher , Jan Blunck , Andrew Morton , linux-kernel@vger.kernel.org, Mike Travis Subject: Re: [PATCH] Allocate module.ref array dynamically References: <491A01E2.2010701@cosmosbay.com> In-Reply-To: <491A01E2.2010701@cosmosbay.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [0.0.0.0]); Tue, 11 Nov 2008 23:15:52 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Dumazet a écrit : > Takashi Iwai a écrit : >> Hi, >> >> we found that the kernel module sizes and memory footprints >> grow drastically when NR_CPUS is high. For example, with >> NR_CPUS=4096, SUSE kernel packages weigh over 500MB (even w/o debug >> info). >> >> A part of the reason is the fixed size array in struct module. >> The patch below fixes the problem by allocating it dynamically. >> With the patch, the size can go down to 20MB. >> >> >> Any comments/suggestions appreciated. >> > > Many attempts were done on this area on the past. Forgot to include a link to previous attempt : http://lkml.org/lkml/2008/5/15/402 > > Your patch has the drawback of using kcalloc(), while previously, > module_ref > space was allocated with vmalloc(). > > After a while, a machine could have a lot of vmalloc() space available, > but not enough > physically contiguous space to fullfill a kmalloc(large_area) call. > > So a module load could fail, while previous code could load module. > > I believe Mike Travis has a better patch for this problem, partly using > new percpu allocator. >