Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-25 Thread Jia He
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_

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-24 Thread Manfred Spraul
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 se

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-24 Thread Jia He
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. On Tue, 24 Sep 2013 23

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-24 Thread Manfred Spraul
On 09/22/2013 05:14 PM, Jia He wrote: Hi Manfred On Sun, 22 Sep 2013 12:42:05 +0200 from manf...@colorfullife.com wrote: Hi all, On 09/22/2013 10:26 AM, Mike Galbraith wrote: On Sun, 2013-09-22 at 10:17 +0200, Mike Galbraith wrote: On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: In commi

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Jia He
On Mon, 23 Sep 2013 03:08:36 +0200 from bitbuc...@online.de wrote: > On Sun, 2013-09-22 at 12:42 +0200, Manfred Spraul wrote: > >> Mike: no, your patch makes it worse: >> - wait-for-zero semops still don't update sem_otime >> - sem_otime is initialized to sem_ctime. That's not mentioned in the

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Mike Galbraith
On Sun, 2013-09-22 at 12:42 +0200, Manfred Spraul wrote: > Mike: no, your patch makes it worse: > - wait-for-zero semops still don't update sem_otime > - sem_otime is initialized to sem_ctime. That's not mentioned in the > sysv standard. So sem_otime = 0 is a specified semaphore state? I though

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Jia He
Hi Manfred On Sun, 22 Sep 2013 12:42:05 +0200 from manf...@colorfullife.com wrote: > Hi all, > > On 09/22/2013 10:26 AM, Mike Galbraith wrote: >> On Sun, 2013-09-22 at 10:17 +0200, Mike Galbraith wrote: >>> On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: In commit 0a2b9d4c,the update of sem

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Jia He
On Sun, 22 Sep 2013 12:42:05 +0200 from manf...@colorfullife.com wrote: > Hi all, > > On 09/22/2013 10:26 AM, Mike Galbraith wrote: >> On Sun, 2013-09-22 at 10:17 +0200, Mike Galbraith wrote: >>> On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: In commit 0a2b9d4c,the update of semaphore's s

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Jia He
On Sun, 22 Sep 2013 12:00:21 +0200 from bitbuc...@online.de wrote: > On Sun, 2013-09-22 at 17:34 +0800, Jia He wrote: >> Thanks for the comments, but pls add my email as "from jiaker...@gmail.com" >> if you have a better implementation.U know, it is my first kernel patch, >> maybe >> will give

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Manfred Spraul
Hi all, On 09/22/2013 10:26 AM, Mike Galbraith wrote: On Sun, 2013-09-22 at 10:17 +0200, Mike Galbraith wrote: On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: In commit 0a2b9d4c,the update of semaphore's sem_otime(last semop time) was removed because he wanted to move setting sem->sem_otime t

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Mike Galbraith
On Sun, 2013-09-22 at 17:34 +0800, Jia He wrote: > Thanks for the comments, but pls add my email as "from jiaker...@gmail.com" > if you have a better implementation.U know, it is my first kernel patch, maybe > will give me a brilliant memory in the future :) You can have the blame if you like :)

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Jia He
Thanks for the comments, but pls add my email as "from jiaker...@gmail.com" if you have a better implementation.U know, it is my first kernel patch, maybe will give me a brilliant memory in the future :) Anyway, your implementation looks not correct to me. Because from "man semop" sem_otime wil

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Mike Galbraith
On Sun, 2013-09-22 at 10:17 +0200, Mike Galbraith wrote: > On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: > > In commit 0a2b9d4c,the update of semaphore's sem_otime(last semop time) > > was removed because he wanted to move setting sem->sem_otime to one > > place. But after that, the initial se

Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-22 Thread Mike Galbraith
On Sun, 2013-09-22 at 10:11 +0800, Jia He wrote: > In commit 0a2b9d4c,the update of semaphore's sem_otime(last semop time) > was removed because he wanted to move setting sem->sem_otime to one > place. But after that, the initial semop() will not set the otime > because its sem_op value is 0(in se

[PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization

2013-09-21 Thread Jia He
In commit 0a2b9d4c,the update of semaphore's sem_otime(last semop time) was removed because he wanted to move setting sem->sem_otime to one place. But after that, the initial semop() will not set the otime because its sem_op value is 0(in semtimedop,will not change otime if alter == 1). the error