Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4238859imm; Mon, 30 Jul 2018 10:57:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfsKQbwPWCK1kM8QmHxu4ZhTsaaNpAQITEwFaKhRcgIxpwbyEMKtQT5zNhGIVJB7uyk1Abz X-Received: by 2002:a62:954:: with SMTP id e81-v6mr18845867pfd.231.1532973432304; Mon, 30 Jul 2018 10:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532973432; cv=none; d=google.com; s=arc-20160816; b=TdgqGLJIs4of297JJQSeGXOz+LZOOGd40Le7GO+FTaMCtQXQR1g9O4Kn6Pupz/5KYn l/TRQMi5/uUM7Nb1zZIF6GSjPNgSN78AXl+YGNoqT+oC0qCjX8m25/D2j8PkdlqUk9pv mG5QobG8rGjCdYUbHo77CHc5skFf9DSlTKhljhRxrYx2C1RYR48pzVbAkKUoLK3bOE97 VHxzFtAKzvq6jTVU+LdATQGpNMpl+GyN0lrl48EENXm+IdJl/OQD22RcKgEq6Q959pkV TgVgnhsFtonCiPMJCOEYuag0xE/2lVGlJOMCxVh9Zfj74G218tOQZuzm3EcTAOR7NxkR A07A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=b7d67Tes5ANTchJAKNecVThmz21zo9dp8quKByoKjpk=; b=DO1UmRnCqHkcIP+wJuTfUOZSiY5boHnF5cfaKW0K0FBsP29N/Pz2lP0p/ejJfpvhmD LWvHzI2xNYksRXQiYMXwy3EBom/yqfOK5Kvg0mqW7BUvjvomhmDUZ34+E8ih+wzog/5/ 15VdLRl55LX7c479B/k5BXpzUIiyTbebQLX/NdnJeORq4dWPWiZy0WSA8vfGlhGBONzp TD2EKNuYSXqWLHQ/UUhdDUfz7kN7alJFKOMSueOQL7q9f8fPCsc4hNIYVfjjcxHXA3mR a2ETKHUHL6/jxYOfaTo/M+jPtd5syFjGjE/lUSnsDcKgv0j4OasM65KHlIB4ModJVgkt r9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i3pt5Ca2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18-v6si11110781pgi.249.2018.07.30.10.56.58; Mon, 30 Jul 2018 10:57:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i3pt5Ca2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732076AbeG3Tb2 (ORCPT + 99 others); Mon, 30 Jul 2018 15:31:28 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35779 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731958AbeG3Tb1 (ORCPT ); Mon, 30 Jul 2018 15:31:27 -0400 Received: by mail-pl0-f68.google.com with SMTP id w3-v6so5890206plq.2 for ; Mon, 30 Jul 2018 10:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b7d67Tes5ANTchJAKNecVThmz21zo9dp8quKByoKjpk=; b=i3pt5Ca2jTh6wPdKnGNBRX+H1G+ZsYRhoDGCQowT2cH1h4CqunKwm+m8HgfHe+H+ww JuXKIcgz5uwCFVCCBN0I3k1K9x8xVxNK0DwhCPOcwVlqycZZ25i41il+706HYegjJ5Y2 jEJNCYUGwS+xeqbmgo4FsEt2x5IEUWz7k3WygG/8p2zQLToFrKnUzd90DiGZ1uph5jvZ GPaNrD5zfBEBGcmiykjQwx+HPhTE5lOZR5PveaKp8kksjaqWqFjSsPqoG2kWnlKZCZRW uSExOdrbM4J5thC5SXaB8KbjBXts8Wgo2b7Yoknv5GJK2a8cNMiM7dTD/aSJacUEIxbn ZEzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b7d67Tes5ANTchJAKNecVThmz21zo9dp8quKByoKjpk=; b=TPLMSEQDTDRQVuEsGgx6xZbOtJP2aXCwkMAuzYmAfGk4kAIFPtp0x0LEjgA4Ne9x9m Ig2vdM6YxuN2MALbegFSva7DPiewxphbsFhoYEyoW4zl6T7WFU57OSg3K6fQ+2egIdYc QPiR4LVCzVgo2iQ0lCbUFCO1P4DadwpbdhS72F3yqRs/Esq2rffSTSPWLgWsp7BafGLN QjvGfblOAOb9EHxPLf0WvIHA6RdigRpnx/+0RKw2ozFDpn/vWJFyzaxKrKJyHCF2KkBW stottQ8UMD5SEOU68s5SbCrSh1fhWbMyy0iPOZoOFmUp7OjSD3TrTyQMn301PiyZsM9w FsHw== X-Gm-Message-State: AOUpUlEQC9KUr1AkNdzGOr3aLlaas13mKKj24WDGdJ76xHBENm0WW9HP 7Vjt/YeVMc5c1ozPKhKP+6uxMAG+/DsEy/XqBrU= X-Received: by 2002:a17:902:1001:: with SMTP id b1-v6mr9012514pla.155.1532973320733; Mon, 30 Jul 2018 10:55:20 -0700 (PDT) MIME-Version: 1.0 References: <20180728002409.5781-1-xiyou.wangcong@gmail.com> In-Reply-To: From: Cong Wang Date: Mon, 30 Jul 2018 10:55:09 -0700 Message-ID: Subject: Re: [PATCH] sched/fair: sync expires_seq in distribute_cfs_runtime() To: Xunlei Pang Cc: LKML , Ben Segall , Linus Torvalds , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 29, 2018 at 10:29 PM Xunlei Pang wrote: > > Hi Cong, > > On 7/28/18 8:24 AM, Cong Wang wrote: > > Each time we sync cfs_rq->runtime_expires with cfs_b->runtime_expires, > > we should sync its ->expires_seq too. However it is missing > > for distribute_cfs_runtime(), especially the slack timer call path. > > I don't think it's a problem, as expires_seq will get synced in > assign_cfs_rq_runtime(). Sure, but there is a small window during which they are not synced. Why do you want to wait until the next assign_cfs_rq_runtime() when you already know runtime_expires is synced? Also, expire_cfs_rq_runtime() is called before assign_cfs_rq_runtime() inside __account_cfs_rq_runtime(), which means the check of cfs_rq->expires_seq is not accurate for unthrottling case if the clock drift happens soon enough?