All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Law <hlcj1234567@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 16:11:25 +0000	[thread overview]
Message-ID: <07e2ae8e-e6e9-4def-9eb2-2c48ce6669b8@gmail.com> (raw)
In-Reply-To: <2026030914-task-stunned-21e0@gregkh>

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.

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...


V/R




Josh law

  reply	other threads:[~2026-03-09 16:11 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 [this message]
2026-03-09 16:56     ` Greg Kroah-Hartman
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=07e2ae8e-e6e9-4def-9eb2-2c48ce6669b8@gmail.com \
    --to=hlcj1234567@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.