Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1186065imm; Fri, 15 Jun 2018 12:38:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIIdYay47u/eNGBNXuSgZ8bNI7hKi850owMvT3ipybY2fSCSwpYGzTRDlDWTVuwXO0wzz89 X-Received: by 2002:a62:4785:: with SMTP id p5-v6mr3346862pfi.164.1529091530399; Fri, 15 Jun 2018 12:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529091530; cv=none; d=google.com; s=arc-20160816; b=FpNVFyTS1f7JyP/cbfdWWB2Jy3bFprsHFZlauCyx+ouOoVs6le1yWloNvFVwiAkVKa 0f7nyAmA5exfWYf9l2nw88db3jlhVrujKw4LgpBc9tcoylX+wjozWuh6ydgt1L1vzrYO XfLkzL63fvZb/E46aQbEg4KWMhzVM2pEtmyvJR23398EYYpRzNIZAhg+tJAoRmmwwxNY 6eGhNxzFi9tJE5DmhdtjTCSAD1+8ud7VuZ7EJwnZ5GIfRgRJyyFHc6CsPXOEZusOpMGh 6n95zhESb0sQKCPv8oDsrhKMTFuWsBChcILivuhc1aaCqjqaVwqf0CHIqPZdCCZbmKYq Cz7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=LKOCN+61ePC++VieuOTsN5U90hkz5QOBJeQ08o/1DAA=; b=LjUVkw/czRpkQadZUYOoNBKrhsTsGrcCUUcIfyfyqaugaKIdaf80GkPujt8/e+Bvry u34t+czDQSa4jNWYzM7fyKkD94GZ16gvCM2DUDyT3QGdAgBCMznGD+zZG7btMVcHB5tE ND1PmmQstgS7V6CQs260/w0KsUy6Mx7TUGMfv+dyujK0qZIVbspzb/mV8Qt7/zY834Dx mBOsaTEw7dcJyINqc8iTejbexPCQcLThqJQDYvVeMVAa7PvENhIsr1/pjtBuDAFQ/KiR qWWpxTnMhlH/wwwUB/aPW78B97Ooud9my8hXMr/tDyAGpUiz8zrItoMvIfluPidtoY6L 9yzQ== 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 f29-v6si7008550pgn.21.2018.06.15.12.38.35; Fri, 15 Jun 2018 12:38:50 -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 S966117AbeFOTiJ (ORCPT + 99 others); Fri, 15 Jun 2018 15:38:09 -0400 Received: from us.icdsoft.com ([192.252.146.184]:50662 "EHLO us.icdsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965768AbeFOTiI (ORCPT ); Fri, 15 Jun 2018 15:38:08 -0400 Received: (qmail 6326 invoked by uid 1001); 15 Jun 2018 19:38:08 -0000 Received: from unknown (HELO ?94.155.37.249?) (famzah@94.155.37.249) by 192.252.159.165 with ESMTPA; 15 Jun 2018 19:38:08 -0000 Subject: Re: Cgroups "pids" controller does not update "pids.current" count immediately To: Tejun Heo Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <77af3805-e912-2664-f347-e30c0919d0c4@icdsoft.com> <20180614150650.GU1351649@devbig577.frc2.facebook.com> <7860105c-553a-534b-57fc-222d931cb972@icdsoft.com> <20180615154140.GV1351649@devbig577.frc2.facebook.com> <1d635d1d-6152-ecfc-d235-147ff1fe7c95@icdsoft.com> <20180615161647.GW1351649@devbig577.frc2.facebook.com> <6c2c9bfb-3175-b9ec-cf39-c9d4ebf654b2@icdsoft.com> <20180615190724.GX1351649@devbig577.frc2.facebook.com> From: Ivan Zahariev Message-ID: Date: Fri, 15 Jun 2018 22:38:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180615190724.GX1351649@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-bg Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 15.6.2018 г. 22:07 ч., Tejun Heo wrote: > On Fri, Jun 15, 2018 at 08:40:02PM +0300, Ivan Zahariev wrote: >> The lazy pids accounting + modern fast CPUs makes the "pids.current" >> metric practically unusable for resource limiting in our case. For a >> test, when we started and ended one single process very quickly, we >> saw "pids.current" equal up to 185 (while the correct value at all >> time is either 0 or 1). If we want that a "cgroup" can spawn maximum >> 50 processes, we should use some high value like 300 for "pids.max", >> in order to compensate the pids uncharge lag (and this depends on >> the speed of the CPU and how busy the system is). > Yeah, that actually makes a lot of sense. We can't keep everything > synchronous for obvious performance reasons but we definitely can wait > for RCU grace period before failing. Forking might become a bit > slower while pids are draining but shouldn't fail and that shouldn't > incur any performance overhead in normal conditions when pids aren't > constrained. I lack expertise to comment on this. As a system administrator, I can only remind that nowadays machines with 80+ CPU cores are something usual. I don't know how the RCU grace period scales with an increasing number of CPUs. If you develop a patch for this, we can try it in production and give you feedback. Just send me an email notification. Thank you for your time and attention! -- Ivan