Re: [RESEND PATCH v7 1/1] PCI/sysfs: Expose PCIe device serial number
From: Krzysztof Wilczyński
Date: Wed Sep 17 2025 - 08:23:06 EST
Hi Thomas,
> > > It's a waste of resources to provide a handle just to say the capability
> > > doesn't exist when the handle could just not exist instead.
> >
> > I haven't checked how the kernfs side looks like, admittedly, but I think
> > whether an attribute is visible or not, it does not unload and/or de-allocate
> > any space for the accompanying kernfs object... So, the resources saving
> > here might not be in any way significant.
>
> If I read the sysfs code correctly (create_files() in fs/sysfs/group.c),
> the kernfs node should not even be allocated for invisible files.
Good to know! I wasn't sure and did look... I stand corrected now.
Thank you for taking the time to check this. Much appreciated. :)
Thank you!
Krzysztof