+ swapoff-atomic_inc_not_zero-on-mm_users.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     swapoff: use atomic_inc_not_zero() on mm_users

has been added to the -mm tree.  Its filename is

     swapoff-atomic_inc_not_zero-on-mm_users.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: swapoff: use atomic_inc_not_zero() on mm_users
From: Hugh Dickins <hugh@xxxxxxxxxxx>


Now that we have atomic_inc_not_zero, it's more elegant for try_to_unuse to
use that on mm_users: doesn't actually matter at present, but safer to be
sure that once mm_users has gone to 0, nothing raises it for an instant.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

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

diff -puN mm/swapfile.c~swapoff-atomic_inc_not_zero-on-mm_users mm/swapfile.c
--- 25/mm/swapfile.c~swapoff-atomic_inc_not_zero-on-mm_users	Fri May 26 14:25:44 2006
+++ 25-akpm/mm/swapfile.c	Fri May 26 14:25:44 2006
@@ -772,10 +772,8 @@ static int try_to_unuse(unsigned int typ
 			while (*swap_map > 1 && !retval &&
 					(p = p->next) != &start_mm->mmlist) {
 				mm = list_entry(p, struct mm_struct, mmlist);
-				if (atomic_inc_return(&mm->mm_users) == 1) {
-					atomic_dec(&mm->mm_users);
+				if (!atomic_inc_not_zero(&mm->mm_users))
 					continue;
-				}
 				spin_unlock(&mmlist_lock);
 				mmput(prev_mm);
 				prev_mm = mm;
_

Patches currently in -mm which might be from hugh@xxxxxxxxxxx are

mm-vm_bug_on.patch
page-migration-make-do_swap_page-redo-the-fault.patch
migration-remove-unnecessary-pageswapcache-checks.patch
swapless-page-migration-fix-swapopsh97-bug.patch
swapless-pm-add-r-w-migration-entries-fix-2.patch
add-page_mkwrite-vm_operations-method.patch
mm-remove-vm_locked-before-remap_pfn_range-and-drop-vm_shm.patch
swapoff-atomic_inc_not_zero-on-mm_users.patch
page-migration-simplify-migrate_pages.patch
page-migration-simplify-migrate_pages-tweaks.patch
page-migration-handle-freeing-of-pages-in-migrate_pages.patch
page-migration-use-allocator-function-for-migrate_pages.patch
page-migration-support-moving-of-individual-pages.patch
page-migration-detailed-status-for-moving-of-individual-pages.patch
page-migration-support-moving-of-individual-pages-fixes.patch
page-migration-support-a-vma-migration-function.patch
allow-migration-of-mlocked-pages.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux