From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261621AbUKCPHW (ORCPT ); Wed, 3 Nov 2004 10:07:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261623AbUKCPHW (ORCPT ); Wed, 3 Nov 2004 10:07:22 -0500 Received: from mx1.redhat.com ([66.187.233.31]:58582 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S261621AbUKCPHM (ORCPT ); Wed, 3 Nov 2004 10:07:12 -0500 From: David Howells In-Reply-To: <20041102094336.GC5841@infradead.org> References: <20041102094336.GC5841@infradead.org> <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com> <200411011930.iA1JULvA023219@warthog.cambridge.redhat.com> To: Christoph Hellwig Cc: torvalds@osdl.org, akpm@osdl.org, davidm@snapgear.com, linux-kernel@vger.kernel.org, uclinux-dev@uclinux.org Subject: Re: [PATCH 9/14] FRV: CONFIG_MMU fixes User-Agent: EMH/1.14.1 SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Date: Wed, 03 Nov 2004 15:06:44 +0000 Message-ID: <19027.1099494404@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > +++ linux-2.6.10-rc1-bk10-frv/fs/proc/kcore.c 2004-11-01 11:47:04.872656796 +0000 > > @@ -344,6 +344,7 @@ > > if (m == NULL) { > > if (clear_user(buffer, tsz)) > > return -EFAULT; > > +#ifdef CONFIG_MMU > } else if ((start >= VMALLOC_START) && (start < VMALLOC_END)) { > ... > > +#endif > > move this into a helper function that can be compiled away for the !MMU case That won't work. The else-if clause has to be within the context of the parent function in which it now resides. It might actually be better to make /proc/kcore conditional on CONFIG_MMU. > > +#ifdef CONFIG_MMU > > static struct vmalloc_info get_vmalloc_info(void) > ... > > +#endif > > move the whole function to a CONFIG_MMU-only file No. The compiler can, if it wishes, inline this function as it is now. Putting it in a separate file removes that option. > add a small helper for this. In fact it's the only caller of > get_vmalloc_info, so that could be merged into the helper, ala: No. The compiler, if it inlines get_vmalloc_info() can avoid allocating a whole struct vmalloc_info if it wishes in the current scheme of things, and can generate better code by inserting the constants when it needs them. > and define both VMALLOC_START and VMALLOC_END to 0 for !MMU Most definitely not! What these are is a per-arch decision, and m68knommu at least has things set up differently. FRV doesn't even define these for !MMU. > you're missing an endif. Good point. That ended up in the nommu patch, where this CONFIG_MMU should've been. > I's day just move this out of line into a MMU-only file. > ... > or at least keep a single MMU ifdef block per file I think, perhaps, some of linux/mm.h should perhaps be split out into separate MMU and !MMU header files, which then get included as appropriate by linux/mm.h. > provide stubs please. pgtable_cache_init is a per-arch things anyway. *sigh*. I'm trying to keep the time things take to boot and the amount of space the kernel image occupies down, and you're trying to push both back up. All these empty stubs consume time and space. > just move the whole systctl registration into a MMU-only file How's that going to help? A few of the VM options may still apply to !MMU. David