lkml.org 
[lkml]   [2005]   [Jun]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 3 Jun 2005 01:15:29 -0700
FromAndrew Morton <>
SubjectRe: [patch 6/11] s390: in_interrupt vs. in_atomic.
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 ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-03 10:19    [from the cache]
©2003-2008