All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Bligh <mbligh@mbligh.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, Nick Piggin <nickpiggin@yahoo.com.au>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [RFC] Remove unswappable anonymous pages off the LRU
Date: Thu, 15 Feb 2007 17:40:09 -0800	[thread overview]
Message-ID: <45D50B79.5080002@mbligh.org> (raw)
In-Reply-To: <20070215171355.67c7e8b4.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Thu, 15 Feb 2007 13:05:47 -0800 (PST)
> Christoph Lameter <clameter@sgi.com> wrote:
> 
>> If we do not have any swap or we have run out of swap then anonymous pages
>> can no longer be removed from memory. In that case we simply treat them
>> like mlocked pages. For a kernel compiled CONFIG_SWAP off this means
>> that all anonymous pages are marked mlocked when they are allocated.
> 
> It's nice and simple, but I think I'd prefer to wait for the existing mlock
> changes to crash a bit less before we do this.
> 
> Is it true that PageMlocked() pages are never on the LRU?  If so, perhaps
> we could overload the lru.next/prev on these pages to flag an mlocked page.
> 
> #define PageMlocked(page)	(page->lru.next == some_address_which_isnt_used_for_anwything_else)

Mine just created a locked list. If you stick them there, there's no
need for a page flag ... and we don't abuse the lru pointers AGAIN! ;-)

Suspect most of the rest of my patch is crap, but that might be useful?

M.


--- linux-2.6.17/include/linux/mm_inline.h      2006-06-17 
18:49:35.000000000 -0
700
+++ linux-2.6.17-mlock_lru/include/linux/mm_inline.h    2006-07-28 
15:53:15.0000
00000 -0700

@@ -28,6 +27,20 @@ del_page_from_inactive_list(struct zone
  }

  static inline void
+add_page_to_mlocked_list(struct zone *zone, struct page *page)
+{
+       list_add(&page->lru, &zone->mlocked_list);
+       zone->nr_mlocked--;
+}
+
+static inline void
+del_page_from_mlocked_list(struct zone *zone, struct page *page)
+{
+       list_del(&page->lru);
+       zone->nr_mlocked--;
+}
+
+static inline void
  del_page_from_lru(struct zone *zone, struct page *page)
  {
         list_del(&page->lru);
diff -aurpN -X /home/mbligh/.diff.exclude 
linux-2.6.17/include/linux/mmzone.h li
nux-2.6.17-mlock_lru/include/linux/mmzone.h
--- linux-2.6.17/include/linux/mmzone.h 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-mlock_lru/include/linux/mmzone.h       2006-07-28 
15:49:05.0000
00000 -0700
@@ -156,10 +156,12 @@ struct zone {
         spinlock_t              lru_lock;
         struct list_head        active_list;
         struct list_head        inactive_list;
+       struct list_head        mlocked_list;
         unsigned long           nr_scan_active;
         unsigned long           nr_scan_inactive;
         unsigned long           nr_active;
         unsigned long           nr_inactive;
+       unsigned long           nr_mlocked;
         unsigned long           pages_scanned;     /* since last reclaim */
         int                     all_unreclaimable; /* All pages pinned */

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2007-02-16  1:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 21:05 [RFC] Remove unswappable anonymous pages off the LRU Christoph Lameter
2007-02-15 22:31 ` Rik van Riel
2007-02-15 22:41   ` Christoph Lameter
2007-02-15 22:50     ` Rik van Riel
2007-02-15 22:53       ` Christoph Lameter
2007-02-15 23:19       ` Andrew Morton
2007-02-15 23:20       ` Lee Schermerhorn
2007-02-16  0:15         ` Andrew Morton
2007-02-16  1:13 ` Andrew Morton
2007-02-16  1:24   ` KAMEZAWA Hiroyuki
2007-02-16  1:40   ` Martin Bligh [this message]
2007-02-16  1:49     ` Andrew Morton
2007-02-16  2:21       ` Martin Bligh
2007-02-16  2:34       ` Christoph Lameter
2007-02-16  2:48         ` Andrew Morton
2007-02-16  2:50           ` Christoph Lameter
2007-02-16  3:18             ` Andrew Morton
2007-02-16  3:36               ` Christoph Lameter
2007-02-16  3:42                 ` Andrew Morton
2007-02-16  3:50                   ` Christoph Lameter
2007-02-16  4:02                     ` Andrew Morton
2007-02-16  4:07                       ` Christoph Lameter
2007-02-16  4:03                     ` Andrew Morton
2007-02-16  4:14                     ` Rik van Riel
2007-02-16  4:15                       ` Christoph Lameter
2007-02-16  4:57                         ` KAMEZAWA Hiroyuki
2007-02-16  5:16                           ` Andrew Morton
2007-02-16  5:25                             ` Christoph Lameter
2007-02-16  5:41                               ` Andrew Morton
2007-02-16  5:19                           ` Christoph Lameter
2007-02-16  4:24                       ` Andrew Morton
2007-02-16  8:15           ` Peter Zijlstra
2007-02-16  9:11             ` Rafael J. Wysocki
2007-02-16  9:19               ` Peter Zijlstra
2007-02-16 10:10             ` Christoph Lameter
2007-02-16 10:17               ` Peter Zijlstra
2007-02-16 11:04                 ` Rafael J. Wysocki
2007-02-16  2:16     ` Christoph Lameter
2007-02-16  3:17       ` Martin Bligh
2007-02-16  3:29         ` Christoph Lameter
2007-02-16  8:10     ` Peter Zijlstra
2007-02-16  2:15   ` Christoph Lameter
2007-02-16  2:55   ` Christoph Lameter
2007-02-16  5:02     ` Christoph Lameter

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=45D50B79.5080002@mbligh.org \
    --to=mbligh@mbligh.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.