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 6D659C54E94 for ; Wed, 25 Jan 2023 19:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235984AbjAYT6J (ORCPT ); Wed, 25 Jan 2023 14:58:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235646AbjAYT6F (ORCPT ); Wed, 25 Jan 2023 14:58:05 -0500 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBBC13C36 for ; Wed, 25 Jan 2023 11:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1674676666; x=1706212666; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to:content-transfer-encoding; bh=dTGhMjxl/MBiucl9G+MvBBfDV9C4XxGVHQBHc71kpcA=; b=PPlrHBaA6a0InPzRBJIdp3dW1In23YwqkQi7WNktaEFZYWFq1HteURxY 0m75AQS1lnQBedwcytdi98xXalxwguq5xyC70bBaluWyDEdfTn70MGPpX /a8F95OPVs42rFeDDPLfEYYKmSwM7uCf51FAoG64anpWk201nqxXLVbj6 8=; X-IronPort-AV: E=Sophos;i="5.97,246,1669075200"; d="scan'208";a="304272292" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2c-m6i4x-b1c0e1d0.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 19:57:20 +0000 Received: from EX13D41EUC003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2c-m6i4x-b1c0e1d0.us-west-2.amazon.com (Postfix) with ESMTPS id C115082031; Wed, 25 Jan 2023 19:57:18 +0000 (UTC) Received: from EX19D033EUC004.ant.amazon.com (10.252.61.133) by EX13D41EUC003.ant.amazon.com (10.43.164.188) with Microsoft SMTP Server (TLS) id 15.0.1497.45; Wed, 25 Jan 2023 19:57:17 +0000 Received: from u40bc5e070a0153.ant.amazon.com (10.43.161.198) by EX19D033EUC004.ant.amazon.com (10.252.61.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.7; Wed, 25 Jan 2023 19:57:12 +0000 Date: Wed, 25 Jan 2023 20:57:07 +0100 From: Roman Kagan To: Zhang Qiao CC: Peter Zijlstra , Waiman Long , Ingo Molnar , Juri Lelli , "Vincent Guittot" , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , "Daniel Bristot de Oliveira" , lkml Subject: Re: [bug-report] possible s64 overflow in max_vruntime() Message-ID: Mail-Followup-To: Roman Kagan , Zhang Qiao , Peter Zijlstra , Waiman Long , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , lkml References: <73e639d5-702b-0d03-16d9-a965b1963ef6@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.43.161.198] X-ClientProxiedBy: EX13D32UWB002.ant.amazon.com (10.43.161.139) To EX19D033EUC004.ant.amazon.com (10.252.61.133) Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gRnJpLCBEZWMgMjMsIDIwMjIgYXQgMDk6NTc6MzNQTSArMDgwMCwgWmhhbmcgUWlhbyB3cm90 ZToKP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