linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Zhang <zhangwm@marvell.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] drivers: base: update cpu offline info when do hotplug
Date: Sun, 19 Oct 2014 23:39:23 -0700	[thread overview]
Message-ID: <9034CBD80F070943B59700D7F8149ED9024EB81CAF@SC-VEXCH4.marvell.com> (raw)
In-Reply-To: <20141020044340.GA9589@kroah.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2133 bytes --]

Greg,

-----Original Message-----
From: Greg KH [mailto:gregkh@linuxfoundation.org] 
Sent: 2014Äê10ÔÂ20ÈÕ 12:44
To: Neil Zhang
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: base: update cpu offline info when do hotplug

On Mon, Oct 20, 2014 at 11:29:08AM +0800, Neil Zhang wrote:
> The current per-cpu offline info won't be updated if it is hotplugged 
> in/out by a kernel governer.
> Let's update it via cpu notifier.
> 
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> ---
>  drivers/base/cpu.c |   25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 
> 006b1bc..9d61824 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -418,10 +418,35 @@ static void __init 
> cpu_dev_register_generic(void)  #endif  }
>  
> +static int device_hotplug_notifier(struct notifier_block *nfb,
> +				      unsigned long action, void *hcpu) {
> +	unsigned int cpu = (unsigned long)hcpu;
> +	struct device *dev = get_cpu_device(cpu);
> +	int ret;
> +
> +	switch (action & ~CPU_TASKS_FROZEN) {
> +	case CPU_ONLINE:
> +		dev->offline = false;
> +		ret = NOTIFY_OK;
> +		break;
> +	case CPU_DYING:
> +		dev->offline = true;
> +		ret = NOTIFY_OK;
> +		break;
> +	default:
> +		ret = NOTIFY_DONE;
> +		break;
> +	}
> +
> +	return ret;
> +}
> +
>  void __init cpu_dev_init(void)
>  {
>  	if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups))
>  		panic("Failed to register CPU subsystem");
>  
>  	cpu_dev_register_generic();
> +	cpu_notifier(device_hotplug_notifier, 0);
>  }

How much noise is this going to cause on a big/little system that constantly hot unplug/plugs processors all of the time?

Can you explain more what kind of noise will be introduced on a big/little system?
As I know IKS on arm will use cpu_suspend way to power down a core.
But I don't know well about other architectures.
Please give your suggestions.
Thanks!

greg k-h

Best Regards,
Neil Zhang
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-10-20  6:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20  3:29 [PATCH] drivers: base: update cpu offline info when do hotplug Neil Zhang
2014-10-20  4:43 ` Greg KH
2014-10-20  6:39   ` Neil Zhang [this message]
2014-10-20  6:48     ` Greg KH
2014-10-20  7:40       ` Neil Zhang
2014-10-20 17:02         ` Dan Streetman
2014-10-21  0:47           ` Neil Zhang
2014-10-21  2:57           ` Yasuaki Ishimatsu
2014-10-21  3:18             ` Neil Zhang
2014-10-21  3:26               ` Yasuaki Ishimatsu
2014-10-21  3:36                 ` Neil Zhang
2014-10-21  4:47                   ` Yasuaki Ishimatsu
2014-10-21 12:58             ` Dan Streetman
2014-10-27  1:43           ` Neil Zhang
2014-10-27  1:58             ` Greg KH
2014-10-27  2:17               ` Neil Zhang
2014-10-27  2:26                 ` Greg KH
2014-10-27  2:30                   ` Neil Zhang
2014-10-27 16:28                   ` Dan Streetman
2014-10-21 13:02 ` Dan Streetman
2014-10-22  1:32   ` Neil Zhang
2014-10-23 14:05   ` Dan Streetman

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=9034CBD80F070943B59700D7F8149ED9024EB81CAF@SC-VEXCH4.marvell.com \
    --to=zhangwm@marvell.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.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).