From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751386AbXBMWyT (ORCPT ); Tue, 13 Feb 2007 17:54:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751417AbXBMWyT (ORCPT ); Tue, 13 Feb 2007 17:54:19 -0500 Received: from rgminet01.oracle.com ([148.87.113.118]:61888 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbXBMWyS (ORCPT ); Tue, 13 Feb 2007 17:54:18 -0500 Date: Tue, 13 Feb 2007 14:49:09 -0800 From: Randy Dunlap To: Hugh Dickins Cc: Nick Piggin , tony.luck@gmail.com, Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] build error: allnoconfig fails on mincore/swapper_space Message-Id: <20070213144909.70943de2.randy.dunlap@oracle.com> In-Reply-To: References: <20070212145040.c3aea56e.randy.dunlap@oracle.com> <20070212150802.f240e94f.akpm@linux-foundation.org> <45D12715.4070408@yahoo.com.au> <20070213121217.0f4e9f3a.randy.dunlap@oracle.com> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.3.0 (GTK+ 2.8.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > > > oops. CONFIG_SWAP=n, I assume? > > Sorry for being so slow to respond on this. Yes, I'm inclined to > your ifdeffery fix - one can go cleverer, but I'd say it's the > appropriate fix now. > > But, please change your "present = 0;" to "present = 1;" - > if CONFIG_SWAP isn't on, it has to be a migration entry, > which always counts as present. > > > > > BUT: what is used for in that loop? or is it used? > > Well spotted! Something has gone missing: there needs to be a > vec[i] = present; > at the bottom of that loop. From: Randy Dunlap Don't check for pte swap entries when CONFIG_SWAP=n. And save 'present' in the vec array. mm/built-in.o: In function `sys_mincore': (.text+0xe584): undefined reference to `swapper_space' Signed-off-by: Randy Dunlap --- mm/mincore.c | 5 +++++ 1 file changed, 5 insertions(+) --- linux-2.6.20-git9.orig/mm/mincore.c +++ linux-2.6.20-git9/mm/mincore.c @@ -111,6 +111,7 @@ static long do_mincore(unsigned long add present = mincore_page(vma->vm_file->f_mapping, pgoff); } else { /* pte is a swap entry */ +#ifdef CONFIG_SWAP swp_entry_t entry = pte_to_swp_entry(pte); if (is_migration_entry(entry)) { /* migration entries are always uptodate */ @@ -119,7 +120,11 @@ static long do_mincore(unsigned long add pgoff = entry.val; present = mincore_page(&swapper_space, pgoff); } +#else + present = 1; +#endif } + vec[i] = present; } pte_unmap_unlock(ptep-1, ptl);