lkml.org 
[lkml]   [2005]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 07/13] freeing update swap_list.next
This makes negligible difference in practice: but swap_list.next should not
be updated to a higher prio in the general helper swap_info_get, but rather
in swap_entry_free; and then only in the case when entry is actually freed.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

mm/swapfile.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

--- swap6/mm/swapfile.c 2005-07-08 19:14:26.000000000 +0100
+++ swap7/mm/swapfile.c 2005-07-08 19:14:39.000000000 +0100
@@ -213,8 +213,6 @@ static struct swap_info_struct * swap_in
if (!p->swap_map[offset])
goto bad_free;
swap_list_lock();
- if (p->prio > swap_info[swap_list.next].prio)
- swap_list.next = type;
swap_device_lock(p);
return p;

@@ -251,6 +249,8 @@ static int swap_entry_free(struct swap_i
p->lowest_bit = offset;
if (offset > p->highest_bit)
p->highest_bit = offset;
+ if (p->prio > swap_info[swap_list.next].prio)
+ swap_list.next = p - swap_info;
nr_swap_pages++;
p->inuse_pages--;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-07-09 02:22    [W:0.067 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site