From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with ESMTP id 213996B0047 for ; Wed, 3 Mar 2010 22:30:24 -0500 (EST) Date: Thu, 4 Mar 2010 14:30:17 +1100 From: Nick Piggin Subject: Re: [PATCH 4/4] cpuset,mm: use rwlock to protect task->mempolicy and mems_allowed Message-ID: <20100304033017.GN8653@laptop> References: <4B8E3F77.6070201@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B8E3F77.6070201@cn.fujitsu.com> Sender: owner-linux-mm@kvack.org To: Miao Xie Cc: David Rientjes , Lee Schermerhorn , Paul Menage , Linux-Kernel , Linux-MM List-ID: On Wed, Mar 03, 2010 at 06:52:39PM +0800, Miao Xie wrote: > if MAX_NUMNODES > BITS_PER_LONG, loading/storing task->mems_allowed or mems_allowed in > task->mempolicy are not atomic operations, and the kernel page allocator gets an empty > mems_allowed when updating task->mems_allowed or mems_allowed in task->mempolicy. So we > use a rwlock to protect them to fix this probelm. Thanks for working on this. However, rwlocks are pretty nasty to use when you have short critical sections and hot read-side (they're twice as heavy as even spinlocks in that case). It's being used in the page allocator path, so I would say rwlocks are almost a showstopper. Wouldn't it be possible to use a seqlock for this? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org