Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D25EC7618B for ; Wed, 15 Mar 2023 13:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232336AbjCONgN (ORCPT ); Wed, 15 Mar 2023 09:36:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbjCONgK (ORCPT ); Wed, 15 Mar 2023 09:36:10 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 63F3C97B4B for ; Wed, 15 Mar 2023 06:35:59 -0700 (PDT) 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 D335B2F4; Wed, 15 Mar 2023 06:36:42 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 430583F8C6; Wed, 15 Mar 2023 06:35:57 -0700 (PDT) Message-ID: Date: Wed, 15 Mar 2023 14:35:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2] sched/fair: sanitize vruntime of entity being migrated Content-Language: en-US To: Vincent Guittot Cc: Peter Zijlstra , Zhang Qiao , linux-kernel@vger.kernel.org, mingo@redhat.com, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, rkagan@amazon.de References: <20230309142825.GB273121@hirez.programming.kicks-ass.net> <02a08042-e7c4-464d-bc20-9ec4ccdab1ff@arm.com> <8c093661-7431-00d8-d703-b8f7a7c8e747@arm.com> <20230314120726.GG1845660@hirez.programming.kicks-ass.net> <20230314171607.GN2017917@hirez.programming.kicks-ass.net> <5527ad0e-0f6d-fb4c-7505-a1c80192ed3b@arm.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/2023 11:21, Vincent Guittot wrote: > On Wed, 15 Mar 2023 at 11:15, Dietmar Eggemann wrote: >> >> On 15/03/2023 09:42, Vincent Guittot wrote: >>> On Wed, 15 Mar 2023 at 08:18, Vincent Guittot >>> wrote: >>>> >>>> On Tue, 14 Mar 2023 at 18:16, Peter Zijlstra wrote: >>>>> >>>>> On Tue, Mar 14, 2023 at 02:24:37PM +0100, Vincent Guittot wrote: >>>>> [...] >> Isn't there an issue with this approach on asymmetric CPU capacity systems? >> >> We do a sync_entity_load_avg() in select_task_rq_fair() >> (find_energy_efficient_cpu() for EAS and select_idle_sibling() for CAS) >> to sync cfs_rq and se. > > ah yes, I forgot this point. > That being said, is it a valid problem for EAS based system ? I mean > we are trying to fix a vruntime comparison overflow that can happen > with a very long sleeping task (around 200 days) while only a very low > weight entity is always running during those 200 days. True. Definitively very unlikely. But it's not only EAS, any asymmetric CPU capacity wakeup wouldn't have this check in this case. This dependency between sync_entity_load_avg() and the overflow detection would be very hard to spot though (in case sync_entity_load_avg() would get introduced in more common wakeup paths later).