From: Paul E. McKenney Date: Tue, 10 Mar 2009 19:55:52 +0000 (-0700) Subject: idr: make idr_remove_all() do removal -before- free_layer() X-Git-Tag: v2.6.29-rc8~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b23336ad98b3666c216617227c7767cd60a22be;p=pandora-kernel.git idr: make idr_remove_all() do removal -before- free_layer() Fix a problem in the IDR system, where an idr_remove_all() hands a data element to call_rcu() (via free_layer()) before making that data element inaccessible to new readers. This is very bad, and results in readers still having a reference to this data element at the end of the grace period. Tests on large machines that concurrently map and unmap user-space memory within the same multithreaded process result in crashes within about five minutes. Applying this patch increases the kernel's longevity to the three-to-eight-hour range. There appear to be other similar problems in idr_get_empty_slot() and sub_remove(), but I fixed the easy one in idr_remove_all() first. It is therefore no surprise that failures still occur. Located-by: Milton Miller II Tested-by: Milton Miller II Signed-off-by: Paul E. McKenney Cc: Manfred Spraul Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed