Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2705430rwb; Fri, 9 Dec 2022 05:31:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6v/l3wcKUsmmtCLgGczgV5tZxmnoupSnv/KM+GeM6PrSICRSqb0VGxNf59VIYJNtZ2HIsN X-Received: by 2002:a17:906:c096:b0:7bf:1090:ded4 with SMTP id f22-20020a170906c09600b007bf1090ded4mr5062115ejz.49.1670592690326; Fri, 09 Dec 2022 05:31:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670592690; cv=none; d=google.com; s=arc-20160816; b=wGudeH5fU3IZyEJGGnq5pNcuw/qqMq95wloZsWcR01KiaGihLVBh6f7L4Y6gpsPofW 9Alh0hRwrXYHR7qd+3hMxmW3CMrDl4xAH22e8OYs7JGf/vWPQf7NxyqQoLccjHgLn/9Z m63jMQ2q4aE2F7KarwUbPNhF3oPt6pOviZ2oTcBIvD5o2dMi/hPfE4A7McoCjsZj4MQu 4HdCImU5H7UexUjbRvrK28I3yvbUUw4teBSATOt5JJUfB81XZRu3n5OHfbdAr2r9iIPb 8jjdWRcCcvqiK44cpZ3OX1KYJJYiMowJybijE2AFXxmPuS2whCQIsNi43P810TTPoYRi H1/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SceSQ4zWov1ruMmU/Cx4LOSHMhOduLnCnMnnkM+gdgY=; b=0Cw4ZmR8B276Z9ZDv3CsACB/695lbR1vnXAeu/t3+zsgR8h+w+fxzuqGtGMM4G3xG1 54H2jlZleSx7iRSe35Ior11NKb+g9cWrAv1OqdgROPh/Bi4EIf4PyiAMVM4A+mn8HhsK rZ2hXS1gxBodgIc96lPpnC8b0+wpQ7rZGLwSqYlXHr5Wwu34VppkGg0CXFZWHWD/NjqE ftxQdDMYyhI4ZI4TiKdZpyen0TVq1AAuXgIXmra88btKRQ+HmMPYSBMBBmrHEjSsq+1x wvuhi2PsOuJyAccsjx+zsIArQp3q4w9fmcjIBS8hxGPOgetveFmeU2S3gPkq7gCDcYUo XoKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="Y/jTuZgZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a1709067c0f00b007c0a2472f02si926006ejo.626.2022.12.09.05.31.11; Fri, 09 Dec 2022 05:31:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="Y/jTuZgZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbiLIM1U (ORCPT + 76 others); Fri, 9 Dec 2022 07:27:20 -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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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