From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH[ udevd race conditions and performance, assorted cleanups
Date: Sat, 27 Mar 2004 11:30:31 +0000 [thread overview]
Message-ID: <20040327113031.GB2636@vrfy.org> (raw)
In-Reply-To: <4065078F.1070008@sympatico.ca>
On Fri, Mar 26, 2004 at 11:48:15PM -0500, Chris Friesen wrote:
>
> This patch covers a number of areas:
>
> 1) sysfs.h is fixed up to use the common dbg() macro. This fixes the
> case where DEBUG is defined but USE_LOG isn't.
>
> 2) udevstart.c is modified to include the proper headers, rather than
> getting them indirectly which can break depending on Makefile flags
>
> 3) udevd.c gets some major changes:
> a) I added a pipe from the signal handler. This fixes the race
> conditions that I mentioned earlier. Basically, the point of the pipe
> is to force the select() call to return immediately if a signal handler
> fired before we actually started the select() call. This then lets us
> run the appropriate code based on flags set in the signal handler proper.
> b) I added a number of flags to coalesce calls to common routines. This
> should make things slightly more efficient.
> c) since most calls will tend to come in with a sequence number larger
> than what has been received, I switched msg_queue_insert() to scan the
> msg_list backwards to improve performance.
Looks really nice, seems a bit faster too.
Whitespace is broken, no tabs?
> while (1) {
> - handle_msg(ssock);
> -
> - while(msg_q_timeout) {
> - msg_q_timeout = 0;
> - msg_queue_manager();
> + fd_set workreadfds = readfds;
> + retval = select(maxsockplus, &workreadfds, NULL, NULL, NULL);
> +
> + if (retval < 0) {
> + dbg("error in select: %s", strerror(errno));
> + continue;
We interrupt select() intentionally, so better do not call it
"error" in syslog :)
thanks,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2004-03-27 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-27 4:48 [PATCH[ udevd race conditions and performance, assorted cleanups Chris Friesen
2004-03-27 11:30 ` Kay Sievers [this message]
2004-03-28 1:08 ` Kay Sievers
2004-03-29 4:47 ` Chris Friesen
2004-03-31 23:04 ` Greg KH
2004-03-31 23:04 ` Greg KH
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=20040327113031.GB2636@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/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).