From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Pan Subject: Re: [PATCH v3 22/22] thermal/intel_powerclamp: Convert the kthread to kthread worker API Date: Mon, 11 Jan 2016 18:17:18 -0800 Message-ID: <20160111181718.0ace4a58@yairi> References: <1447853127-3461-1-git-send-email-pmladek@suse.com> <1447853127-3461-23-git-send-email-pmladek@suse.com> <20160107115531.34279a9b@icelake> <20160108164931.GT3178@pathway.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160108164931.GT3178@pathway.suse.cz> Sender: owner-linux-mm@kvack.org To: Petr Mladek Cc: Andrew Morton , Oleg Nesterov , Tejun Heo , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org, jacob.jun.pan@linux.intel.com List-Id: linux-api@vger.kernel.org On Fri, 8 Jan 2016 17:49:31 +0100 Petr Mladek wrote: > Is the __preempt_schedule() a problem? It allows to switch the process > when needed. I thought that it was safe because try_to_freeze() might > have slept as well. > not a problem. i originally thought queue_kthread_work() may add delay but it doesn't since there is no other work on this kthread. > > > - vulnerable to future changes of queuing work > > The question is if it is safe to sleep, freeze, or even migrate > the system between the works. It looks like because of the > try_to_freeze() and schedule_interrupt() calls in the original code. > > BTW: I wonder if the original code correctly handle freezing after > the schedule_timeout(). It does not call try_to_freeze() > there and the forced idle states might block freezing. > I think that the small overhead of kthread works is worth > solving such bugs. It makes it easier to maintain these > sleeping states. it is in a while loop, so try_to_freeze() gets called. Am I missing something? Thanks, Jacob -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org