Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4717410imm; Mon, 18 Jun 2018 21:38:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFeHUNAj7Q8KqWUokfTcL+hDqKQXH2Ah9AshgmRqDcPIjluB7Tc16+WPoFM5S1Gr1gkWFt X-Received: by 2002:a63:7f51:: with SMTP id p17-v6mr13396067pgn.36.1529383121403; Mon, 18 Jun 2018 21:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529383121; cv=none; d=google.com; s=arc-20160816; b=p1XrfakU+cnDoo1Upl6FJ8W9Gz0hxGGm5aoFouZOMg9Z+2pKEwHcVFn7p4X1oWGlFI 4TJMAUJarOMTiyiGqtxU2QpMFiO1Wv1lRfSQWQwHNgnDpuP+wRcOW39ee8Lr5SYpKRs7 R60lrDV8Ccpv5ikOUxHdoKQxdRwwRbcyvx+EVdGQuZcvE97RD6kPtpjMKO01Z1ZjdJ22 v2CdY/mn6yAmGAMFMouX3A/3PV94ywX6EYvnGVW84GJGwBMx5FEwwoXj8jWK0BkDzQKF /or80DTH7YyVxRwvBQ/h43y/x6o1Mb6kcEIEQb99JAP0/T07p2WyG3d+j0f921TRRiT1 jAuA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=iVpZQylV/l4YCrHe7uhcehF0o/upZdwbWIREzqPsPUw=; b=Y0biHnxI+gxofIUQ8S41vJumC/cMHm/RzqoiQgwPfNs+QbFPO+Yub3G9CNkuJdt6XI pAyvNzOKRARGNPZCTcsgMsoQrmC73BRjSWa09LQk6avgsN2QLspOZqVqYnjc0j0zHD8p M8M0E4pDVVXUYddaSCKx/F4Xat9Su4ZkunozJiDi9kYQ0CPW/oC7DystqUu6zHOLPodE pOxk8Rvu5cPzewCnAC5oUxn/0nXZ9vWRf2fmkOfK1z0atM2jhOLEoCNEwy4hd868hxuL Ay8l5hA0If1aKV7LR3+ZIY2zG9dH9q921lU7CYDgQBwGpNGAWxS0WwRsJ0ZxHCcpVUWF DzSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=soG+wHgd; 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 j66-v6si16409280pfc.243.2018.06.18.21.38.27; Mon, 18 Jun 2018 21:38:41 -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=soG+wHgd; 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 S1755532AbeFSEhL (ORCPT + 99 others); Tue, 19 Jun 2018 00:37:11 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33758 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbeFSEhK (ORCPT ); Tue, 19 Jun 2018 00:37:10 -0400 Received: by mail-pf0-f194.google.com with SMTP id b17-v6so9278257pfi.0 for ; Mon, 18 Jun 2018 21:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iVpZQylV/l4YCrHe7uhcehF0o/upZdwbWIREzqPsPUw=; b=soG+wHgdK2fZwx7MwLgjWH0McBjgIGQMsxxemz3Cb81raMqQz+ZdCQe3gegi8iz07t FxMVnExmqVb72Sd8y/ILb86yexF72glGxQMg8tGRPB0eVaX9zEVcFQvHEtCvCnDD776V NXgTQJZ1wCN+2Bt7cnGpNzuzyqqqEHkuKLnMXNjuq8s0XP+GVnrsGVnXAXn0F5Lputul q486RwWIHv0dpE6082rPTex1x6+EQf42zd4L5pW096tTd+E2lUiA77nVpANQvH7aa6Yx 7HIpHf91+QDjNY6Bzj4kYauxHRZOUr0zv0eL5TYWurBqiUWqW90959ZIF9bMWiywr+/9 pegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iVpZQylV/l4YCrHe7uhcehF0o/upZdwbWIREzqPsPUw=; b=km9nGpsZhwd54keOZvMaaor98XqVYtNJ7yGuh45lRUlvRhsNg4/Qxy2tiCAtT/hNKz /UDCE/cT/r0l+7vV4Y6FRraiuIAeNyRdMfMq1qFVB/1c1FDHm6kw6snqPbheH266bh3k 0zFt7ahloII58boSusrnQ9T1Y7OTKzlf4UR+jYdsfibBEtFJDlCOAIYGrY5nCxmjMGBn ok+kBm15aZ55W6SOyBB5XtBcpRYwBApnxF+USthzKFaZPid2sC3yu54CKlI+L4QRis4c LMEQvLQQT7QJ+d9oNIwY41L69d1v1QdFZUhdDiKuSkkw/6FHs3LBI3+b094A3fUOm7nV +L1g== X-Gm-Message-State: APt69E0mFL+SgoBtmax+NkdlZgqxic8qt92ZSetJvxsXSV+5cv4u9lFw JIaNyq4qdk7uKL1rpEcnQjNmceCP3xHL4THw/KM= X-Received: by 2002:a63:62c7:: with SMTP id w190-v6mr13740891pgb.104.1529383029713; Mon, 18 Jun 2018 21:37:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:284f:0:0:0:0 with HTTP; Mon, 18 Jun 2018 21:36:49 -0700 (PDT) In-Reply-To: <20180618091657.21939-1-xlpang@linux.alibaba.com> References: <20180618091657.21939-1-xlpang@linux.alibaba.com> From: Cong Wang Date: Mon, 18 Jun 2018 21:36:49 -0700 Message-ID: Subject: Re: [PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted To: Xunlei Pang Cc: Peter Zijlstra , Ingo Molnar , Ben Segall , LKML 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 Mon, Jun 18, 2018 at 2:16 AM, Xunlei Pang wrote: > I noticed the group frequently got throttled even it consumed > low cpu usage, this caused some jitters on the response time > to some of our business containers enabling cpu quota. > > It's very easy to reproduce: > mkdir /sys/fs/cgroup/cpu/test > cd /sys/fs/cgroup/cpu/test > echo 100000 > cpu.cfs_quota_us > echo $$ > tasks > then repeat: > cat cpu.stat |grep nr_throttled // nr_throttled will increase > > After some analysis, we found that cfs_rq::runtime_remaining will > be cleared by expire_cfs_rq_runtime() due to two equal but stale > "cfs_{b|q}->runtime_expires" after period timer is re-armed. > > The global expiration should be advanced accordingly when the > bandwidth period timer is restarted. > I observed the same problem and already sent some patches: https://lkml.org/lkml/2018/5/22/37 https://lkml.org/lkml/2018/5/22/38 https://lkml.org/lkml/2018/5/22/35