From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753494AbcEPJqm (ORCPT ); Mon, 16 May 2016 05:46:42 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37830 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753326AbcEPJql (ORCPT ); Mon, 16 May 2016 05:46:41 -0400 Date: Mon, 16 May 2016 10:46:38 +0100 From: Matt Fleming To: Yuyang Du Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Byungchul Park , Frederic Weisbecker , Luca Abeni , "Rafael J . Wysocki" , Rik van Riel , Thomas Gleixner , Wanpeng Li , Mel Gorman , Mike Galbraith Subject: Re: [RFC][PATCH 5/5] sched/core: Add debug code to catch missing update_rq_clock() Message-ID: <20160516094638.GB6574@codeblueprint.co.uk> References: <1463082593-27777-1-git-send-email-matt@codeblueprint.co.uk> <1463082593-27777-6-git-send-email-matt@codeblueprint.co.uk> <20160515021439.GC8790@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160515021439.GC8790@intel.com> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 15 May, at 10:14:39AM, Yuyang Du wrote: > Hi Matt, > > Thanks for Ccing me. > > I am indeed interested, because I recently encountered an rq clock > issue, which is that the clock jumps about 200ms when I was > experimenting the "flat util hierarchy" patches, which really annoyed > me, and I had to stop to figure out what is wrong (but haven't yet > figured out ;)) > > First, this patchset does not solve my problem, but never mind, by > reviewing your patches, I have some comments: Thanks for the review. One gap that this patch series doesn't address is that some callers of update_rq_clock() do not pin rq->lock, which makes the diagnostic checks useless in that case. I plan on handling that next, but I wanted to get this series out as soon as possible for review. > On Thu, May 12, 2016 at 08:49:53PM +0100, Matt Fleming wrote: > > > > - rq->clock_skip_update = 0; > > + /* Clear ACT, preserve everything else */ > > + rq->clock_update_flags ^= RQCF_ACT_SKIP; > > The comment says "Clear ACT", but this is really xor, and I am not sure > this is even what you want. Urgh, you're right. I'm not sure what I was thinking when I wrote that. > In addition, would it be simpler to do this? > > update_rq_clock() > if (flags & RQCF_ACT_SKIP) > flags <<= 1; /* effective skip is an update */ > return; > > flags = RQCF_UPDATED; No because if someone calls rq_clock() immediately after __schedule(), or even immediately after we clear RQCF_ACT_SKIP in __schedule(), we should trigger a warning since the clock has not actually been updated.