Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2213717imm; Thu, 14 Jun 2018 10:28:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIa/PmKlB29FnaaJ8eletV+a5fQ7CdGInomK56BoZMzQoBdiVijDW6SUYVHeORLm8dT7+78 X-Received: by 2002:a62:6e01:: with SMTP id j1-v6mr10407226pfc.93.1528997332006; Thu, 14 Jun 2018 10:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528997331; cv=none; d=google.com; s=arc-20160816; b=hNFB9aeKLsQRH3kTlW3tqPj89Peq8CB7/qU93iwZOGB6G4lPUL/MJ78vwap9SQw6oL OEXR1ic2jDZuxxt6DOfLiWpTR+nbc7gMnQZJYQLPCEAlYx4yoP3ae6XsqCM/jxG2d/jp +7E8Kxf7CAEzjaeZ/TfeCF52bZgoGgIiftBOF1JiCP1SonUox5dFEMuu3vtrco92rNng WQiYquFN0jUI1VgD/Zx0kpNVcwVBhvKZQgvBzt6JbQcO3LTtIqM5jSnjfcV7VChagvR/ Y76ig8tCJHQAYamIBbMl9Mx0VvPBMMqd1hjJasuD38KAbRrpERk8S5/Eg0ImBb0rUKoH t+aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=SMk2Ol/b53ylmz+4iy/W2Jcbh3vXzqhsaZz41yReaQU=; b=MXHqpVhgeDe5DbsPRN1VDIv/yAej6k1MKFvKHkcxYJHkJ1gQOABv0xJYvxDJw2JBoR 5E3H096wba+uFXJBgo4cyK1Ud84M8g3TTY0GjP5Hv2qk6uzm1U0EaOOw98XDT4MqHv5U o+Vn3DeicXcjiG3vVvVLF8rCIqRicud8tPwf8KIc/tWRLZtOfSGniFyXrrfeDjQ9HCdO MTKF3xmCJyAd+9Y5MBFKYHJEcY7JDb3UrMF2BN4VfuRgSmNvndQoQg1vZvMKmtIjRbfQ xkO1XyPDG1Kh7fl3BkPtu3AivZwDCaLyM6mMM6+AvkiEQIqDMHfW9zxDD3GQQUwuTJmf f/9A== 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 b9-v6si5755495pfh.358.2018.06.14.10.28.37; Thu, 14 Jun 2018 10:28:51 -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 S1754791AbeFNR2F (ORCPT + 99 others); Thu, 14 Jun 2018 13:28:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:48688 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754644AbeFNR2E (ORCPT ); Thu, 14 Jun 2018 13:28:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C1BC8AE89; Thu, 14 Jun 2018 17:28:02 +0000 (UTC) Date: Fri, 15 Jun 2018 03:27:57 +1000 From: Aleksa Sarai To: Ivan Zahariev Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Cgroups "pids" controller does not update "pids.current" count immediately Message-ID: <20180614172757.ovu6sbolcgc4cdjr@gordon> References: <77af3805-e912-2664-f347-e30c0919d0c4@icdsoft.com> <20180614172634.ymoik5uov3vzftmp@gordon> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ffjecwbgrtrqriux" Content-Disposition: inline In-Reply-To: <20180614172634.ymoik5uov3vzftmp@gordon> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ffjecwbgrtrqriux Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-15, Aleksa Sarai wrote: > > I've tested this on 4.14.27 and 4.4.0-124-generic Ubuntu. > >=20 > > If I start a couple of processes which exit very quickly (like a simple= Bash > > script with many commands in it), the reported value in "pids.current" = is > > not updated immediately when processes exit. This leads to too many > > processes incorrectly accounted in "pids.current" which hits the "pids.= max" > > prematurely. >=20 > One possible reason for this might be related to zombie processes. > cgroup.procs doesn't include any zombie processes (tasks are removed > when they exit(2)), but the pids controller does track zombies (tasks > are removed when the 'struct task' is put'd). This could explain why > there's a discrepancy which clears itself up after a short period of > time -- though I am not sure that your reproducer will actually produce > zombies (I only took a quick look at it). Scratch that -- it can happen even without zombies. Basically it just depends on when the 'task struct' is freed (which could happen arbitrarily later than the process exit(2)-ed). --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --ffjecwbgrtrqriux Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXzbGxhtUYBJKdfWmnhiqJn3bjbQFAlsipZ0ACgkQnhiqJn3b jbTowg//Q3Bz8gL+xLSPM+qPx5XjzY8pwhJWMvL/dPcXLSDeLyAvNnKJzmNk2yw8 wp7TCm2Prl6IG/lb9VP/HK7Vy/EKDHfTeH72HPUsIpVLaQbSL0+CGEIlYJGBHseo XNj4Db75jFu9VtbJe33m9SnDweIh8W3+e8raqLUz55vbX4oCRMzXBMtH44waKKxN 22vWutgvrhZhWd3CDdAAnJKh1EGIZqeSSui4v/aZ+lFFX49ydMEzwvf1yMAVLTGT RKiWFfpLDvEuPL21nPjVxkIXT2cLA9vb9dNs5xyOtEZtVKHnl6CMJRGx8Htu7VxT mX4+BRqDK059F/uU0PK/GsklvgrDGYCMpf9zZARwJBymm0VuKo+BFbPS/EcZIV41 LsgN2NH0Ksm5g67F/5XfSkuS23zQqVBLn3Sq3YJcM1k8wEUd9UNicQ6O/QXQ2kZM Mga/tlwe5Iyep+dpYT50om655hY1Ya7+v1FXmpxcBxSJ3RPLwQ7UD4E30X4mVKNI o0Ubp2kFRPw4BvVVQxDF1Oat7TeWssbY4szSIF/ATIAtv+yGtCF7E4QEFdFQUE/q 1I7AmO8ui7977s37w5vWThMfFvlpORfsKibVnBx75pXzpXkloNnYFJZuuYBi/WoX I3bCjAvrSXKtTSIlcXUB/hAkoD8fe9W6htUhWck4DoYbc+1cJWE= =iDN8 -----END PGP SIGNATURE----- --ffjecwbgrtrqriux--