usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
Subsystems (2)
PATCH 7/8 usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
We can avoid the unnecessary barrier on non LL/SC architectures, such as x86. Instead, use the smp_mb__after_atomic() call.
Signed-off-by Davidlohr Bueso <[email protected]>
--- drivers/usb/class/cdc-acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-acm.c +1 -1
@@ -842,7 +842,7 @@ static void acm_tty_unthrottle(struct tty_struct *tty)clear_bit (ACM_THROTTLED , &acm->flags);/* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */ -smp_mb (); +smp_mb__after_atomic ();acm_submit_read_urbs (acm,GFP_KERNEL ); }
Signature · 1 line
2.16.4
Quoted 4 lines · Davidlohr Bueso
We can avoid the unnecessary barrier on non LL/SC architectures, such as x86. Instead, use the
smp_mb__after_atomic()call.Signed-off-by Davidlohr Bueso <[email protected]>
Reviewed-by Johan Hovold <[email protected]>
Quoted 9 lines
--- drivers/usb/class/cdc-acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/class/cdc-acm.c +0
-0
drivers/usb/class/cdc-acm.c static void acm_tty_unthrottle(struct tty_struct *tty) · line 848
Quoted 8 lines
drivers/usb/class/cdc-acm.c +1
-1@@ -842,7 +842,7 @@ static void acm_tty_unthrottle(struct tty_struct *tty)clear_bit (ACM_THROTTLED , &acm->flags);/* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */ -smp_mb (); +smp_mb__after_atomic ();acm_submit_read_urbs (acm,GFP_KERNEL ); }
We have another barrier in USB serial which can also be relaxed this way. I'll post a patch shortly.
Johan
ping? Can these please be picked up?
Quoted 24 lines · Davidlohr Bueso
We can avoid the unnecessary barrier on non LL/SC architectures, such as x86. Instead, use the
smp_mb__after_atomic()call.Signed-off-by Davidlohr Bueso <[email protected]>---
drivers/usb/class/cdc-acm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/class/cdc-acm.c +1
-1@@ -842,7 +842,7 @@ static void acm_tty_unthrottle(struct tty_struct *tty)clear_bit (ACM_THROTTLED , &acm->flags);/* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */ -smp_mb (); +smp_mb__after_atomic ();acm_submit_read_urbs (acm,GFP_KERNEL ); }Signature · 1 line
2.16.4