lkml.org 
[lkml]   [2003]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] [1/2] random: SMP locking
    On Sat, 2 Aug 2003, Andrew Morton wrote:

    > Oliver Xymoron <oxymoron@waste.org> wrote:
    > >
    > > This patch adds locking for SMP. Apparently Willy never managed to
    > > revive his laptop with his version so I revived mine.
    >
    > hrm. I'm a random ignoramus. I'll look it over...
    >
    > Are you really sure that all the decisions about where to use spin_lock()
    > vs spin_lock_irq() vs spin_lock_irqsave() are correct? They are
    > non-obvious.
    >
    > > @@ -1619,18 +1660,23 @@
    > > if (!capable(CAP_SYS_ADMIN))
    > > return -EPERM;
    > > p = (int *) arg;
    > > + spin_lock(&random_state->lock);
    > > ent_count = random_state->entropy_count;
    > > if (put_user(ent_count, p++) ||
    > > get_user(size, p) ||
    > > put_user(random_state->poolinfo.poolwords, p++))
    >
    > Cannot perform userspace access while holding a lock - a pagefault could
    > occur, perform IO, schedule away and the same CPU tries to take the same
    > lock via a different process.

    Perhaps might_sleep() in *_user, copy_* etc is in order?

    --
    function.linuxpower.ca
    -
    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-03-22 13:47    [W:0.022 / U:32.084 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site