linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] libudev: Allocate udev_device->envp lazily
Date: Tue, 21 Oct 2008 11:48:30 +0000	[thread overview]
Message-ID: <48FDC18E.5010609@tuffmail.co.uk> (raw)
In-Reply-To: <48FDAADD.3000809@tuffmail.co.uk>

Kay Sievers wrote:
> On Tue, Oct 21, 2008 at 12:11, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>   
>> Allocate udev_device->envp lazily
>>
>> It's a pity to allocate 128 words when we don't need them.
>> Measured 2% _user_ cpu time reduction on EeePC coldplug.
>>     
>
> Any idea what might take 2% here? We don't do anything if the envp
> isn't used. We do almost the same thing with or without the patch
> besides that "struct udev_device" is 1016 bytes smaller now, and we
> malloc() it.
>
> Kay
>   

oprofile said malloc() went down by about that much.  I measured on top
of threaded udevd, so I might be unlucky and chasing overheads you don't
see in the single-threaded implementation :).

By rights it should reduce memset() (or calloc now).  And it might help
with caching, because the array effectively splits udev_device in two.

Using memory more compactly can reduce page faults, but I don't think
that was significant.

Alan

  parent reply	other threads:[~2008-10-21 11:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 10:11 [PATCH] libudev: Allocate udev_device->envp lazily Alan Jenkins
2008-10-21 11:07 ` Kay Sievers
2008-10-21 11:48 ` Alan Jenkins [this message]
2008-10-21 12:00 ` Kay Sievers
2008-10-21 13:00 ` Bob Beers
2008-10-21 13:01 ` 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=48FDC18E.5010609@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).