This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Tue, 09 Sep 2008 17:35:28 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 09 Sep 2008 01:36:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <48C64E76.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <48C628BC.8090805@xxxxxxxxxxxxxx> <48C64E76.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (X11/20080723)
Jan Beulich wrote:
Akio Takebe <takebe_akio@xxxxxxxxxxxxxx> 09.09.08 09:41 >>>
We should avoid using kmalloc while interrupts is disabled.
kmalloc may sleep.

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>

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.

Sorry for my confusion.
As you said, it's my mistake.

Best Regards,

Akio Takebe

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>