public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@fs.tum.de>
To: Andrew Morton <akpm@osdl.org>, Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] 2.6.8-rc2-mm2: compile error with SWAP=n
Date: Tue, 3 Aug 2004 00:16:13 +0200	[thread overview]
Message-ID: <20040802221612.GO2746@fs.tum.de> (raw)
In-Reply-To: <20040802015527.49088944.akpm@osdl.org>

On Mon, Aug 02, 2004 at 01:55:27AM -0700, Andrew Morton wrote:
>...
> - Added Rik's token-based load control patch.  The VM currently has pretty
>   bad performance problems under heavy swapping loads and this patch speeds up
>   simple tests most impressively.  People who care about these things: please
>   test and measure.
>...
> Changes since 2.6.8-rc2-mm1:
>...
> +token-based-thrashing-control.patch
>...
>  VM load control.
>...

This breaks compilation with CONFIG_SWAP=n:

<--  snip  -->

...
  CC      kernel/fork.o
kernel/fork.c: In function `mmput':
kernel/fork.c:471: warning: implicit declaration of function `put_swap_token'
...
  CC      mm/filemap.o
mm/filemap.c: In function `filemap_nopage':
mm/filemap.c:1250: warning: implicit declaration of function `grab_swap_token'
...
  CC      mm/memory.o
mm/memory.c: In function `do_swap_page':
mm/memory.c:1375: warning: implicit declaration of function `grab_swap_token'
...
  CC      mm/rmap.o
mm/rmap.c: In function `page_referenced_one':
mm/rmap.c:233: warning: implicit declaration of function `has_swap_token'
...
  LD      .tmp_vmlinux1
kernel/built-in.o(.text+0x1ccf): In function `mmput':
: undefined reference to `put_swap_token'
mm/built-in.o(.text+0x1542): In function `filemap_nopage':
: undefined reference to `grab_swap_token'
mm/built-in.o(.text+0x131c9): In function `page_referenced_one':
: undefined reference to `has_swap_token'
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->


The bug is obvious:


#ifdef CONFIG_SWAP
...
#ifdef CONFIG_SWAP
...
#else
...
#endif
...
#else
...
#endif


Additional, the dummy grab_swap_token and has_swap_token weren't 
correct.


diffstat output:
 include/linux/swap.h |   43 +++++++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 22 deletions(-)


Signed-off-by: Adrian Bunk <bunk@fs.tum.de>

--- linux-2.6.8-rc2-mm2-full/include/linux/swap.h.old	2004-08-02 23:16:52.000000000 +0200
+++ linux-2.6.8-rc2-mm2-full/include/linux/swap.h	2004-08-02 23:21:32.000000000 +0200
@@ -204,28 +204,6 @@
 extern struct page * lookup_swap_cache(swp_entry_t);
 extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma,
 					   unsigned long addr);
-/* linux/mm/thrash.c */
-#ifdef CONFIG_SWAP
-extern struct mm_struct * swap_token_mm;
-extern void grab_swap_token(void);
-extern void __put_swap_token(struct mm_struct *);
-
-static inline int has_swap_token(struct mm_struct *mm)
-{
-	return (mm == swap_token_mm);
-}
-
-static inline void put_swap_token(struct mm_struct *mm)
-{
-	if (has_swap_token(mm))
-		__put_swap_token(mm);
-}
-#else /* CONFIG_SWAP */
-#define put_swap_token(x) do { } while(0)
-#define grab_swap_token  do { } while(0)
-#define has_swap_token 0
-#endif /* CONFIG_SWAP */
-
 /* linux/mm/swapfile.c */
 extern long total_swap_pages;
 extern unsigned int nr_swapfiles;
@@ -250,6 +228,22 @@
 #define swap_device_lock(p)	spin_lock(&p->sdev_lock)
 #define swap_device_unlock(p)	spin_unlock(&p->sdev_lock)
 
+/* linux/mm/thrash.c */
+extern struct mm_struct * swap_token_mm;
+extern void grab_swap_token(void);
+extern void __put_swap_token(struct mm_struct *);
+
+static inline int has_swap_token(struct mm_struct *mm)
+{
+	return (mm == swap_token_mm);
+}
+
+static inline void put_swap_token(struct mm_struct *mm)
+{
+	if (has_swap_token(mm))
+		__put_swap_token(mm);
+}
+
 #else /* CONFIG_SWAP */
 
 #define total_swap_pages			0
@@ -287,6 +281,11 @@
 	return entry;
 }
 
+/* linux/mm/thrash.c */
+#define put_swap_token(x) do { } while(0)
+#define grab_swap_token()  do { } while(0)
+#define has_swap_token(x) 0
+
 #endif /* CONFIG_SWAP */
 #endif /* __KERNEL__*/
 #endif /* _LINUX_SWAP_H */


  parent reply	other threads:[~2004-08-02 22:16 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-02  8:55 2.6.8-rc2-mm2 Andrew Morton
2004-08-02  9:23 ` 2.6.8-rc2-mm2 Espen Fjellvær Olsen
2004-08-02 12:10 ` 2.6.8-rc2-mm2 Rik van Riel
2004-08-05 10:56   ` 2.6.8-rc2-mm2 Hideo AOKI
2004-08-05 12:55     ` 2.6.8-rc2-mm2 Hideo AOKI
2004-08-02 13:07 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03  6:43   ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-03  7:35     ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03  7:43       ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-03  7:45       ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04  8:35         ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:12           ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04 10:33             ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 11:42               ` 2.6.8-rc2-mm2 bert hubert
2004-08-05  1:21                 ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:31           ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-04 10:46             ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:47             ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04 12:45               ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-05  2:53                 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-05  8:34                   ` 2.6.8-rc2-mm2 Helge Hafting
2004-08-05  9:34                     ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-05 10:47                   ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-02 13:52 ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 16:12   ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 14:28 ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 15:31 ` 2.6.8-rc2-mm2 Mark Watts
2004-08-02 15:33   ` 2.6.8-rc2-mm2 Jesper Juhl
2004-08-02 15:38   ` 2.6.8-rc2-mm2 Dominik Karall
2004-08-02 16:02     ` 2.6.8-rc2-mm2 Mark Watts
2004-08-03  6:55   ` 2.6.8-rc2-mm2 Clemens Schwaighofer
2004-08-02 15:57 ` 2.6.8-rc2-mm2 Martin Zwickel
2004-08-02 17:59 ` 2.6.8-rc2-mm2 (compile stats) John Cherry
2004-08-02 18:15 ` 2.6.8-rc2-mm2 Peter Osterlund
2004-08-02 22:16 ` Adrian Bunk [this message]
2004-08-03  8:27 ` 2.6.8-rc2-mm2 Mark Watts
2004-08-03 13:05   ` 2.6.8-rc2-mm2 R. J. Wysocki
2004-08-03 13:13 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03 19:44 ` 2.6.8-rc2-mm2 Adrian Bunk
2004-08-04 16:32 ` 2.6.8-rc2-mm2 Dominik Karall
2004-08-05  4:38 ` [sparc32] [1/13] turbosparc flush warnings William Lee Irwin III
2004-08-05  4:39   ` [sparc32] [2/13] sparc32 init_idle() William Lee Irwin III
2004-08-05  4:41     ` [sparc32] [3/13] sun4d cpu_present_map is a cpumask_t William Lee Irwin III
2004-08-05  4:44       ` [sparc32] [4/13] smp_processor_id() BITFIXUP fixes William Lee Irwin III
2004-08-05  4:46         ` [sparc32] [5/13] reinstate smp_reschedule_irq() William Lee Irwin III
2004-08-05  4:47           ` [sparc32] [6/13] remove references to start_secondary() William Lee Irwin III
2004-08-05  4:48             ` [sparc32] [7/13] remove references to num_context_patch2 William Lee Irwin III
2004-08-05  4:49               ` [sparc32] [8/13] define cache_decay_ticks William Lee Irwin III
2004-08-05  4:54                 ` [sparc32] [9/13] remove unused variable in dvma.c William Lee Irwin III
2004-08-05  4:55                   ` [sparc32] [10/13] sun4 does not support SMP William Lee Irwin III
2004-08-05  4:56                     ` [sparc32] [11/13] make CONFIG_SMP depend on CONFIG_BROKEN William Lee Irwin III
2004-08-05  5:01                       ` [sparc32] [12/13] gcc-3.3 macro parenthesization fix for memcpy.S William Lee Irwin III
2004-08-05  5:31                         ` [sparc32] [13/13] ignore undefined symbols with 3 or more leading underscores William Lee Irwin III
2004-08-05  7:28                         ` [sparc32] [12/13] gcc-3.3 macro parenthesization fix for memcpy.S Jakub Jelinek
2004-08-05  7:38                           ` William Lee Irwin III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040802221612.GO2746@fs.tum.de \
    --to=bunk@fs.tum.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox