Akio Takebe
2008-Sep-09 07:41 UTC
[Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts
Hi, We should avoid using kmalloc while interrupts is disabled. kmalloc may sleep. Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> Best Regards, Akio Takebe _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Akio Takebe
2008-Sep-09 08:19 UTC
Re: [Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts
Hi, Sorry, the kmallocs are GFP_ATOMIC. So please ignore the patch. Best Regards, Akio Takebe Akio Takebe wrote:> Hi, > > We should avoid using kmalloc while interrupts is disabled. > kmalloc may sleep. > > Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> > > Best Regards, > > Akio Takebe > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2008-Sep-09 08:22 UTC
Re: [Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts
>>> Akio Takebe <takebe_akio@jp.fujitsu.com> 09.09.08 09:41 >>> >We should avoid using kmalloc while interrupts is disabled. >kmalloc may sleep. > >Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Akio Takebe
2008-Sep-09 08:35 UTC
Re: [Xen-devel] [Patch] linux: avoid kmalloc while disabling interrupts
Jan Beulich wrote:>>>> Akio Takebe <takebe_akio@jp.fujitsu.com> 09.09.08 09:41 >>> >> We should avoid using kmalloc while interrupts is disabled. >> kmalloc may sleep. >> >> Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> > > 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel