[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51583E01.5030106@surriel.com>
Date: Sun, 31 Mar 2013 09:45:37 -0400
From: Rik van Riel <riel@...riel.com>
To: Davidlohr Bueso <davidlohr.bueso@...com>
CC: Emmanuel Benisty <benisty.e@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Dave Jones <davej@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
hhuang@...hat.com, "Low, Jason" <jason.low2@...com>,
Michel Lespinasse <walken@...gle.com>,
Larry Woodman <lwoodman@...hat.com>,
"Vinod, Chegu" <chegu_vinod@...com>,
Peter Hurley <peter@...leysoftware.com>
Subject: Re: ipc,sem: sysv semaphore scalability
On 03/31/2013 01:01 AM, Davidlohr Bueso wrote:
> diff --git a/ipc/sem.c b/ipc/sem.c
> index f257afe..74cedfe 100644
> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -1867,8 +1867,7 @@ void exit_sem(struct task_struct *tsk)
> struct sem_array *sma;
> struct sem_undo *un;
> struct list_head tasks;
> - int semid;
> - int i;
> + int semid, i;
>
> rcu_read_lock();
> un = list_entry_rcu(ulp->list_proc.next,
> @@ -1884,12 +1883,13 @@ void exit_sem(struct task_struct *tsk)
> }
>
> sma = sem_obtain_object_check(tsk->nsproxy->ipc_ns, un->semid);
Should we use "semid" here, like Linus suggested, instead of "un->semid"?
> - sem_lock(sma, NULL, -1);
> -
> /* exit_sem raced with IPC_RMID, nothing to do */
> - if (IS_ERR(sma))
> + if (IS_ERR(sma)) {
> + rcu_read_unlock();
> continue;
> + }
>
> + sem_lock(sma, NULL, -1);
> un = __lookup_undo(ulp, semid);
> if (un == NULL) {
> /* exit_sem raced with IPC_RMID+semget() that created
>
--
All rights reversed.
--
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