Skip to contentSkip to conversation

+ frontswap-enable-call-to-invalidate-area-on-swapoff.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Oct 7, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + frontswap-enable-call-to-invalidate-area-on-swapoff.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 07 Oct 2013 15:03:46 -0700

The patch titled
Subject: frontswap: enable call to invalidate area on swapoff
has been added to the -mm tree. Its filename is
frontswap-enable-call-to-invalidate-area-on-swapoff.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/frontswap-enable-call-to-invalidate-area-on-swapoff.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/frontswap-enable-call-to-invalidate-area-on-swapoff.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Krzysztof Kozlowski <[email protected]>
Subject: frontswap: enable call to invalidate area on swapoff

During swapoff the frontswap_map was NULL-ified before calling frontswap_invalidate_area(). However the frontswap_invalidate_area() exits early if frontswap_map is NULL. Invalidate was never called during swapoff.

This patch moves frontswap_map_set() in swapoff just after calling frontswap_invalidate_area() so outside of locks (swap_lock and swap_info_struct->lock). This shouldn't be a problem as during swapon the frontswap_map_set() is called also outside of any locks.

---

 mm/swapfile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swapfile.c renamed from mm/swapfile.c~frontswap-enable-call-to-invalidate-area-on-swapoff +1 -1
diff -puN mm/swapfile.c~frontswap-enable-call-to-invalidate-area-on-swapoff mm/swapfile.c
@@ -1922,10 +1922,10 @@ SYSCALL_DEFINE1(swapoff, const char __us
 	p->cluster_info = NULL;
 	p->flags = 0;
 	frontswap_map = frontswap_map_get(p);
-	frontswap_map_set(p, NULL);
 	spin_unlock(&p->lock);
 	spin_unlock(&swap_lock);
 	frontswap_invalidate_area(type);
+	frontswap_map_set(p, NULL);
 	mutex_unlock(&swapon_mutex);
 	free_percpu(p->percpu_cluster);
 	p->percpu_cluster = NULL;

_

Patches currently in -mm which might be from [email protected] are

frontswap-enable-call-to-invalidate-area-on-swapoff.patch