Message ID | 20210317032648.9080-1-bvanassche@acm.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] sbitmap: Silence a debug kernel warning triggered by sbitmap_put() | expand |
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
Bart, > All sbitmap code uses implied preemption protection to update > sb->alloc_hint except sbitmap_put(). Using implied preemption > protection is safe since the value of sb->alloc_hint only affects > performance of sbitmap allocations but not their correctness. Change > this_cpu_ptr() in sbitmap_put() into raw_cpu_ptr() to suppress the > following kernel warning that appears with preemption debugging > enabled (CONFIG_DEBUG_PREEMPT): Applied to 5.13/scsi-staging, thanks! (Since Ming's series is queued in the SCSI tree).
On Tue, 16 Mar 2021 20:26:48 -0700, Bart Van Assche wrote: > All sbitmap code uses implied preemption protection to update > sb->alloc_hint except sbitmap_put(). Using implied preemption protection > is safe since the value of sb->alloc_hint only affects performance of > sbitmap allocations but not their correctness. Change this_cpu_ptr() in > sbitmap_put() into raw_cpu_ptr() to suppress the following kernel warning > that appears with preemption debugging enabled (CONFIG_DEBUG_PREEMPT): > > [...] Applied to 5.13/scsi-queue, thanks! [1/1] sbitmap: Silence a debug kernel warning triggered by sbitmap_put() https://git.kernel.org/mkp/scsi/c/035e9f471691
diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h index 3087e1f15fdd..2713e689ad66 100644 --- a/include/linux/sbitmap.h +++ b/include/linux/sbitmap.h @@ -324,7 +324,7 @@ static inline void sbitmap_put(struct sbitmap *sb, unsigned int bitnr) sbitmap_deferred_clear_bit(sb, bitnr); if (likely(sb->alloc_hint && !sb->round_robin && bitnr < sb->depth)) - *this_cpu_ptr(sb->alloc_hint) = bitnr; + *raw_cpu_ptr(sb->alloc_hint) = bitnr; } static inline int sbitmap_test_bit(struct sbitmap *sb, unsigned int bitnr)