public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Shu Wang <shuwang@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>, Guenter Roeck <linux@roeck-us.net>
Cc: fenghua yu <fenghua.yu@intel.com>,
	jdelvare@suse.com, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org, chuhu@redhat.com,
	yizhan@redhat.com
Subject: Re: [PATCH] hwmon: (coretemp) remove duplicated coretemp for same core id
Date: Thu, 19 Oct 2017 06:10:08 -0400 (EDT)	[thread overview]
Message-ID: <1903571460.17610295.1508407808892.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1710190953070.1971@nanos>

> From: "Thomas Gleixner" <tglx@linutronix.de>
> To: "Guenter Roeck" <linux@roeck-us.net>
> Cc: "Shu Wang" <shuwang@redhat.com>, "fenghua yu" <fenghua.yu@intel.com>, jdelvare@suse.com,
> linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, chuhu@redhat.com, yizhan@redhat.com
> Sent: Thursday, October 19, 2017 4:02:50 PM
> Subject: Re: [PATCH] hwmon: (coretemp) remove duplicated coretemp for same core id
> 
> On Wed, 18 Oct 2017, Guenter Roeck wrote:
> > On 10/18/2017 07:28 PM, Shu Wang wrote:
> 
> > > > > > > Fix kernel warning on my 4cpus 2core_id system. The cpu0 and cpu1
> > > > > > > have same core_id 0, so both cpu0 and cpu1 will try to create
> > > > > > > file
> > > > > > > temp2_label when it's online.
> > > > > > > 
> > > > > > 
> > > > > > > - coretemp_cpu_online(cpu=0)
> > > > > > >     - create_core_data(cpu=0, attr_no=2)
> > > > > > >      - create_core_attrs(attr_no=2)
> > > > > > > - coretemp_cpu_online(cpu=1)
> > > > > > >     - create_core_data(cpu=1, attr_no=2)
> > > > > > >      - create_core_attrs(attr_no=2)
> > > > > > > 
> > > > > > > $ grep -e processor -e 'core id' /proc/cpuinfo
> > > > > > > processor       : 0
> > > > > > > core id         : 0
> > > > > > > processor       : 1
> > > > > > > core id         : 0
> > > > > > > processor       : 2
> > > > > > > core id         : 1
> > > > > > > processor       : 3
> > > > > > > core id         : 1
> > > > > > 
> > > > > > Complete output of /proc/cpuinfo might be helpful.
> > > > > 
> > > > > $ cat /proc/cpuinfo
> > > > > processor	: 0
> > > > > vendor_id	: GenuineIntel
> > > > > cpu family	: 6
> > > > > model		: 61
> > > > > model name	: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
> > > > 
> > > > This is a hyperthreading CPU, which should already be handled,
> > > 
> > > Do you mean that for my system, coretemp_cpu_online should only
> > > be called twice instead of four times to create two core attrs?
> > > 
> > 
> > coretemp_add_core() should only be called twice, and cpumask_intersects()
> > should filter out the duplicate ones.
> > 
> >         /*
> >          * Check whether a thread sibling is already online. If not add the
> >          * interface for this CPU core.
> >          */
> >         if (!cpumask_intersects(&pdata->cpumask,
> > topology_sibling_cpumask(cpu)))
> >                 coretemp_add_core(pdev, cpu, 0);
> > 
> > Thomas, is it possible that something is wrong with this code ?

Sorry, I got the root cause, not coretemp's problem. I enabled numa=fake=2
cmdline param to simulate 2 nodes on my systems. 2 threads of the a same core
happened to be on different node, so they are not siblings.
  
Thanks for you reply

> 
> Hrmm. Not that I can see. The only thing I can think of is that the logical
> package association of the CPUs is screwed.
> 
> Debug patch below.
> 
> Thanks,

      reply	other threads:[~2017-10-19 10:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  8:44 [PATCH] hwmon: (coretemp) remove duplicated coretemp for same core id shuwang
2017-10-17 15:25 ` Guenter Roeck
2017-10-18  3:21   ` Shu Wang
2017-10-18 13:14     ` Guenter Roeck
2017-10-19  2:28       ` Shu Wang
2017-10-19  5:25         ` Guenter Roeck
2017-10-19  8:02           ` Thomas Gleixner
2017-10-19 10:10             ` Shu Wang [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=1903571460.17610295.1508407808892.JavaMail.zimbra@redhat.com \
    --to=shuwang@redhat.com \
    --cc=chuhu@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=tglx@linutronix.de \
    --cc=yizhan@redhat.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