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 D9443C10F1B for ; Mon, 19 Dec 2022 12:06:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3EA688E0003; Mon, 19 Dec 2022 07:06:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39AF98E0001; Mon, 19 Dec 2022 07:06:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23C3E8E0003; Mon, 19 Dec 2022 07:06:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1398F8E0001 for ; Mon, 19 Dec 2022 07:06:56 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D5A7580490 for ; Mon, 19 Dec 2022 12:06:55 +0000 (UTC) X-FDA: 80258929590.29.925740C Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf21.hostedemail.com (Postfix) with ESMTP id 07D6E1C0019 for ; Mon, 19 Dec 2022 12:06:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=cKH6lPcm; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671451613; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vcYyeovvyeIUt7S0vbCFAC7dHaOjTv+mzzbe5d276WA=; b=4inWssGHy5NpvQBLr4MVlhZBzM2WobmpzgJCiZd7jes9xHOS4k4V6Ftr0YagKoIRtTbM6L cXx3XeL/7PmzgSDdcOLjq75FGr/IGJ4n5hVb6wD8anjkBQkLCmajxHoi9dA9yxh9J3fK3Z Fq9pNtXFxNhyv6rhapEPXket+bH3bN4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=cKH6lPcm; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671451613; a=rsa-sha256; cv=none; b=aGbmDZi/a3sIjowa6AA0rLz3Io5g/VpgPdvp41faTLkaF8LI83eVJdgh//TUXa17KR1KlN lOF7ZKf/3QBx3bGA1+dQPmn0J4mc6kUsliIlyP2h6jjZBK5b8J6u5NUuU0UDTftvDaKAtw l7wgHLt8NvHIWhW7gWHf2YTg4zzWZ/8= 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 753FD607DC; Mon, 19 Dec 2022 12:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1671451611; 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=vcYyeovvyeIUt7S0vbCFAC7dHaOjTv+mzzbe5d276WA=; b=cKH6lPcm6qTERFkgfs95izoDW3LTVijdvzrmfJn690l+1owObw0m+Kz7Y06qsjOaD6EqbN 1nQu1wgzRFe45utSi3lZdgUiSHYfJhsXYSCl4AiM7stbZoFRgU5YJjZf7vof2Pl0jVnVap 3Cb7KuvdLUWZo1lmVQy5c4TDx9dQfMk= 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 6005B13910; Mon, 19 Dec 2022 12:06:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ScRpF9tToGMUbwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 12:06:51 +0000 Date: Mon, 19 Dec 2022 13:06:51 +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: <395B1998-38A9-4A68-96F8-6EDF44686231@didiglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 07D6E1C0019 X-Rspam-User: X-Stat-Signature: f5s5zfmqybysruaf9sny9ntdxx7ksgxh X-HE-Tag: 1671451612-76352 X-HE-Meta: U2FsdGVkX1/AQg/9B/Zj30K9yHbHx99iIBADCV+AhVEkTi/6OPm2wTDp70BdoxeeGgctQXPbFEb/iQuU+tFlAURsSRDn/r7G3tkQepK9959SKw2QdWVdDu/bXYGv4sAMwiUM/htrCLVRZaSsxanx5E7+3f+vZTvEAwTj8wNsC5tMwEIDjJEsfy5wFsCLhBdYi/VGenqG5HPYxvx7cqKVX6ctZQim2ZZDgJF7IB+Rl05+1VhaLdg1yokD5R/rl/cq6M7Ye+0THqHJ2WuQIYRHKAL7aQ2k1Raih7543l2OZpnoPB8m9GOw6Pl8ZdHvCZDFpGbllomUYIGJObFgQdvhko+ZQB0n/X23A/QipmKbfZIWkZziiPygZud+UJ+g2byPLRekXOIY42s0BBXc4a0ZDkYmNmp92baJiyKg8a9zqCO7PKkb+BhSJvgVrAzbEf1oKudR7CZmC2tNJ+VK7gTaMotPOkcbMisYoCbAdkAWR/EICA0EU8IPrFmfKF8yuAmocK6wUp/rOuTuE4S8SJFgl4+ZtUuFwKCI0kY5nbQYtKSobjZSiboiIJ79i6t29C3pe/eKhWhu2Nmiuvzm05k3hzLRaRDV3A1pcD1U36NUVLgidn3FqQ2+3uhKyuXYeDB0FpOgcMdxRZR9cBRmeQQUe28yezI7sDzdyvQqeBehqk5/1scNgjEzp4pMOpvwk2IZi4VHNt0Lyr1k8qbWo7siu5D/2WLddA2Eb2wpb9IYNhQ4pnYrL7CJ2AFmtkkTEE4kxPz3OjkQBlOEJ5zyF1lrt92qR6A4sIUhSh+mt7cd76IxV8AI7ZG/OGVZlxKsNOfDdFiNzONgYMpxASotLsYJY/OhwnvqBcA930yfqnyQd8+kCagYBVgLSozQ5pQHUwNHTTuaL/ew+OxPCY5bEJEfeb7hbor/N6x2c55MwpqwDIccxu8zL7BqI1ov+3NhVPur2YAjuR8oOQEGEr2H78s 7qKmFdSL A4qKp 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 Mon 19-12-22 03:16:33, 程垲涛 Chengkaitao Cheng wrote: > Hi Michal Hocko, > Looking forward to your reply. I am sorry, I do not have anything to add to my previous concerns. But let me summarize. I think your way of mixing per memcg protection with the per-process oom_score is very dubious. This is not an unfixable problem. All you need to do is the discount all processes in the same memcg equally. A bigger problem is, though, that I am not convinced the memory protection based interface is really viable. Based on experiences with the existing reclaim protection interface this is not really trivial interface to use. You either have to have a good overview of the working set size or you have to auto-tune it based on a feedback mechanism (e.g. PSI). Auto-tuning based on oom which should be a rare event is rather problematic I would say. All that being said I am not convinced that the interface is practically usable and you haven't really provided good examples to prove me wrong. -- Michal Hocko SUSE Labs