From: Eric DeVolder <eric.devolder@oracle.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, david@redhat.com,
osalvador@suse.de, corbet@lwn.net, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
x86@kernel.org, bhe@redhat.com, ebiederm@xmission.com,
kexec@lists.infradead.org, hpa@zytor.com, rafael@kernel.org,
vgoyal@redhat.com, dyoung@redhat.com, lf32.dev@gmail.com,
akpm@linux-foundation.org, naveen.n.rao@linux.vnet.ibm.com,
zohar@linux.ibm.com, bhelgaas@google.com, vbabka@suse.cz,
tiwai@suse.de, seanjc@google.com, linux@weissschuh.net,
vschneid@redhat.com, linux-mm@kvack.org,
linux-doc@vger.kernel.org, sourabhjain@linux.ibm.com,
konrad.wilk@oracle.com, boris.ostrovsky@oracle.com
Subject: Re: [PATCH v25 01/10] drivers/base: refactor cpu.c to use .is_visible()
Date: Thu, 3 Aug 2023 13:20:28 -0500 [thread overview]
Message-ID: <a6dd6e27-e8a7-09ac-f33d-03318dd5695c@oracle.com> (raw)
In-Reply-To: <6d2811f5-a5ee-a49d-012d-b519b2c6ee26@oracle.com>
On 7/21/23 11:32, Eric DeVolder wrote:
>
>
> On 7/3/23 11:53, Eric DeVolder wrote:
>>
>>
>> On 7/3/23 08:05, Greg KH wrote:
>>> On Thu, Jun 29, 2023 at 03:21:10PM -0400, Eric DeVolder wrote:
>>>> - the function body of the callback functions are now wrapped with
>>>> IS_ENABLED(); as the callback function must exist now that the
>>>> attribute is always compiled-in (though not necessarily visible).
>>>
>>> Why do you need to do this last thing? Is it a code savings goal? Or
>>> something else? The file will not be present in the system if the
>>> option is not enabled, so it should be safe to not do this unless you
>>> feel it's necessary for some reason?
>>
>> To accommodate the request, all DEVICE_ATTR() must be unconditionally present in this file. The
>> DEVICE_ATTR() requires the .show() callback. As the callback is referenced from a data structure,
>> the callback has to be present for link. All the callbacks for these attributes are in this file.
>>
>> I have two basic choices for gutting the function body if the config feature is not enabled. I can
>> either use #ifdef or IS_ENABLED(). Thomas has made it clear I need to use IS_ENABLED(). I can
>> certainly use #ifdef (which is what I did in v24).
>>
>>>
>>> Not doing this would make the diff easier to read :)
>>
>> I agree this is messy. I'm not really sure what this request/effort achieves as these attributes
>> are not strongly related (unlike cacheinfo) and the way the file was before results in less code.
>>
>> At any rate, please indicate if you'd rather I use #ifdef.
>> Thanks for your time!
>> eric
>>
>>>
>>> thanks,
>>>
>>> greg k-h
>
> Hi Greg,
> I was wondering if you might weigh-in so that I can proceed.
>
> I think there are three options on the table:
> - use #ifdef to comment out these function bodies, which keeps the diff much more readable
> - use IS_ENABLED() as Thomas has requested I do, but makes the diff more difficult to read
> - remove this refactor altogether, perhaps post-poning until after this crash hotplug series merges,
> as this refactor is largely unrelated to crash hotplug.
>
> Thank you for your time on this topic!
> eric
Hi Greg,
If you have an opinion on how to proceed, please provide.
Thanks,
eric
next prev parent reply other threads:[~2023-08-03 18:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 19:21 [PATCH v25 00/10] crash: Kernel handling of CPU and memory hot un/plug Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 01/10] drivers/base: refactor cpu.c to use .is_visible() Eric DeVolder
2023-07-03 13:05 ` Greg KH
2023-07-03 16:53 ` Eric DeVolder
2023-07-21 16:32 ` Eric DeVolder
2023-08-03 18:20 ` Eric DeVolder [this message]
2023-08-03 18:36 ` Greg KH
2023-06-29 19:21 ` [PATCH v25 02/10] drivers/base: refactor memory.c " Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 03/10] crash: move a few code bits to setup support of crash hotplug Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 04/10] crash: add generic infrastructure for crash hotplug support Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 05/10] kexec: exclude elfcorehdr from the segment digest Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 06/10] crash: memory and CPU hotplug sysfs attributes Eric DeVolder
2023-06-29 20:59 ` Randy Dunlap
2023-06-29 22:31 ` Eric DeVolder
2023-06-29 23:20 ` Randy Dunlap
2023-07-03 13:07 ` Greg KH
2023-07-03 16:57 ` Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 07/10] x86/crash: add x86 crash hotplug support Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 08/10] crash: hotplug support for kexec_load() Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 09/10] crash: change crash_prepare_elf64_headers() to for_each_possible_cpu() Eric DeVolder
2023-06-29 19:21 ` [PATCH v25 10/10] x86/crash: optimize CPU changes Eric DeVolder
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=a6dd6e27-e8a7-09ac-f33d-03318dd5695c@oracle.com \
--to=eric.devolder@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=bhelgaas@google.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=konrad.wilk@oracle.com \
--cc=lf32.dev@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@weissschuh.net \
--cc=mingo@redhat.com \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=osalvador@suse.de \
--cc=rafael@kernel.org \
--cc=seanjc@google.com \
--cc=sourabhjain@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tiwai@suse.de \
--cc=vbabka@suse.cz \
--cc=vgoyal@redhat.com \
--cc=vschneid@redhat.com \
--cc=x86@kernel.org \
--cc=zohar@linux.ibm.com \
/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).