All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC 2/4] timer: don't migrate pinned timers
Date: Mon, 31 Mar 2014 08:56:26 -0700	[thread overview]
Message-ID: <7htxae5plh.fsf@paris.lan> (raw)
In-Reply-To: <3fa0ea3a19a51ae2797a25e281763451ad8d2844.1395322529.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> (Viresh Kumar's message of "Thu, 20 Mar 2014 19:18:59 +0530")

Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes:

> migrate_timer() is called when a CPU goes down and its timers are required to be
> migrated to some other CPU. Its the responsibility of the users of the timer to
> remove it before control reaches to migrate_timers().
>
> As these were the pinned timers, the best we can do is: don't migrate these and
> report to the user as well.
>
> That's all this patch does.
>
> Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  kernel/timer.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/kernel/timer.c b/kernel/timer.c
> index fec4ab4..a7f8b99 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -1606,11 +1606,22 @@ static int init_timers_cpu(int cpu)
>  static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head)
>  {
>  	struct timer_list *timer;
> +	int is_pinned;
>  
>  	while (!list_empty(head)) {
>  		timer = list_first_entry(head, struct timer_list, entry);
>  		/* We ignore the accounting on the dying cpu */
>  		detach_timer(timer, false);
> +
> +		is_pinned = tbase_get_pinned(timer->base);
> +
> +		/* Check if CPU still has pinned timers */
> +		if (is_pinned) {
> +			pr_warn("%s: can't migrate pinned timer: %p, removing it\n",
> +					__func__, timer);

printk message will be confusing: removing it from what? 

Kevin


> +			continue;
> +		}
> +
>  		timer_set_base(timer, new_base);
>  		internal_add_timer(new_base, timer);
>  	}

WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: tglx@linutronix.de, fweisbec@gmail.com, peterz@infradead.org,
	mingo@kernel.org, tj@kernel.org, lizefan@huawei.com,
	linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org
Subject: Re: [RFC 2/4] timer: don't migrate pinned timers
Date: Mon, 31 Mar 2014 08:56:26 -0700	[thread overview]
Message-ID: <7htxae5plh.fsf@paris.lan> (raw)
In-Reply-To: <3fa0ea3a19a51ae2797a25e281763451ad8d2844.1395322529.git.viresh.kumar@linaro.org> (Viresh Kumar's message of "Thu, 20 Mar 2014 19:18:59 +0530")

Viresh Kumar <viresh.kumar@linaro.org> writes:

> migrate_timer() is called when a CPU goes down and its timers are required to be
> migrated to some other CPU. Its the responsibility of the users of the timer to
> remove it before control reaches to migrate_timers().
>
> As these were the pinned timers, the best we can do is: don't migrate these and
> report to the user as well.
>
> That's all this patch does.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  kernel/timer.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/kernel/timer.c b/kernel/timer.c
> index fec4ab4..a7f8b99 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -1606,11 +1606,22 @@ static int init_timers_cpu(int cpu)
>  static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head)
>  {
>  	struct timer_list *timer;
> +	int is_pinned;
>  
>  	while (!list_empty(head)) {
>  		timer = list_first_entry(head, struct timer_list, entry);
>  		/* We ignore the accounting on the dying cpu */
>  		detach_timer(timer, false);
> +
> +		is_pinned = tbase_get_pinned(timer->base);
> +
> +		/* Check if CPU still has pinned timers */
> +		if (is_pinned) {
> +			pr_warn("%s: can't migrate pinned timer: %p, removing it\n",
> +					__func__, timer);

printk message will be confusing: removing it from what? 

Kevin


> +			continue;
> +		}
> +
>  		timer_set_base(timer, new_base);
>  		internal_add_timer(new_base, timer);
>  	}

  parent reply	other threads:[~2014-03-31 15:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20 13:48 [RFC 0/4] Migrate timers away from cpuset on setting cpuset.quiesce Viresh Kumar
2014-03-20 13:48 ` Viresh Kumar
2014-03-20 13:48 ` [RFC 1/4] timer: track pinned timers with TIMER_PINNED flag Viresh Kumar
2014-03-20 13:48 ` [RFC 2/4] timer: don't migrate pinned timers Viresh Kumar
     [not found]   ` <3fa0ea3a19a51ae2797a25e281763451ad8d2844.1395322529.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-03-31 15:56     ` Kevin Hilman [this message]
2014-03-31 15:56       ` Kevin Hilman
     [not found]       ` <7htxae5plh.fsf-4poPxKt068f/PtFMR13I2A@public.gmane.org>
2014-04-01  4:32         ` Viresh Kumar
2014-04-01  4:32           ` Viresh Kumar
     [not found]           ` <CAKohpokYfdY+40kmhgrC6Yr9vfv4GtAW2Ph3+=57YbfmJsnU9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-04 15:15             ` Kevin Hilman
2014-04-04 15:15               ` Kevin Hilman
2014-03-20 13:49 ` [RFC 3/4] timer: create timer_quiesce_cpu() for cpusets.quiesce option Viresh Kumar
2014-03-20 13:49 ` [RFC 4/4] cpuset: Add " Viresh Kumar
     [not found]   ` <e643acf71086db239254d44c77d4966b2a4a01e5.1395322529.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-03-27  2:47     ` Li Zefan
2014-03-27  2:47       ` Li Zefan
     [not found]       ` <53339153.70708-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-03-27  4:29         ` Viresh Kumar
2014-03-27  4:29           ` Viresh Kumar
     [not found] ` <cover.1395322529.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-04-24  7:25   ` [RFC 0/4] Migrate timers away from cpuset on setting cpuset.quiesce Daniel Sangorrin
2014-04-24  7:25     ` Daniel Sangorrin
     [not found]     ` <201404240725.s3O7PrUv003720-g3qfMnKXm6lL9jVzuh4AOg@public.gmane.org>
2014-04-24  7:43       ` Viresh Kumar
2014-04-24  7:43         ` Viresh Kumar
     [not found]         ` <CAKohpokt-O3BAGMzE_=heVBZQOwp0C7eT8ZA2485DgNi3+Xcqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-24  8:31           ` Daniel Sangorrin
2014-04-24  8:31             ` Daniel Sangorrin
     [not found]             ` <201404240832.s3O8WHd0011014-g3qfMnKXm6lL9jVzuh4AOg@public.gmane.org>
2014-04-24  8:41               ` Viresh Kumar
2014-04-24  8:41                 ` Viresh Kumar
2014-04-24  9:24                 ` Daniel Sangorrin
2014-04-24  9:30                   ` Viresh Kumar
     [not found]                     ` <CAKohponA4-cm2_FB=8R8aVEWNhtUfOUebcfzn7W+XR0zKHCtxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-25  0:31                       ` Daniel Sangorrin
2014-04-25  0:31                         ` Daniel Sangorrin
     [not found]                         ` <201404250031.s3P0V2DY022219-g3qfMnKXm6lL9jVzuh4AOg@public.gmane.org>
2014-04-25  4:51                           ` Viresh Kumar
2014-04-25  4:51                             ` Viresh Kumar
     [not found]                             ` <CAKohpomQH01gCeUfqFFeHVNX7N7CSyo7zdj3LGBv9=U=cE46EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-25  5:21                               ` Daniel Sangorrin
2014-04-25  5:21                                 ` Daniel Sangorrin

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=7htxae5plh.fsf@paris.lan \
    --to=khilman-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.