Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp976451ybl; Fri, 16 Aug 2019 07:04:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6B8wJv3hnRHz6R0AyeiIy6IMXjkGYgkG5+mS1IHvss6CfEvxlpn5oN+MWhuqSfMlFGEqD X-Received: by 2002:a17:902:246:: with SMTP id 64mr4299558plc.112.1565964248210; Fri, 16 Aug 2019 07:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565964248; cv=none; d=google.com; s=arc-20160816; b=ACIvVFrODO7b5jkWl9LXEH5SFK5vaaOlNzASlkpXUhbAIB5WCW0PfFVQMmARk3bHGv EBbciwfl9qaYIHSi2KH2dTM8LeLCJM0MXq66DoccrUOw8jqGRzIvf+3PN0//jk+jw1Yn pEEsneTt6XyvAHny9RcVfq31pxZzZx4CpV09LQ+VWvVFKt2wnofJSWlEPK2nEHJQ7Otj 8auNdkQHEpr6mXN4e0owxl7vnTtZurrlp2mE9mD4dLaFBYfHArxqdqy/obx/3S3LbnPk jp/71EumeZ1xvdO7+VhDeCyOqIjxb0wYz31zcpkU6HEA4uY9HsiFMnfgsoyDzYRgFoLU 1KzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=i/0ep7xWPm6CGApC7aBqYVbAr6Zkt3iVQfuyd+rbRj4=; b=1FcRHz4OOviTgCPqypI6ZL9tUmIjUJYVgL6CmGUnnGS3c/0k0NHFXRLWKKn6BIiTob G91m4zBI/zVEg/HeqyzWP8xoGbgesHUFcT7G2/KB+QX/z+VUs2hT7CR40red5Vte1f9o kEaYuALMJS2iFHQi2/MD6K8ZdoFBEQWrQ2SVp5c0du/SoxW5qaWhI/Zfe6LLURIEc7K9 /6s9jTry6MmOZv5HPELpS3a6q8faBqRpOwgZBf1rVNNKVe9n/SeV+ryXAo+Zr1XkyQHV GS0jgTuTHYmzU5zL5BG/FH9FKd89c9zP+XzNTZ+XZoBlY4nbrKMPJ9VGFs22/Ma/VQpA 2EFg== 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 q92si3101882pjh.84.2019.08.16.07.03.47; Fri, 16 Aug 2019 07:04:08 -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 S1727299AbfHPOCI (ORCPT + 99 others); Fri, 16 Aug 2019 10:02:08 -0400 Received: from foss.arm.com ([217.140.110.172]:57462 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727217AbfHPOCH (ORCPT ); Fri, 16 Aug 2019 10:02:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0769C344; Fri, 16 Aug 2019 07:02:07 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ABD583F694; Fri, 16 Aug 2019 07:02:05 -0700 (PDT) Subject: Re: [PATCH] sched/fair: don't assign runtime for throttled cfs_rq To: Liangyan Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, shanpeic@linux.alibaba.com, xlpang@linux.alibaba.com, pjt@google.com References: <20190814180021.165389-1-liangyan.peng@linux.alibaba.com> <2994a6ee-9238-5285-3227-cb7084a834c8@arm.com> <7C1833A8-27A4-4755-9B1E-335C20207A66@linux.alibaba.com> From: Valentin Schneider Message-ID: <39d1affb-9cfa-208d-8bf4-f4c802e8c7f9@arm.com> Date: Fri, 16 Aug 2019 15:02:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <7C1833A8-27A4-4755-9B1E-335C20207A66@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/08/2019 08:08, Liangyan wrote: > Please check below dmesg log with “WARN_ON(cfs_rq->runtime_remaining > 0)”. If apply my patch, the warning is gone. Append the reproducing case in the end. > [...] Huh, thanks for the log & the reproducer. I'm still struggling to understand how we could hit the condition you're adding, since account_cfs_rq_runtime() shouldn't be called for throttled cfs_rqs (which I guess is the bug). Also, if the cfs_rq is throttled, shouldn't we prevent any further decrement of its ->runtime_remaining ? I had a look at the callers of account_cfs_rq_runtime(): - update_curr(). Seems safe, but has a cfs_rq->curr check at the top. This won't catch throttled cfs_rq's because AFAICT their curr pointer isn't NULL'd on throttle. - check_enqueue_throttle(). Already has a cfs_rq_throttled() check. - set_next_task_fair(). Peter shuffled the whole set/put task thing recently but last I looked it seemed all sane. I'll try to make sense of it, but have also Cc'd Paul since unlike me he actually knows this stuff.