All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	maninder1.s@samsung.com, tglx@linutronix.de,
	Yogesh Narayan Gaur <yn.gaur@samsung.com>,
	AJEET YADAV <ajeet.y@samsung.com>, Tejun Heo <tj@kernel.org>
Subject: Re: restart_syscall: use freezable blocking call
Date: Thu, 02 Apr 2015 12:03:08 -0400	[thread overview]
Message-ID: <551D683C.2050601@oracle.com> (raw)
In-Reply-To: <20150331150730.GJ23123@twins.programming.kicks-ass.net>

On 03/31/2015 11:07 AM, Peter Zijlstra wrote:
>>> @@ -1781,7 +1781,7 @@ schedule_hrtimeout_range_clock(ktime_t *
>>> > >  		t.task = NULL;
>>> > >  
>>> > >  	if (likely(t.task))
>>> > > -		schedule();
>>> > > +		freezable_schedule();
>>> > >  
>>> > >  	hrtimer_cancel(&t.timer);
>>> > >  	destroy_hrtimer_on_stack(&t.timer);
> Not a single word on why this would be correct. At the very least show
> us you've thought about it.

It's not correct.

[    0.634248] =====================================
[    0.635011] [ BUG: swapper/0/1 still has locks held! ]
[    0.635566] 4.0.0-rc6-next-20150402-sasha-00038-g3637da5 #2121 Not tainted
[    0.636009] -------------------------------------
[    0.636508] 2 locks held by swapper/0/1:
[    0.637008] #0: (cpu_hotplug.lock){.+.+.+}, at: get_online_cpus (kernel/cpu.c:96)
[    0.638009] #1: (smpboot_threads_lock){+.+.+.}, at: smpboot_register_percpu_thread (kernel/smpboot.c:286)
[    0.639013] Mutex: counter: 0 owner: swapper/0
[    0.640010]
[    0.640010] stack backtrace:
[    0.640543] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.0.0-rc6-next-20150402-sasha-00038-g3637da5 #2121
[    0.641012]  ffff8809e2748000 00000000d284eea5 ffff88004e8df948 ffffffff9dabb4a2
[    0.642622]  0000000000000000 ffff8809e2748000 ffff88004e8df968 ffffffff932e848d
[    0.643627]  ffff88004e8df9a8 ffff88004e8dfa48 ffff88004e8dfa78 ffffffff9db2e57c
[    0.644624] Call Trace:
[    0.645021] dump_stack (lib/dump_stack.c:52)
[    0.645644] debug_check_no_locks_held (kernel/locking/lockdep.c:4178)
[    0.646019] schedule_hrtimeout_range_clock (include/linux/freezer.h:56 include/linux/freezer.h:66 include/linux/freezer.h:127 include/linux/freezer.h:172 kernel/time/hrtimer.c:1784)
[    0.647017] ? hrtimer_nanosleep_restart (kernel/time/hrtimer.c:1754)
[    0.648015] ? get_lock_stats (kernel/locking/lockdep.c:249)
[    0.648702] ? hrtimer_get_res (kernel/time/hrtimer.c:1472)
[    0.649016] ? schedule_hrtimeout_range_clock (kernel/time/hrtimer.c:1780)
[    0.650020] ? __this_cpu_preempt_check (lib/smp_processor_id.c:63)
[    0.651016] schedule_hrtimeout (kernel/time/hrtimer.c:1856)
[    0.652015] wait_task_inactive (kernel/sched/core.c:1260 (discriminator 1))
[    0.652656] ? migrate_swap (kernel/sched/core.c:1184)
[    0.653015] ? out_of_line_wait_on_atomic_t (kernel/sched/completion.c:121)
[    0.654016] ? wake_up_state (kernel/sched/core.c:2973)
[    0.654614] __kthread_bind (kernel/kthread.c:331)
[    0.655015] __kthread_unpark (kernel/kthread.c:394)
[    0.655622] kthread_unpark (kernel/kthread.c:413)
[    0.656014] ? ftrace_define_fields_softirq (kernel/softirq.c:755)
[    0.657014] smpboot_unpark_thread.isra.0 (kernel/smpboot.c:227)
[    0.657725] smpboot_register_percpu_thread (kernel/smpboot.c:286)
[    0.658013] ? ftrace_define_fields_softirq (kernel/softirq.c:755)
[    0.659015] ? ftrace_define_fields_softirq (kernel/softirq.c:755)
[    0.660013] spawn_ksoftirqd (kernel/softirq.c:758)
[    0.660609] do_one_initcall (init/main.c:787)
[    0.661014] ? try_to_run_init_process (init/main.c:776)
[    0.662017] ? print_cpu_info (arch/x86/kernel/cpu/common.c:1140 arch/x86/kernel/cpu/common.c:1135)
[    0.662638] ? native_smp_prepare_cpus (arch/x86/kernel/smpboot.c:1167)
[    0.663016] kernel_init_freeable (init/main.c:888 init/main.c:994)
[    0.664014] ? start_kernel (init/main.c:972)
[    0.664619] ? finish_task_switch (include/linux/tick.h:125 kernel/sched/core.c:2248)
[    0.665013] ? finish_task_switch (kernel/sched/sched.h:1077 kernel/sched/core.c:2230)
[    0.666019] ? rest_init (init/main.c:927)
[    0.666597] kernel_init (init/main.c:932)
[    0.667015] ? rest_init (init/main.c:927)
[    0.667593] ret_from_fork (arch/x86/kernel/entry_64.S:535)
[    0.668014] ? rest_init (init/main.c:927)


Thanks,
Sasha

  reply	other threads:[~2015-04-02 16:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 11:07 restart_syscall: use freezable blocking call Maninder Singh
2015-03-30 22:43 ` Andrew Morton
2015-03-30 23:39   ` Rafael J. Wysocki
2015-03-31 15:07     ` Peter Zijlstra
2015-04-02 16:03       ` Sasha Levin [this message]
2015-04-02 17:25         ` Peter Zijlstra
2015-04-02 17:34           ` Tejun Heo

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=551D683C.2050601@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=ajeet.y@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=yn.gaur@samsung.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 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.