linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
@ 2020-01-29 18:15 Davidlohr Bueso
  2020-01-30 10:06 ` Johan Hovold
  2020-03-23 17:29 ` Davidlohr Bueso
  0 siblings, 2 replies; 3+ messages in thread
From: Davidlohr Bueso @ 2020-01-29 18:15 UTC (permalink / raw)
  To: oneukum; +Cc: linux-usb, linux-kernel, dave, 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 <dbueso@suse.de>
---
 drivers/usb/class/cdc-acm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 62f4fb9b362f..0bc4b558f387 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -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);
 }
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
  2020-01-29 18:15 [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
@ 2020-01-30 10:06 ` Johan Hovold
  2020-03-23 17:29 ` Davidlohr Bueso
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-01-30 10:06 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: oneukum, linux-usb, linux-kernel, Davidlohr Bueso

On Wed, Jan 29, 2020 at 10:15:45AM -0800, Davidlohr Bueso wrote:
> 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 <dbueso@suse.de>

Reviewed-by: Johan Hovold <johan@kernel.org>

> ---
>  drivers/usb/class/cdc-acm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index 62f4fb9b362f..0bc4b558f387 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
  2020-01-29 18:15 [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
  2020-01-30 10:06 ` Johan Hovold
@ 2020-03-23 17:29 ` Davidlohr Bueso
  1 sibling, 0 replies; 3+ messages in thread
From: Davidlohr Bueso @ 2020-03-23 17:29 UTC (permalink / raw)
  To: oneukum; +Cc: linux-usb, linux-kernel, Davidlohr Bueso

ping? Can these please be picked up?

On Wed, 29 Jan 2020, Davidlohr Bueso wrote:

>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 <dbueso@suse.de>
>---
> drivers/usb/class/cdc-acm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
>index 62f4fb9b362f..0bc4b558f387 100644
>--- a/drivers/usb/class/cdc-acm.c
>+++ b/drivers/usb/class/cdc-acm.c
>@@ -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);
> }
>-- 
>2.16.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-23 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 18:15 [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
2020-01-30 10:06 ` Johan Hovold
2020-03-23 17:29 ` Davidlohr Bueso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).