From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] udevd: fix WAIT_FOR_SYSFS
Date: Sat, 25 Oct 2008 17:19:37 +0000 [thread overview]
Message-ID: <49035529.5080906@tuffmail.co.uk> (raw)
In-Reply-To: <4900C46A.7070501@tuffmail.co.uk>
Alan Jenkins wrote:
> Kay Sievers wrote:
>
>> On Thu, Oct 23, 2008 at 21:56, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>>
>>
>>> Kay Sievers wrote:
>>>
>>>
>>>> On Thu, Oct 23, 2008 at 21:03, Kay Sievers <kay.sievers@vrfy.org> wrote:
>>>>
>>>>
>>>>> On Thu, Oct 23, 2008 at 20:37, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> The wait should be ordered after matching KERNEL, ENV, etc.
>>>>>> but before ATTR.
>>>>>>
>>>>>> Without this, WAIT_FOR_SYSFS rules will be applied unconditionally
>>>>>> to all events.
>>>>>>
>>>>>>
>>>>>>
>>>>> Ah, nice! Thanks for finding that out. I do not have any of theses
>>>>> rules left, as there are currently no know issues with recent kernels.
>>>>> :) Applied.
>>>>>
>>>>>
>>>> Oh, now that I expect it works for you without the long delay. :) How
>>>> does is compare? Is it still slower?
>>>>
>>>>
>>
>>
>>> No, that fixed it. The network interface rename problem seems to have
>>> gone as well (!).
>>>
>>> I just tested it on my desktop. oprofile says it now _reduces_ cpu
>>> cycles in udevd by 10%. Not big enough to show up in time(1), but not
>>> bad! And it should help more on the EeePC, which has a less lavish cpu
>>> cache.
>>>
>>>
>> Sounds good. I've changed a few other things, which might make things faster:
>>
>> We cache the results of getpwnam/getgrnam() during rules parse time,
>> some of the rules files I have here have ~700 rules with GROUP="..."
>> keys ...
>>
>> We check at parse time, if we need to call fnmatch() for a key, or can
>> just go with the much cheaper strcmp(). That seems to make a real
>> difference with the large rules files I have.
>>
>>
>
> Nice.
>
>
>> Also the snprintf() that was used compose the buffer to pass the event
>> to a socket was _very_ expensive. We just use strlcpy() now and cache
>> the result for the next RUN+="socket:" call.
>>
>>
>
> I might adapt that for udev-exec.
>
> But I think it needs a flag like envp_uptodate, no?
>
And for bonus points...
udev_device_get_properties_envp() could return pointers into this
buffer, instead of allocating individual strings on the heap.
Alan
next prev parent reply other threads:[~2008-10-25 17:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 18:37 [PATCH] udevd: fix WAIT_FOR_SYSFS Alan Jenkins
2008-10-23 19:03 ` Kay Sievers
2008-10-23 19:12 ` Kay Sievers
2008-10-23 19:56 ` Alan Jenkins
2008-10-25 13:33 ` Kay Sievers
2008-10-25 16:19 ` Alan Jenkins
2008-10-25 17:19 ` Alan Jenkins [this message]
2008-10-25 17:46 ` Kay Sievers
2008-10-25 17:48 ` Kay Sievers
2008-10-25 17:57 ` Alan Jenkins
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=49035529.5080906@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--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).