linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH?] 2.6.0-test9: mm/memory.c:1075: spin_unlock(kernel/fork.c:c0efed90) not locked
@ 2003-11-11 15:09 Petr Vandrovec
  2003-11-11 16:12 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vandrovec @ 2003-11-11 15:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm

Hi,
  Kasperski's kavscanner went mad today and eat all memory it was able to get.
While system was attempting to recover (one thing I do not understand: there was
one 2GB process (kavscanner) and dozen of ~100MB ones, but kernel killed everyone 
else EXCEPT kavscanner - apache, mysqld) I got several warnings that mm/memory.c:1075 
(do_wp_page) attempts to unlock unlocked spinlock mm->page_table_lock.

  As far as I can tell, problem is that no_mem case should NOT release page_table_lock
as it was already released before call to pte_chain_alloc(), and was not reacquired
yet.
							Petr Vandrovec

Nov 11 15:44:46 vana kernel: VM: killing process apache
Nov 11 15:44:47 vana kernel: apache: page allocation failure. order:0, mode:0xd2
Nov 11 15:44:47 vana kernel: kswapd0: page allocation failure. order:0, mode:0x20
Nov 11 15:44:47 vana last message repeated 5 times
Nov 11 15:44:47 vana kernel: apache: page allocation failure. order:0, mode:0xd2
Nov 11 15:44:47 vana kernel: apache: page allocation failure. order:0, mode:0xd2
Nov 11 15:44:47 vana kernel: mm/memory.c:1075: spin_unlock(kernel/fork.c:c0efed90) not locked
Nov 11 15:44:47 vana kernel: VM: killing process apache
Nov 11 15:44:47 vana kernel: Out of Memory: Killed process 13479 (apache).


P.S.: I'm not subscribed on linux-mm.

--- linux/mm/memory.c.orig	2003-11-06 11:51:56.000000000 +0100
+++ linux/mm/memory.c	2003-11-11 16:03:38.000000000 +0100
@@ -1013,7 +1013,8 @@
 		pte_unmap(page_table);
 		printk(KERN_ERR "do_wp_page: bogus page at address %08lx\n",
 				address);
-		goto oom;
+		ret = VM_FAULT_OOM;
+		goto out;
 	}
 	old_page = pfn_to_page(pfn);
 
@@ -1065,16 +1066,15 @@
 	page_cache_release(new_page);
 	page_cache_release(old_page);
 	ret = VM_FAULT_MINOR;
-	goto out;
-
-no_mem:
-	page_cache_release(old_page);
-oom:
-	ret = VM_FAULT_OOM;
 out:
 	spin_unlock(&mm->page_table_lock);
 	pte_chain_free(pte_chain);
 	return ret;
+
+no_mem:
+	page_cache_release(old_page);
+	pte_chain_free(pte_chain);
+	return VM_FAULT_OOM;
 }
 
 /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH?] 2.6.0-test9: mm/memory.c:1075: spin_unlock(kernel/fork.c:c0efed90) not locked
  2003-11-11 15:09 [PATCH?] 2.6.0-test9: mm/memory.c:1075: spin_unlock(kernel/fork.c:c0efed90) not locked Petr Vandrovec
@ 2003-11-11 16:12 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2003-11-11 16:12 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel, linux-mm


On Tue, 11 Nov 2003, Petr Vandrovec wrote:
> 
>   As far as I can tell, problem is that no_mem case should NOT release page_table_lock
> as it was already released before call to pte_chain_alloc(), and was not reacquired
> yet.

Your patch looks correct to me..

		Linus


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-11 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-11 15:09 [PATCH?] 2.6.0-test9: mm/memory.c:1075: spin_unlock(kernel/fork.c:c0efed90) not locked Petr Vandrovec
2003-11-11 16:12 ` Linus Torvalds

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).