linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicson <nicson@unforgettable.com>
To: linux-kernel@vger.kernel.org
Subject: Problem to compile 2.4.14 on x86 (cause: mm/swap.c) : patch included in body
Date: Wed, 7 Nov 2001 13:35:27 +0000	[thread overview]
Message-ID: <0111071254290C.00326@padawah> (raw)

Hi all!

This is my first post on lkml, I tried to do it "by the book" (I read the 
"Unofficial Linus HOWTO" from Jeff Garzik) but may have missed something. My 
apologies if this is the case - and feel free to correct me, could be useful 
next time ;-)

[Disclaimer: I'm not a kernel hacker]

I wanted to compile 2.4.14 on a Dell PowerEdge 2500 with 2x PIII 1GHz, and 
encountered a small problem with the loopback dev. (either included or as a 
module) : the function deactivate_page() was not found.
The exact error message is:
----------------[ start 'make bzImage' output ]-----------------
[...]
drivers/block/block.o: In function `lo_send':
drivers/block/block.o(.text+0x87af): undefined reference to `deactivate_page'
drivers/block/block.o(.text+0x87f9): undefined reference to `deactivate_page'
make: *** [vmlinux] Error 1                                                   
----------------[ end 'make bzImage' output ]-----------------

I tried it also on another x86 box (PIII-UP), same problem.

I traced it back to mm/swap.c and include/linux/swap.h
On 2.4.13 the function deactivate_page() is present in mm/swap.c, but not in 
2.4.14

I just added it (and the relevant declaration in include/linux/swap.h), and 
tried compiling 2.4.14 with this modification ---> problem fixed on both 
systems.

I couldn't find exactly who's the maintainer for this section of the kernel 
(and didn't want to bother Linus with something that trivial), so I post this 
on lkml in hope the person-in-charge will see it. I do not read lkml (just 
Kernel-Traffic, thanx Zack Brown for the great job!) so maybe someone else 
already submitted a patch for this bug.

Anyway, here is the small patch (made with diff -urN). It's basically only 
cut&paste stuff :
------------------------------[ cut here ]-------------------------------
diff -urN linux/include/linux/swap.h linux-2.4.14-patched/include/linux/swap.h
--- linux/include/linux/swap.h  Mon Nov  5 21:42:13 2001
+++ linux-2.4.14-patched/include/linux/swap.h   Wed Nov  7 13:17:48 2001
@@ -105,6 +105,7 @@
 extern void FASTCALL(__lru_cache_del(struct page *));
 extern void FASTCALL(lru_cache_del(struct page *));
 
+extern void FASTCALL(deactivate_page(struct page *));
 extern void FASTCALL(activate_page(struct page *));
 
 extern void swap_setup(void);
diff -urN linux/mm/swap.c linux-2.4.14-patched/mm/swap.c
--- linux/mm/swap.c     Sun Nov  4 19:29:49 2001
+++ linux-2.4.14-patched/mm/swap.c      Wed Nov  7 13:17:26 2001
@@ -33,6 +33,32 @@
        8,      /* do swap I/O in clusters of this size */
 };
 
+/**
+ * (de)activate_page - move pages from/to active and inactive lists
+ * @page: the page we want to move
+ * @nolock - are we already holding the pagemap_lru_lock?
+ *
+ * Deactivate_page will move an active page to the right
+ * inactive list, while activate_page will move a page back
+ * from one of the inactive lists to the active list. If
+ * called on a page which is not on any of the lists, the
+ * page is left alone.
+ */
+static inline void deactivate_page_nolock(struct page * page)
+{
+       if (PageActive(page)) {
+               del_page_from_active_list(page);
+               add_page_to_inactive_list(page);
+       }
+}
+
+void deactivate_page(struct page * page)
+{
+       spin_lock(&pagemap_lru_lock);
+       deactivate_page_nolock(page);
+       spin_unlock(&pagemap_lru_lock);                                       
+}
+
 /*
  * Move an inactive page to the active list.
  */                                                                          
-------------------------------[ cut here ]-------------------------


Hope this helps...

Cheers!
--
Nicolas Ouedraogo
email: nicson@unforgettable.com


             reply	other threads:[~2001-11-07 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07 13:35 Nicson [this message]
2001-11-07 19:39 ` Problem to compile 2.4.14 on x86 (cause: mm/swap.c) : patch included in body volodya

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=0111071254290C.00326@padawah \
    --to=nicson@unforgettable.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).