public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Vadim Lobanov <vlobanov@speakeasy.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Further copy_from_user() discussion.
Date: Thu, 14 Apr 2005 10:36:47 +0100	[thread overview]
Message-ID: <tnxzmw1d7io.fsf@arm.com> (raw)
In-Reply-To: Pine.LNX.4.58.0504131342530.14888@shell4.speakeasy.net

Vadim Lobanov <vlobanov@speakeasy.net> wrote:
> 2. Would it be possible to eliminate the might_sleep() call in
> copy_from_user()? It seems that, very soon after, the __copy_from_user()
> macro does another might_sleep(), with very few instructions in between.
> But there might be some trick here that I'm missing.

might_sleep() is used for debugging the possible sleep while in an
atomic operation. I think it is safe to check this for all the calls
to copy_from_user(), no matter if the access is OK or not (memset
being used in the latter case). The same is for
__copy_from_user(). Anyway, if you don't enable
CONFIG_DEBUG_SPINLOCK_SLEEP, the might_sleep() macro is empty.

-- 
Catalin


  reply	other threads:[~2005-04-14  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 20:52 Further copy_from_user() discussion Vadim Lobanov
2005-04-14  9:36 ` Catalin Marinas [this message]
2005-04-14 17:04   ` Vadim Lobanov
2005-04-15 10:14     ` Catalin Marinas
2005-04-15 15:55       ` Vadim Lobanov

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=tnxzmw1d7io.fsf@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vlobanov@speakeasy.net \
    /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