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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3DB8C10F1B for ; Fri, 9 Dec 2022 12:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbiLIM1V (ORCPT ); Fri, 9 Dec 2022 07:27:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiLIM1S (ORCPT ); Fri, 9 Dec 2022 07:27:18 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4094219C; Fri, 9 Dec 2022 04:27:17 -0800 (PST) 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 2642D1FDD3; Fri, 9 Dec 2022 12:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1670588836; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SceSQ4zWov1ruMmU/Cx4LOSHMhOduLnCnMnnkM+gdgY=; b=Y/jTuZgZkRwDo3u6JvpxWmxiCzQ7i4pV50tHTktLt3Lv9PdTcSOmis4LHFLFclwTIcdd0f kPaux3bQGkvZRGxRDTM/8fMPG716dlC2ra5uhmQXUryrL9B93z2EHqhu0OH/x35juMIVqe 83doSlhUIabdsyiPq/nkMFbIId+D7rA= 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 F01A0138E0; Fri, 9 Dec 2022 12:27:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5mIYOqMpk2NkTQAAMHmgww (envelope-from ); Fri, 09 Dec 2022 12:27:15 +0000 Date: Fri, 9 Dec 2022 13:27:15 +0100 From: Michal Hocko To: =?utf-8?B?56iL5Z6y5rab?= Chengkaitao Cheng Cc: chengkaitao , "tj@kernel.org" , "lizefan.x@bytedance.com" , "hannes@cmpxchg.org" , "corbet@lwn.net" , "roman.gushchin@linux.dev" , "shakeelb@google.com" , "akpm@linux-foundation.org" , "songmuchun@bytedance.com" , "viro@zeniv.linux.org.uk" , "zhengqi.arch@bytedance.com" , "ebiederm@xmission.com" , "Liam.Howlett@oracle.com" , "chengzhihao1@huawei.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 v2] mm: memcontrol: protect the memory in cgroup from being oom killed Message-ID: References: <114DF8F0-3E68-4F2B-8E35-0943EC2F51AE@didiglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 09-12-22 09:25:38, Michal Hocko wrote: > On Fri 09-12-22 05:07:15, 程垲涛 Chengkaitao Cheng wrote: [...] > > Here is a simple example. In a docker container, users can divide all processes > > into two categories (important and normal), and put them in different cgroups. > > One cgroup's oom.protect is set to "max", the other is set to "0". In this way, > > important processes in the container can be protected. > > That is effectivelly oom_score_adj = OOM_SCORE_ADJ_MIN - 1 to all Sorry that should have been OOM_SCORE_ADJ_MIN + 1 -- Michal Hocko SUSE Labs