From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Sat, 07 Feb 2004 10:06:03 +0000 Subject: Re: [PATCH] convert udevsend/udevd to DGRAM and single-threaded Message-Id: <20040207100603.GA7365@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" List-Id: References: <40232F58.3040404@sympatico.ca> In-Reply-To: <40232F58.3040404@sympatico.ca> To: linux-hotplug@vger.kernel.org --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 06, 2004 at 02:21:44PM -0800, Greg KH wrote: > On Fri, Feb 06, 2004 at 12:27:55PM +0100, Kay Sievers wrote: > > On Fri, Feb 06, 2004 at 01:08:24AM -0500, Chris Friesen wrote: > > > > > > Kay, you said "unless we can get rid of _all_ the threads or at least > > > getting faster, I don't want to change it." > > > > > > Well how about we get rid of all the threads, *and* we get faster? > > > > Yes, we are twice as fast now on my box :) > > Very nice, thanks a lot Chris. I tried to compile udevd with klibc. Here are the neccessary changes to compile it, but I doesn't work well now. There seems to be a issue with the signal handling in klibc. Any idea? Kay --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-udevd-klibc.patch" ===== udevd.c 1.15 vs edited ===== --- 1.15/udevd.c Fri Feb 6 13:02:10 2004 +++ edited/udevd.c Sat Feb 7 10:49:54 2004 @@ -279,6 +279,7 @@ struct sockaddr_un saddr; socklen_t addrlen; int retval; + struct sigaction act; init_logging("udevd"); @@ -288,8 +289,12 @@ signal(SIGCHLD, sig_handler); /* we want these two to interrupt system calls */ - siginterrupt(SIGALRM, 1); - siginterrupt(SIGCHLD, 1); + sigaction(SIGALRM, NULL, &act); + act.sa_flags &= ~SA_RESTART; + sigaction(SIGALRM, &act, NULL); + sigaction(SIGCHLD, NULL, &act); + act.sa_flags &= ~SA_RESTART; + sigaction(SIGCHLD, &act, NULL); memset(&saddr, 0x00, sizeof(saddr)); saddr.sun_family = AF_LOCAL; @@ -304,7 +309,7 @@ } /* the bind takes care of ensuring only one copy running */ - retval = bind(ssock, &saddr, addrlen); + retval = bind(ssock, (struct sockaddr *) &saddr, addrlen); if (retval < 0) { dbg("bind failed\n"); goto exit; ===== udevsend.c 1.18 vs edited ===== --- 1.18/udevsend.c Fri Feb 6 11:54:08 2004 +++ edited/udevsend.c Sat Feb 7 10:41:13 2004 @@ -174,7 +174,7 @@ /* If we can't send, try to start daemon and resend message */ loop = UDEVSEND_CONNECT_RETRY; while (loop--) { - retval = sendto(sock, &message, size, 0, (struct sockaddr*)&saddr, addrlen); + retval = sendto(sock, &message, size, 0, (struct sockaddr *)&saddr, addrlen); if (retval != -1) { retval = 0; goto close_and_exit; --NzB8fVQJ5HfG6fxh-- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ 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