From: "H. Peter Anvin" <hpa@zytor.com>
To: Shannon Nelson <shannon.nelson@intel.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
chris.leech@gmail.com, ak@suse.de, tony.luck@intel.com
Subject: Re: [PATCH -mm] IOAT: fix for UP use of cpu_physical_id()
Date: Mon, 20 Aug 2007 15:26:59 -0700 [thread overview]
Message-ID: <46CA1533.2040200@zytor.com> (raw)
In-Reply-To: <20070820202908.14306.31248.stgit@localhost.localdomain>
Shannon Nelson wrote:
> Make sure we can use cpu_physical_id() even when compiled for
> uni-processor.
>
> diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
> index c3a500b..b1af49c 100644
> --- a/drivers/dma/ioat_dca.c
> +++ b/drivers/dma/ioat_dca.c
> @@ -25,6 +25,14 @@
> #include <linux/smp.h>
> #include <linux/interrupt.h>
> #include <linux/dca.h>
> +
> +// either a kernel change is needed, or we need something like this in kernel
> +#ifndef CONFIG_SMP
> +#include <asm/smp.h>
> +#undef cpu_physical_id
> +#define cpu_physical_id(cpu) (cpuid_ebx(1) >> 24)
> +#endif
> +
This value should probably be cached. Executing cpuid to get a static
value seems like a bad idea.
-hpa
next prev parent reply other threads:[~2007-08-20 22:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-20 20:29 [PATCH -mm] IOAT: fix for UP use of cpu_physical_id() Shannon Nelson
2007-08-20 22:26 ` H. Peter Anvin [this message]
2007-08-20 23:21 ` Nelson, Shannon
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=46CA1533.2040200@zytor.com \
--to=hpa@zytor.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=chris.leech@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shannon.nelson@intel.com \
--cc=tony.luck@intel.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