From: "Jan Beulich" Subject: Re: [Patch] linux: avoid kmalloc while disabling interrupts Date: Tue, 09 Sep 2008 09:22:46 +0100 Message-ID: <48C64E76.76E4.0078.0@novell.com> References: <48C628BC.8090805@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <48C628BC.8090805@jp.fujitsu.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Akio Takebe Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Akio Takebe 09.09.08 09:41 >>> >We should avoid using kmalloc while interrupts is disabled. >kmalloc may sleep. > >Signed-off-by: Akio Takebe I was under the impression that this is why the code uses GFP_ATOMIC. Also, doesn't that patch introduce new problems, in dropping the lock intermediately and then adding entries to lists without checking for already existing entries again? I'd suppose if you want the allocations to be done outside of the lock, you should do them in advance (regardless of whether you'll actually need them) and free the memory after dropping the lock if the entries weren't really inserted anywhere. Jan