linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Coleman Kane <ckane@colemankane.org>
To: linux-hotplug@vger.kernel.org
Subject: udevd move from select() to ppoll()
Date: Wed, 13 May 2009 20:50:41 +0000	[thread overview]
Message-ID: <1242247841.2566.50.camel@localhost> (raw)

Hi,

I'm writing as I recently encountered a regression after the select()
--> ppoll() move in the udevd daemon, running on uClibc-0.9.29 and at
least kernels since 2.6.28.

For some reason the ppoll call always returns -1 w/ EINVAL in this
configuration. I actually anticipate this to be a bug in either Linux or
uClibc...

However, while investigating this, I came across the following sequence
of steps performed in udevd.c (line 973):

fdcount = ppoll(pfd, nfds, NULL, &orig_mask);
sigprocmask(SIG_SETMASK, &orig_mask, NULL);

Maybe I am missing something, but my reading of the man page indicates
that the following sequence would accomplish the same work, but would be
faster, as it eliminates the restoration of blocked_mask at the end of
the ppoll() call, which then proceeds to be overwritten again to what it
was inside ppoll by the above sigprocmask() call.

Would it be basically the same to do the following (but faster)?

sigprocmask(SIG_SETMASK, &orig_mask, NULL);
fdcount = poll(pfd, nfds, -1);

Additionally, this reportedly fixes the EINVAL that is hit in uClibc
too, which doesn't reach the error condition in poll().

-- 
Coleman Kane


             reply	other threads:[~2009-05-13 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 20:50 Coleman Kane [this message]
2009-05-14  0:05 ` udevd move from select() to ppoll() Kay Sievers

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=1242247841.2566.50.camel@localhost \
    --to=ckane@colemankane.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).