mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 6/11] s390: in_interrupt vs. in_atomic.
Date: Fri, 3 Jun 2005 01:15:29 -0700	[thread overview]
Message-ID: <20050603011529.6171359d.akpm@osdl.org> (raw)
In-Reply-To: <OF70B2F27D.009D5702-ONC1257015.002B0625-C1257015.002B7793@de.ibm.com>

Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
>
> > > The condition for no context in do_exception checks for hard and
> > > soft interrupts by using in_interrupt() but not for preemption.
> > > This is bad for the users of __copy_from/to_user_inatomic because
> > > the fault handler might call schedule although the preemption
> > > count is != 0. Use in_atomic() instead in_interrupt().
> > >
> >
> > hm.  Under what circumstances do you expect this test to trigger?
> 
> e.g. by the following:
> 
> static inline int get_futex_value_locked(int *dest, int __user *from)
> {
>         int ret;
> 
>         inc_preempt_count();
>         ret = __copy_from_user_inatomic(dest, from, sizeof(int));
>         dec_preempt_count();
>         preempt_check_resched();
> 
>         return ret ? -EFAULT : 0;
> }
> 

OK, that's what it's designed for.   Just checking ;)

      reply	other threads:[~2005-06-03  8:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01 18:03 Martin Schwidefsky
2005-06-02 22:43 ` Andrew Morton
2005-06-03  7:54   ` Martin Schwidefsky
2005-06-03  8:15     ` Andrew Morton [this message]

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=20050603011529.6171359d.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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

all inboxes | Powered by JetHome®