public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Josh Law <hlcj1234567@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Josh Law <objecting@objecting.org>
Subject: Re: [PATCH] staging: axis-fifo: minimize lock duration in write
Date: Mon, 9 Mar 2026 17:56:34 +0100	[thread overview]
Message-ID: <2026030903-although-gratitude-49a6@gregkh> (raw)
In-Reply-To: <07e2ae8e-e6e9-4def-9eb2-2c48ce6669b8@gmail.com>

On Mon, Mar 09, 2026 at 04:11:25PM +0000, Josh Law wrote:
> 9 Mar 2026 16:07:50 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> 
> > On Sun, Mar 01, 2026 at 12:58:36AM +0000, Josh Law wrote:
> >> Memory allocation and copy from user space with vmemdup_user() is relatively slow and can sleep. Move it outside the lock to minimize the time the mutex is held, reducing contention for concurrent accesses.
> >
> > Something happened with your line wrapping :(
> >
> > And are you sure that your change works?  What is wrong with grabbing
> > the lock this way?
> >
> > thanks,
> >
> > greg k-h
> 
> The issue with grabbing the lock before vmemdup_user() is that the allocation and user-space copy can take a significant amount of time and can sleep.

But what is wrong with that?

> Also, it's just to be more efficient haha, and yes I'm sure this change works, I own the hardware, and it operates better...

Great, please put the performance numbers in the patch, that will show
the need for this change.

thanks,

greg k-h

  reply	other threads:[~2026-03-09 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01  0:58 [PATCH] staging: axis-fifo: minimize lock duration in write Josh Law
2026-03-01 18:39 ` Ethan Tidmore
2026-03-09 16:07 ` Greg Kroah-Hartman
2026-03-09 16:11   ` Josh Law
2026-03-09 16:56     ` Greg Kroah-Hartman [this message]
2026-03-09 17:04       ` Josh Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026030903-although-gratitude-49a6@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=hlcj1234567@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=objecting@objecting.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox