[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBBd+pGG6=Qjpt-Zkxt5VdP5T3YV5_RVao+kHpz9dCzqXA@mail.gmail.com>
Date: Sat, 9 Feb 2013 15:30:06 +0800
From: Hillf Danton <dhillf@...il.com>
To: Michel Lespinasse <walken@...gle.com>
Cc: linux-kernel@...r.kernel.org, anton@...ba.org, hpa@...or.com,
mingo@...nel.org, arjan@...ux.intel.com, a.p.zijlstra@...llo.nl,
torvalds@...ux-foundation.org, alex.shi@...el.com,
yuanhan.liu@...ux.intel.com, dhowells@...hat.com,
akpm@...ux-foundation.org
Subject: Re: [PATCH 3/4] rwsem: implement write lock stealing
On Sat, Feb 9, 2013 at 10:45 AM, Michel Lespinasse <walken@...gle.com> wrote:
> + if (waiter->type != RWSEM_WAITING_FOR_WRITE) {
> + list_del(&waiter->list);
> +
> + /* Set RWSEM_WAITING_BIAS before waking the last reader
> + * so we know there will be a remaining active locker.
> + */
> + if (!(--readers) && !list_empty(&sem->wait_list))
> + rwsem_atomic_add(RWSEM_WAITING_BIAS, sem);
> +
> + tsk = waiter->task;
> + smp_mb();
For what with mb?
> + waiter->task = NULL;
> + wake_up_process(tsk);
> + put_task_struct(tsk);
> + }
> + } while (readers);
> + sem->wait_readers = 0;
> + /* If there are no active locks, wake the front queued process(es). */
s/locks/lockers/
> + if (!(count & RWSEM_ACTIVE_MASK))
> + sem = __rwsem_do_wake(sem, RWSEM_WAKE_ANY);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists