On Thu, 25 Oct 2012, Peter Zijlstra wrote: > So I think the below should work, we hold the spinlock over both rb-tree > modification as sp free, this makes mpol_shared_policy_lookup() which > returns the policy with an incremented refcount work with just the > spinlock. > > Comments? > It's rather unfortunate that we need to protect modification with a spinlock and a mutex but since sharing was removed in commit 869833f2c5c6 ("mempolicy: remove mempolicy sharing") it requires that sp_alloc() is blockable to do the whole mpol_new() and rebind if necessary, which could require mm->mmap_sem; it's not as simple as just converting all the allocations to GFP_ATOMIC. It looks as though there is no other alternative other than protecting modification with both the spinlock and mutex, which is a clever solution, so it looks good to me, thanks! -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>