linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Alexander Graf <graf@amazon.com>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"Woodhouse, David" <dwmw@amazon.co.uk>
Subject: Re: [PATCH] ACPI: bus: Match first 9 bytes of device IDs
Date: Fri, 25 Feb 2022 22:03:01 +0100	[thread overview]
Message-ID: <YhlEBUOeiP4jOIsf@zx2c4.com> (raw)
In-Reply-To: <a71a855f-9f3b-c99d-d4f9-c1ceb13c690d@amazon.com>

Hi Alex,

On Fri, Feb 25, 2022 at 08:06:39PM +0100, Alexander Graf wrote:
> On 25.02.22 19:39, Jason A. Donenfeld wrote:
> > Okay, the final piece, userspace:
> >
> > /sys/bus/acpi/devices/QEMUVGID:00/modalias gives:
> >      acpi:QEMUVGID:VM_GEN_COUNTER:
> >
> > modinfo -F alias vmgenid.ko gives:
> >      acpi*:VM_GEN_COUNTER:*
> >
> > udev src uses fnmatch.
> >
> > Bash confirms a match:
> >
> > $ [[ "acpi:QEMUVGID:VM_GEN_COUNTER:" == acpi*:VM_GEN_COUNTER:* ]] &&
> > echo matches
> > matches
> >
> > So I think with ACPI_ID_LEN --> 16 we are good to go.
> 
> 
> Is the size increase (mostly rodata I suppose? Anywhere else?) measurable?

On my test kernel, the size of vmlinux increases from 26918200 bytes to
26918200 bytes.

Wait, did I do that test right? I'll try again.

Yep, 26918200 -> 26918200, so it doesn't grow at all. I believe the
reason is mostly because of:

    #define ACPI_ID_LEN     16
    
    struct acpi_device_id {
      __u8 id[ACPI_ID_LEN];
      kernel_ulong_t driver_data;
      __u32 cls;
      __u32 cls_msk;
    };

Because of the padding, 9->16 doesn't actually change the way this
structure is allocated. Then, additional uses of ACPI_ID_LEN throughout
the tree are rather sparse or enclosed within other structures or
similar things.

In other words, code size seems like very much a non-issue. Also, it's
not as though MIPS has ACPI. We're talking about x86, Itanium, and
(sometimes, I guess) arm64.

Regards,
Jason

      reply	other threads:[~2022-02-25 21:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 15:55 [PATCH] ACPI: bus: Match first 9 bytes of device IDs Alexander Graf
2022-02-25 16:57 ` Jason A. Donenfeld
2022-02-25 17:09   ` Alexander Graf
2022-02-25 17:16     ` Jason A. Donenfeld
2022-02-25 17:13 ` Ard Biesheuvel
2022-02-25 17:21   ` Jason A. Donenfeld
2022-02-25 17:30     ` Ard Biesheuvel
2022-02-25 17:33       ` Jason A. Donenfeld
2022-02-25 18:03         ` Jason A. Donenfeld
2022-02-25 18:39           ` Jason A. Donenfeld
2022-02-25 19:06             ` Alexander Graf
2022-02-25 21:03               ` Jason A. Donenfeld [this message]

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=YhlEBUOeiP4jOIsf@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=dwmw@amazon.co.uk \
    --cc=graf@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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).