Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbbLQBZC (ORCPT ); Wed, 16 Dec 2015 20:25:02 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34721 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766AbbLQBY7 (ORCPT ); Wed, 16 Dec 2015 20:24:59 -0500 Subject: Re: [RFCv6 PATCH 03/10] sched: scheduler-driven cpu frequency selection To: Leo Yan References: <1449641971-20827-1-git-send-email-smuckle@linaro.org> <1449641971-20827-4-git-send-email-smuckle@linaro.org> <20151216034825.GA11303@leoy-linaro> Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Michael Turquette , Ricky Liang From: Steve Muckle X-Enigmail-Draft-Status: N1110 Message-ID: <56720EE8.1090507@linaro.org> Date: Wed, 16 Dec 2015 17:24:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151216034825.GA11303@leoy-linaro> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 967 Lines: 23 Hi Leo, On 12/15/2015 07:48 PM, Leo Yan wrote: > I also think "set_current_state(TASK_INTERRUPTIBLE)" will introduce > logic error when software flow run into "else" block. The reason is > after you set state with TASK_INTERRUPTIBLE, if there have some > scheduling happen within cpufreq_sched_try_driver_target(), then the > thread will be remove from rq. But generally we suppose the thread > will be on rq and can continue run after next tick. > > Juri's suggestion can fix this issue. And we can use atomic_t to > safely accessing gd->requested_freq. I agree, it's incorrect. As I replied earlier I believe setting the task state back to TASK_RUNNING at the top of the else block is the easiest fix. thanks, Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/