Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp654013imm; Wed, 15 Aug 2018 03:55:41 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzhxwPr+tgpHnyyjrHMARsiWNx8GySPWjwoG5bBgvDFgmQM7+hzOj78OjZQwBnajrj64rqg X-Received: by 2002:a63:d5b:: with SMTP id 27-v6mr24232664pgn.107.1534330540965; Wed, 15 Aug 2018 03:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534330540; cv=none; d=google.com; s=arc-20160816; b=B7gdNewbdyoBkSNQ0jv8AOsHot/J4hE/JHqOJa56no9yLdY0UVLJbIXZpBChQvaEQf vBrbdT4Rde39tuE/6Zfc/q3AMR9k/RdM1sBaRDUreNgKa7EGCDhlx+YM1tTQmmMxT6bh dubEa9R3ewO+lJ+U3RlqoVmLYDLsIo6Vhm8eQ+GAKN6gGxOrlqSQx+7/GLGbGlnOgM/n tUlg0NCILLv6sfH0wlwV/Y93+HykklOjlAZ6uv6zTKOBcjPtEVYT9h+mbWpjJGMBSUYn LyR2Hf4jtNbTkJ9sSZFbT6hHo0t8NhONgoEWc+WF9T1vO+zAbK1ixdDSm6d+CB5gsMBT i86w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ndduLdFgSgh5vw4/IlzXHmik/jUQwkAaszyuUiZRvho=; b=t8Q3yJ5LFTpH9QABGhb3WWb9xNDB/zxzE59PTbykAWKgZ04DMHc7TFOa/y7lRxdyQJ TAzqFAu0K20A5Ub3W/OsV6Og4AHA4I5C7QJUGACA6UqJLlpbnl79FHW/L5dzWKzbhQVy 3RsTVeyf9i7m9BpGVDBeDrYQMCzcbxBPqx53HAv9OiwVgW+iWXN7GA55DuxfJ1LOefW6 7bgeM4blEkrygbFGzpryvyb8HQU8BlcbU9J/t3mX8xKc1lNs3ehyvTc4HESWvpc002KG Af9bhEYPeq07LO803kh5yWYvUtFXd5oJmoP9Qj3gJuHUuCeFmGgxuX/M914ByBUj5jIC kYOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3-v6si22432416pgk.610.2018.08.15.03.55.25; Wed, 15 Aug 2018 03:55:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729165AbeHONqS (ORCPT + 99 others); Wed, 15 Aug 2018 09:46:18 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54044 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbeHONqS (ORCPT ); Wed, 15 Aug 2018 09:46:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 190AB18A; Wed, 15 Aug 2018 03:54:37 -0700 (PDT) Received: from e110439-lin (e110439-lin.emea.arm.com [10.4.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DBD93F5BC; Wed, 15 Aug 2018 03:54:34 -0700 (PDT) Date: Wed, 15 Aug 2018 11:54:28 +0100 From: Patrick Bellasi To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v3 03/14] sched/core: uclamp: add CPU's clamp groups accounting Message-ID: <20180815105428.GA7388@e110439-lin> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-4-patrick.bellasi@arm.com> <20180814164905.GG2605@e110439-lin> <7c45c1a8-24cb-6798-5b6f-3b5dfc9b490d@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c45c1a8-24cb-6798-5b6f-3b5dfc9b490d@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15-Aug 11:37, Dietmar Eggemann wrote: > On 08/14/2018 06:49 PM, Patrick Bellasi wrote: > >Hi Dietmar! > > > >On 14-Aug 17:44, Dietmar Eggemann wrote: > >>On 08/06/2018 06:39 PM, Patrick Bellasi wrote: > > [...] > > >>This one indicates that there are some holes in your ref-counting. > > > >Not really, this has been added not because I've detected a refcount > >issue... but because it was suggested as a possible safety check in a > >previous code review comment: > > > > https://lore.kernel.org/lkml/20180720151156.GA31421@e110439-lin/ > > > >>It's probably easier to debug that there is still a task but the > >>uc_grp[group_id].tasks value == 0 (A). I assume the other problem exists as > >>well, i.e. last task and uc_grp[group_id].tasks > 1 (B)? > >> > >>You have uclamp_cpu_[get/put](_id)() in [enqueue/dequeue]_task. > >> > >>Patch 04/14 introduces its use in uclamp_task_update_active(). > >> > >>Do you know why (A) (and (B)) are happening? > > > >I've never saw that warning in my tests so far so, again, the warning > >is there just to support testing/debugging when refcounting code > >is/will be touched in the future. That's also the reason why is > >SCHED_DEBUG protected. > > Ah, OK, I thought you really see it more often and that it also relate to > Pavan's comment on 02/14 about the missing treatment of exiting tasks. > > If this is only for testing/debugging, I would suggest a simple one line > BUG_ON() These are (eventually) considered as recoverable errors... thus, AFAIK, using BUG_ON is overkilling and discouraged: https://elixir.bootlin.com/linux/latest/source/include/asm-generic/bug.h#L42 > You find CONFIG_SCHED_DEBUG=y in production kernels as well. AFAIK, that setting is discouraged for production kernels... Moreover, it's still better to WARN sometimes on a production kernel the crash the device, isnt't it? -- #include Patrick Bellasi