[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52429591.9080701@gmail.com>
Date: Wed, 25 Sep 2013 15:49:37 +0800
From: Jia He <jiakernel@...il.com>
To: Manfred Spraul <manfred@...orfullife.com>
CC: Mike Galbraith <bitbucket@...ine.de>, linux-kernel@...r.kernel.org,
Davidlohr Bueso <davidlohr.bueso@...com>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in
semaphore initialization
Hi Manfred
got it :) I am so glad that my minor is on top of yours
Anyway,
Do you think it is more safe to update the otime like this:
- sma->sem_base[sops[0].sem_num].sem_otime =
- get_seconds();
+ if (sops == NULL) {
+ sma->sem_base[0].sem_otime = get_seconds();
+ } else {
+ sma->sem_base[sops[0].sem_num].sem_otime =
+ get_seconds();
+ }
If u think so, i will update my patch according to it
On Wed, 25 Sep 2013 08:55:16 +0200 from manfred@...orfullife.com wrote:
> Hi Jia,
>
> On 09/25/2013 05:05 AM, Jia He wrote:
>> Hi Manfred
>> IIUC after reivewing your patch and src code, does it seem
>> sem_otime lost the chance to be updated when calling
>> semctl_main/semctl_setval?
>> In old codes, even whendo_smart_update(sma, NULL, 0, 0, &tasks),
>> the otime can be updated after several conditions checking.
> The update is performed now performed inside perform_atomic_semop():
>
> Old code:
> perform_atomic_semop() does not update sem_otime. It just returns 0 for
> successfull operations.
> This "0 returned" is passed upwards ("semop_completed") into do_smart_update()
> do_smart_update() updates sem_otime.
>
> New code:
> perform_atomic_semop() updates sem_otime immediately (your change).
> No need to keep track if a waiting operation was completed (my change).
>
> I don't see a problem - perhaps I overlook something.
> Which problem do you see?
>
> --
> Manfred
>
>
--
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