Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1572336 > unrolled thread
| Started by | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| First post | 2017-02-02 14:00 +0100 |
| Last post | 2017-02-02 14:00 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/2] scatterlist: clean up Gilad Ben-Yossef <gilad@benyossef.com> - 2017-02-02 14:00 +0100
[PATCH 2/2] scatterlist: do not disable IRQs in sg_copy_buffer Gilad Ben-Yossef <gilad@benyossef.com> - 2017-02-02 14:00 +0100
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-02-02 14:00 +0100 |
| Subject | [PATCH 0/2] scatterlist: clean up |
| Message-ID | <t6p9v-441-5@gated-at.bofh.it> |
Ran into these two clean up / optimization opportunities while chasing an unrelated bug. Gilad Ben-Yossef (2): scatterlist: reorder compound boolean expression scatterlist: do not disable IRQs in sg_copy_buffer lib/scatterlist.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.1.4
[toc] | [next] | [standalone]
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-02-02 14:00 +0100 |
| Subject | [PATCH 2/2] scatterlist: do not disable IRQs in sg_copy_buffer |
| Message-ID | <t6p9w-441-23@gated-at.bofh.it> |
| In reply to | #1572336 |
Commit 50bed2e2862a ("sg: disable interrupts inside sg_copy_buffer")
introduced disabling interrupts in sg_copy_buffer() since atomic uses of
miter required it due to use of kmap_atomic().
However, as commit 8290e2d2dcbf ("scatterlist: atomic sg_mapping_iter()
no longer needs disabled IRQs") acknowledges disabling interrupts is no
longer needed for calls to kmap_atomic() and therefore unneeded for miter
ops either, so remove it from sg_copy_buffer().
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
lib/scatterlist.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 393920f..c6cf822 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -651,7 +651,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
{
unsigned int offset = 0;
struct sg_mapping_iter miter;
- unsigned long flags;
unsigned int sg_flags = SG_MITER_ATOMIC;
if (to_buffer)
@@ -664,8 +663,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
if (!sg_miter_skip(&miter, skip))
return false;
- local_irq_save(flags);
-
while ((offset < buflen) && sg_miter_next(&miter)) {
unsigned int len;
@@ -681,7 +678,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
sg_miter_stop(&miter);
- local_irq_restore(flags);
return offset;
}
EXPORT_SYMBOL(sg_copy_buffer);
--
2.1.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web