linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia He <jiakernel@gmail.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Mike Galbraith <bitbucket@online.de>,
	linux-kernel@vger.kernel.org,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization
Date: Wed, 25 Sep 2013 15:49:37 +0800	[thread overview]
Message-ID: <52429591.9080701@gmail.com> (raw)
In-Reply-To: <524288D4.9090407@colorfullife.com>

 
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@colorfullife.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
>
>


  reply	other threads:[~2013-09-25  7:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22  2:11 [PATCH] ipc/sem.c: fix update sem_otime when calling sem_op in semaphore initialization Jia He
2013-09-22  8:17 ` Mike Galbraith
2013-09-22  8:26   ` Mike Galbraith
2013-09-22  9:34     ` Jia He
2013-09-22 10:00       ` Mike Galbraith
2013-09-22 12:44         ` Jia He
2013-09-22 10:42     ` Manfred Spraul
2013-09-22 12:53       ` Jia He
2013-09-22 15:14       ` Jia He
2013-09-24 21:09         ` Manfred Spraul
2013-09-25  3:05           ` Jia He
2013-09-25  6:55             ` Manfred Spraul
2013-09-25  7:49               ` Jia He [this message]
2013-09-23  1:08       ` Mike Galbraith
2013-09-23  2:24         ` Jia He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52429591.9080701@gmail.com \
    --to=jiakernel@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bitbucket@online.de \
    --cc=davidlohr.bueso@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=riel@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).