LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* CONFIG_SWAP=n broken in latest tree
@ 2007-02-14 22:41 Roland Dreier
  2007-02-14 22:49 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2007-02-14 22:41 UTC (permalink / raw)
  To: Nick Piggin
  Cc: linux-kernel,
	Hugh Dickins <hugh@veritas.com> Andrew Morton,
	Torvalds@linux-foundation.org Torvalds

Commit 42da9cbd ("mm: mincore anon") breaks CONFIG_SWAP=n builds with:

    mm/built-in.o: In function `sys_mincore':
    (.text+0xe2c4): undefined reference to `swapper_space'

because swapper_space is used unconditionally in mm/mincore.c but only
defined in swap_state.c, which isn't built if CONFIG_SWAP=n.

I'd include a patch but I'm not sure what the right fix is really --
the naively obvious thing to do would be to add an #ifdef to mincore.c
like the below, but I don't know this area at all well enough to be
confident in the fix.

diff --git a/mm/mincore.c b/mm/mincore.c
index 95c5f49..266506f 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -109,8 +109,9 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
 		} else if (pte_file(pte)) {
 			pgoff = pte_to_pgoff(pte);
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
-
-		} else { /* pte is a swap entry */
+		}
+#ifdef CONFIG_SWAP
+		else { /* pte is a swap entry */
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */
@@ -120,6 +121,7 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
 				present = mincore_page(&swapper_space, pgoff);
 			}
 		}
+#endif /* CONFIG_SWAP */
 	}
 	pte_unmap_unlock(ptep-1, ptl);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CONFIG_SWAP=n broken in latest tree
  2007-02-14 22:41 CONFIG_SWAP=n broken in latest tree Roland Dreier
@ 2007-02-14 22:49 ` Randy Dunlap
  2007-02-14 22:57   ` Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2007-02-14 22:49 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Nick Piggin, linux-kernel,
	Hugh Dickins <hugh@veritas.com> Andrew Morton,
	Torvalds@linux-foundation.org Torvalds

On Wed, 14 Feb 2007 14:41:05 -0800 Roland Dreier wrote:

> Commit 42da9cbd ("mm: mincore anon") breaks CONFIG_SWAP=n builds with:
> 
>     mm/built-in.o: In function `sys_mincore':
>     (.text+0xe2c4): undefined reference to `swapper_space'
> 
> because swapper_space is used unconditionally in mm/mincore.c but only
> defined in swap_state.c, which isn't built if CONFIG_SWAP=n.
> 
> I'd include a patch but I'm not sure what the right fix is really --
> the naively obvious thing to do would be to add an #ifdef to mincore.c
> like the below, but I don't know this area at all well enough to be
> confident in the fix.
> 
> diff --git a/mm/mincore.c b/mm/mincore.c
> index 95c5f49..266506f 100644
> --- a/mm/mincore.c
> +++ b/mm/mincore.c
> @@ -109,8 +109,9 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
>  		} else if (pte_file(pte)) {
>  			pgoff = pte_to_pgoff(pte);
>  			present = mincore_page(vma->vm_file->f_mapping, pgoff);
> -
> -		} else { /* pte is a swap entry */
> +		}
> +#ifdef CONFIG_SWAP
> +		else { /* pte is a swap entry */
>  			swp_entry_t entry = pte_to_swp_entry(pte);
>  			if (is_migration_entry(entry)) {
>  				/* migration entries are always uptodate */
> @@ -120,6 +121,7 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
>  				present = mincore_page(&swapper_space, pgoff);
>  			}
>  		}
> +#endif /* CONFIG_SWAP */
>  	}
>  	pte_unmap_unlock(ptep-1, ptl);
>  
> -

We've beat this almost to death... just need some patch merged.

or reverted.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CONFIG_SWAP=n broken in latest tree
  2007-02-14 22:49 ` Randy Dunlap
@ 2007-02-14 22:57   ` Roland Dreier
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2007-02-14 22:57 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Nick Piggin, linux-kernel,
	Hugh Dickins <hugh@veritas.com> Andrew Morton,
	Torvalds@linux-foundation.org Torvalds

 > We've beat this almost to death... just need some patch merged.

Sorry, missed the discussion I guess...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-14 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 22:41 CONFIG_SWAP=n broken in latest tree Roland Dreier
2007-02-14 22:49 ` Randy Dunlap
2007-02-14 22:57   ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).