From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6237CC77B75 for ; Sun, 7 May 2023 10:12:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7ED046B0075; Sun, 7 May 2023 06:12:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 79CF46B0078; Sun, 7 May 2023 06:12:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B2E16B007B; Sun, 7 May 2023 06:12:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5D04F6B0075 for ; Sun, 7 May 2023 06:12:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1DA76140DF6 for ; Sun, 7 May 2023 10:12:03 +0000 (UTC) X-FDA: 80763043326.04.4F7126F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf12.hostedemail.com (Postfix) with ESMTP id 374F540005 for ; Sun, 7 May 2023 10:12:00 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=FIbi3vnJ; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683454321; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E2IBRhSYCp7770K3WZ9qLNwH/ZcVfrY9C1tieDZlpdg=; b=ejhQABLuphMHh7TXAiXFCwjcyTItNoEwN6Sm2ILEeFFX7TVMmbP1MpxtBe9Ykma8PKuhXv JUxSLkwGR1JKg1F9w+mGh+sb9G/iG5rQRgZ0N9vp6wuovvSvD8rKqSYUeb9ayW+noGGd58 plMOcCTu9NNnNMGTkjbw5XBddEuZkMM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=FIbi3vnJ; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683454321; a=rsa-sha256; cv=none; b=R5o8tav0RgnF/DpG5UEOfnU9oT29RrHIFJ40xYEQSRRlTmK5enxmbjbgw4xapUggWbHHO2 T+xabLy6vPoSB30+4dhJElSFbbLsHWycfJ04YdULa3omebjkYIGl4+RDRgbgpNH3t7o098 48LT4q+HxeelLifj/SPOSE8YNG7pGik= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8EB661F74A; Sun, 7 May 2023 10:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683454319; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E2IBRhSYCp7770K3WZ9qLNwH/ZcVfrY9C1tieDZlpdg=; b=FIbi3vnJWeyisZKQAKPVxxKWxGo2cNOIKsLNgCwvtQ9PD+03S4WGFNTrTeJVW8AyA0ho3C 4qhOKE4ROa0kpIcILETDzKxA6afhoxlER3gNbyxMQyTTYalxOeW0dQ8rZBj0mnF5I5ObNd ZJsiFec8xeevqFYY1Vrw1++ytRBXVaw= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6B8D8139C3; Sun, 7 May 2023 10:11:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vjeYGW95V2R4NAAAMHmgww (envelope-from ); Sun, 07 May 2023 10:11:59 +0000 Date: Sun, 7 May 2023 12:11:58 +0200 From: Michal Hocko To: chengkaitao Cc: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, corbet@lwn.net, roman.gushchin@linux.dev, shakeelb@google.com, akpm@linux-foundation.org, brauner@kernel.org, muchun.song@linux.dev, viro@zeniv.linux.org.uk, zhengqi.arch@bytedance.com, ebiederm@xmission.com, Liam.Howlett@oracle.com, chengzhihao1@huawei.com, pilgrimtao@gmail.com, haolee.swjtu@gmail.com, yuzhao@google.com, willy@infradead.org, vasily.averin@linux.dev, vbabka@suse.cz, surenb@google.com, sfr@canb.auug.org.au, mcgrof@kernel.org, sujiaxun@uniontech.com, feng.tang@intel.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 0/2] memcontrol: support cgroup level OOM protection Message-ID: References: <20230506114948.6862-1-chengkaitao@didiglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230506114948.6862-1-chengkaitao@didiglobal.com> X-Stat-Signature: bhtb348nxtuqek8n6iejydouu1apsare X-Rspam-User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Uf1cVc5333kVNoLzchggNOn03SJ30xFehqJtrhdwTqkZSAAWZktrjFLuSXt1a7gJNe1o1oPpeJo8OpCKqrNvwnudL7PgwRaGIUexCAyJhCN64R6E+fBzuj0Cc77uZzpBoaR+MgzSSjIjPiIwLfqEm8CGTHzQyY+jcN9V5GHKirO77VqhR38Px5+bD2n3Bo3rkRgLA/72+9HdAotedRxlmaptoYGqK6dKQ7d7kZWhE9bVAr9k3pVh2D7/0XjNbbLOyR6HlKQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat 06-05-23 19:49:46, chengkaitao wrote: > Establish a new OOM score algorithm, supports the cgroup level OOM > protection mechanism. When an global/memcg oom event occurs, we treat > all processes in the cgroup as a whole, and OOM killers need to select > the process to kill based on the protection quota of the cgroup Although your patch 1 briefly touches on some advantages of this interface there is a lack of actual usecase. Arguing that oom_score_adj is hard because it needs a parent process is rather weak to be honest. It is just trivial to create a thin wrapper, use systemd to launch important services or simply update the value after the fact. Now oom_score_adj has its own downsides of course (most notably a granularity and a lack of group protection. That being said, make sure you describe your usecase more thoroughly. Please also make sure you describe the intended heuristic of the knob. It is not really clear from the description how this fits hierarchical behavior of cgroups. I would be especially interested in the semantics of non-leaf memcgs protection as they do not have any actual processes to protect. Also there have been concerns mentioned in v2 discussion and it would be really appreciated to summarize how you have dealt with them. Please also note that many people are going to be slow in responding this week because of LSFMM conference (https://events.linuxfoundation.org/lsfmm/) -- Michal Hocko SUSE Labs