linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Li kunyu <kunyu@nfschina.com>,
	chenhuacai@kernel.org, rafael@kernel.org, len.brown@intel.com,
	pavel@ucw.cz, mingo@redhat.com, bp@alien8.de
Cc: tglx@linutronix.de, dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com, linux-ia64@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] x86: Change the return type of acpi_map_cpu2node to void
Date: Fri, 10 Jun 2022 05:35:29 -0700	[thread overview]
Message-ID: <7eb4762e-723b-51e8-3d70-1c28568ac4f5@intel.com> (raw)
In-Reply-To: <20220610104423.201739-1-kunyu@nfschina.com>

On 6/10/22 03:44, Li kunyu wrote:
> Reduce eax register calls by removing unused return values.

Please stop sending these patches, at least with these repetitive,
inaccurate descriptions.

This patch has *ZERO* to do with EAX.  For one, it's patching two
architectures that might not even have an EAX.  (I'm blissfully unaware
of what the ia64 calling conventions are and I want to keep it that way.)

Second, (and this is important), look carefully at the function in question:

static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)

See the "static"?  That tells the compiler that acpi_map_cpu2node() is
only used locally.  It lets the compiler do all kinds of fancy things,
like inline the function which allows the compiler to do all kinds of
fun optimizations.  Now, armed with that knowledge, please take a look
at what effect your patch has in practice.

Take your patch, and disassemble acpi_map_cpu() before and after
applying it.  First of all, even before your patch, do you see a:

	call ffffffff81d0000d <acpi_map_cpu2node>

?

Do you see a call to numa_set_node()?  That's odd considering that
acpi_map_cpu() doesn't directly call numa_set_node().  Right?  Do you
see unnecessary manipulation of EAX?  Now, apply your patch.
Disassemble the function again.  What changed?

Now, armed with the knowledge of what your patch actually does to the
code, would you like to try and write a better changelog?  Or, better
yet, maybe it will dissuade you from sending this again.

  reply	other threads:[~2022-06-10 12:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 10:44 [PATCH] x86: Change the return type of acpi_map_cpu2node to void Li kunyu
2022-06-10 12:35 ` Dave Hansen [this message]
2022-06-10 14:21   ` Peter Zijlstra
2022-06-10 15:17   ` Li kunyu
  -- strict thread matches above, loose matches on Subject: below --
2022-06-10 10:43 Li kunyu
2022-06-10 10:36 Li kunyu

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=7eb4762e-723b-51e8-3d70-1c28568ac4f5@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kunyu@nfschina.com \
    --cc=len.brown@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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).