From: Jia He <jiakernel@gmail.com>
To: Mike Galbraith <bitbucket@online.de>
Cc: linux-kernel@vger.kernel.org,
Davidlohr Bueso <davidlohr.bueso@hp.com>,
Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>,
Manfred Spraul <manfred@colorfullife.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: Sun, 22 Sep 2013 20:44:23 +0800 [thread overview]
Message-ID: <523EE627.40408@gmail.com> (raw)
In-Reply-To: <1379844021.5598.8.camel@marge.simpson.net>
On Sun, 22 Sep 2013 12:00:21 +0200 from bitbucket@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 jiakernel@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 :)
>
>> Anyway, your implementation looks not correct to me. Because from "man semop"
>> sem_otime will record the last sem operation time of semop. If you change the
>> otime in semget(), it changes the meanings in stardard, doesn't it?
> A Linux kernel doing a semop in 1970 would be a kinda neat trick :)
I will try to make it more clear
comes to my test case again:
process_a(server) process_b(client)
semget() <-seems you choose to set it here
--------------- <1> --------------------
semctl(SETVAL)
semop()
semget()
setctl(IP_STAT)
for(;;) {
check until sem_otime > 0
}
And assume that schedule() happenes at <1>, then sem_otime will >0
in process_b's for(;;), but at that time, the process_a's semctl()
hasn't been called yet.
>
> -Mike
>
> .
>
next prev parent reply other threads:[~2013-09-22 12:44 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 [this message]
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
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=523EE627.40408@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).