Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp915422rwd; Tue, 13 Jun 2023 02:03:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OuaKykmXEYsPDx1uwD84h4skt486nw+CFiz3/sRII/FSfL8iv3Qgk49NXR/eCTTT6+dEb X-Received: by 2002:a17:907:6e10:b0:974:5ce6:f9ff with SMTP id sd16-20020a1709076e1000b009745ce6f9ffmr13441965ejc.32.1686647004997; Tue, 13 Jun 2023 02:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686647004; cv=none; d=google.com; s=arc-20160816; b=ssqdcGF8k37RhO0Ay2jE3KJFlyJDoCK3PanBj3gYRcVGqYYqv+ilxbjg1c/JNUHnxK 2to2jzpQuecUF3FixBxxBHyx5fZqyCJ7OL0lhoM7lvO9ZeS4ty184N/AKeJxnFkklZNb 8XbelUAHM2mJzIk+TW+ofbmRyq5r2TRkRo5d17sVtg83nbfk4TePLALouCK1/bkR3Mc2 zIb5ioA+ysG5OO1utUYYxh4GAx3F3hMoVowQjxVqdPZsj2v4l+awxJp9r07S6loyHPXB PzaHcGZZsqf1eadQcLudToT66GVQjfey1VlFWjwjcn+roStlwXomfAX/J9E/rJ0ESfiH XG9A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6nUGC14+7CBrEZi0pZlxIb9RwE6G35ofltIgPALxQpU=; b=cE85m0FYSWjlmtjc5S55KWTGpMMrA68a0lzWL22z25TKcouMog0z3M+cumze0+BM4r mujo3lPWl+qrGcvkpJPCkEJ/mz3DeHXAG6IVsSQQj0dM+TJBrV5awuNAtLZHLCwOLWEI nYADHGgzNv9iJZX2BA68M/+7R9f3t0yxCI5o+NSvV7sH/BmQgQX1T9tVT4zUgbhDwfOb J5q5CFYFsO8DeWqsybt1yGrB4RujLWuDkYcQIv4640owJKGV8ep/d3MzVhAHm3vyMDFz lkL0Ww5eRyeD2nW0GDFZXP977UmbZxsjrfZVAGOrK5ODjE/gNMPf/KQItQZDkg8ekBKU lMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=AvTOTVSV; 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 n22-20020a17090695d600b0097462abf3e5si6109406ejy.465.2023.06.13.02.03.00; Tue, 13 Jun 2023 02:03:24 -0700 (PDT) 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=AvTOTVSV; 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 S241193AbjFMI1g (ORCPT + 99 others); Tue, 13 Jun 2023 04:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbjFMI1f (ORCPT ); Tue, 13 Jun 2023 04:27:35 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC09BC9; Tue, 13 Jun 2023 01:27:33 -0700 (PDT) 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 923F31FD80; Tue, 13 Jun 2023 08:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686644852; 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=6nUGC14+7CBrEZi0pZlxIb9RwE6G35ofltIgPALxQpU=; b=AvTOTVSVYVd8ee7Kx3UT6ua7VKmK3BO63CfBLXP9P/NNd2GCnkFP7DCouBzWUgF+Re9T5D L9ERmrpkcMrCveWeQFYtfZyWwGKRIjc/oS2aEt3SIBgfA2D/M/FXI8OD41n4eZXivEZ0R4 VwVmBbZupyQ5A0phG1gvCTbkXDbPVkE= 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 80C5E13483; Tue, 13 Jun 2023 08:27:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PuVeH3QoiGRqMwAAMHmgww (envelope-from ); Tue, 13 Jun 2023 08:27:32 +0000 Date: Tue, 13 Jun 2023 10:27:32 +0200 From: Michal Hocko To: Yosry Ahmed Cc: =?utf-8?B?56iL5Z6y5rab?= Chengkaitao Cheng , "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: <66F9BB37-3BE1-4B0F-8DE1-97085AF4BED2@didiglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Sun 04-06-23 01:25:42, Yosry Ahmed wrote: [...] > There has been a parallel discussion in the cover letter thread of v4 > [1]. To summarize, at Google, we have been using OOM scores to > describe different job priorities in a more explicit way -- regardless > of memory usage. It is strictly priority-based OOM killing. Ties are > broken based on memory usage. > > We understand that something like memory.oom.protect has an advantage > in the sense that you can skip killing a process if you know that it > won't free enough memory anyway, but for an environment where multiple > jobs of different priorities are running, we find it crucial to be > able to define strict ordering. Some jobs are simply more important > than others, regardless of their memory usage. I do remember that discussion. I am not a great fan of simple priority based interfaces TBH. It sounds as an easy interface but it hits complications as soon as you try to define a proper/sensible hierarchical semantic. I can see how they might work on leaf memcgs with statically assigned priorities but that sounds like a very narrow usecase IMHO. I do not think we can effort a plethora of different OOM selection algorithms implemented in the kernel. Therefore we should really consider a control interface to be as much extensible and in line with the existing interfaces as much as possible. That is why I am really open to the oom protection concept which fits reasonably well to the reclaim protection scheme. After all oom killer is just a very aggressive method of the memory reclaim. On the other hand I can see a need to customizable OOM victim selection functionality. We've been through that discussion on several other occasions and the best thing we could come up with was to allow to plug BPF into the victim selection process and allow to bypass the system default method. No code has ever materialized from those discussions though. Maybe this is the time to revive that idea again? > It would be great if we can arrive at an interface that serves this > use case as well. > > Thanks! > > [1]https://lore.kernel.org/linux-mm/CAJD7tkaQdSTDX0Q7zvvYrA3Y4TcvLdWKnN3yc8VpfWRpUjcYBw@mail.gmail.com/ -- Michal Hocko SUSE Labs