Re: [PATCH 1/2] [xarry]:Fixed an issue with memory allocated using the GFP_KERNEL flag in spinlocks

2020-11-03 Thread Matthew Wilcox
On Wed, Nov 04, 2020 at 10:32:12AM +0800, xiaofeng.yan wrote: > xa_lock_irq(xa); > - curr = __xa_store(xa, index, entry, gfp); > + curr = __xa_store(xa, index, entry, GFP_ATOMIC); > xa_unlock_irq(xa); You haven't actually seen a bug, have you? You just read the code wrongly.

[PATCH 1/2] [xarry]:Fixed an issue with memory allocated using the GFP_KERNEL flag in spinlocks

2020-11-03 Thread xiaofeng.yan
From: "xiaofeng.yan" function xa_store_irq() has a spinlock as follows: xa_lock_irq() -->spin_lock_irq(&(xa)->xa_lock) GFP_KERNEL flag could cause sleep. So change GFP_KERNEL to GFP_ATOMIC and Romve "gfp_t gfp" in function static inline void *xa_store_irq(struct xarray *xa, unsigned long ind