1
0
Fork 0

scatterlist: atomic sg_mapping_iter() no longer needs disabled IRQs

SG mapping iterator w/ SG_MITER_ATOMIC set required IRQ disabled because
it originally used KM_BIO_SRC_IRQ to allow use from IRQ handlers.
kmap_atomic() has long been updated to handle stacking atomic mapping
requests on per-cpu basis and only requires not sleeping while mapped.

Update sg_mapping_iter such that atomic iterators only require disabling
preemption instead of disabling IRQ.

While at it, convert wte weird @ARG@ notations to @ARG in the comment of
sg_miter_start().

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
hifive-unleashed-5.1
Tejun Heo 2012-10-04 17:13:28 -07:00 committed by Linus Torvalds
parent 17d7aac9a5
commit 8290e2d2dc
1 changed files with 8 additions and 8 deletions

View File

@ -404,14 +404,13 @@ EXPORT_SYMBOL(sg_miter_start);
* @miter: sg mapping iter to proceed * @miter: sg mapping iter to proceed
* *
* Description: * Description:
* Proceeds @miter@ to the next mapping. @miter@ should have been * Proceeds @miter to the next mapping. @miter should have been started
* started using sg_miter_start(). On successful return, * using sg_miter_start(). On successful return, @miter->page,
* @miter@->page, @miter@->addr and @miter@->length point to the * @miter->addr and @miter->length point to the current mapping.
* current mapping.
* *
* Context: * Context:
* IRQ disabled if SG_MITER_ATOMIC. IRQ must stay disabled till * Preemption disabled if SG_MITER_ATOMIC. Preemption must stay disabled
* @miter@ is stopped. May sleep if !SG_MITER_ATOMIC. * till @miter is stopped. May sleep if !SG_MITER_ATOMIC.
* *
* Returns: * Returns:
* true if @miter contains the next mapping. false if end of sg * true if @miter contains the next mapping. false if end of sg
@ -465,7 +464,8 @@ EXPORT_SYMBOL(sg_miter_next);
* resources (kmap) need to be released during iteration. * resources (kmap) need to be released during iteration.
* *
* Context: * Context:
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. * Preemption disabled if the SG_MITER_ATOMIC is set. Don't care
* otherwise.
*/ */
void sg_miter_stop(struct sg_mapping_iter *miter) void sg_miter_stop(struct sg_mapping_iter *miter)
{ {
@ -479,7 +479,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
flush_kernel_dcache_page(miter->page); flush_kernel_dcache_page(miter->page);
if (miter->__flags & SG_MITER_ATOMIC) { if (miter->__flags & SG_MITER_ATOMIC) {
WARN_ON(!irqs_disabled()); WARN_ON_ONCE(preemptible());
kunmap_atomic(miter->addr); kunmap_atomic(miter->addr);
} else } else
kunmap(miter->page); kunmap(miter->page);