Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1827365rwl; Thu, 6 Apr 2023 01:35:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bYBUr7mXYbGYR20lXSbL6juKac7MQgacOLoMhMhaQeej8Z4uW8BGd6pOoLmsvHXb0cxKoC X-Received: by 2002:aa7:d78a:0:b0:500:29e3:ce with SMTP id s10-20020aa7d78a000000b0050029e300cemr4803586edq.36.1680770150581; Thu, 06 Apr 2023 01:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680770150; cv=none; d=google.com; s=arc-20160816; b=kNTF9ZQB7imAscbXhHBbZVbnd0c7ZZAXY1CbuWh0Nv2uJpXp4P/x38sALcBPnHaI5N Q+Q9DsHxPD9cAS/Yb2Drz6CZeyo2esGNxVvY5GpwQLhCUOCZ6ywn0IOR7C/CX3JD66eb m7/0T2ZUyLcd7UW6oiuRR3jM+4eN2xJZKUwHcqrdfr965DDM3iS+zAas8EaBFrts2xqB jTBYcwgebVH8aGj/r4PKcnIpdlVWs1KxESPYse2a8LEIFXtc/L9tO9HQA4fsAlaTN3us RT6b59zuSv5l6LgPzubjpV6Chr0RNh0F/76KAS1hxjQdut+ofjH+Tozc9V9GHZLTgwJH YxCg== 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=ZeNqSzG1mQYY7oNWDAYbyb5M/J1jwCKa4/8IkPcpdUM=; b=Cu4sKNCSxU1+U0xmBeWptkvRH3zRMemNA1QSeKy08plNkkVnPJST/hvyRBJCEAJN2F Pw+rCd3iZuZnX67zKuBh2QowyvCsOECdM2Ff2VUp7WoQF4yn6u+Q1kToDH/VJ/O2B6c7 gu7t5Hyw10cc8yA6n0LBn4a0RbsA2HKn9UI5HhO3qCjJ1o7dBVFRDb877SY6iEGb9njf Q4xSTjnnkdspCODluywPlBLD4QcXVZzLpXEs8Y3JDJHS/E58Imq/apdpc/h7nhAJdtB+ YGy4mv77jgPmejU0VnTe6I1Gh2Df0jPcW5ivoND4HBuymHzj4QBnr+eMpmzZMYIkilpk 4pBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=OPlxBigt; 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 m25-20020aa7d359000000b005020d16209bsi724070edr.518.2023.04.06.01.35.26; Thu, 06 Apr 2023 01:35:50 -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=OPlxBigt; 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 S236218AbjDFIal (ORCPT + 99 others); Thu, 6 Apr 2023 04:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235777AbjDFIaj (ORCPT ); Thu, 6 Apr 2023 04:30:39 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E8061A5; Thu, 6 Apr 2023 01:30:34 -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-out1.suse.de (Postfix) with ESMTPS id 612DB22826; Thu, 6 Apr 2023 08:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680769833; 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=ZeNqSzG1mQYY7oNWDAYbyb5M/J1jwCKa4/8IkPcpdUM=; b=OPlxBigt/AdMFlXcx2PJ6WGA+wGmXv+bmQ68bYLrqRs9qPOK7s+aRZanCqFOt6YaJT2TwF 8aA6SU3YOAa/PyBql5sao/cuR4O6pegZ76h3FfogVS0l6vWiB0GDGaniQcocB1/x1ZYhoO 8q88+KVJd6ZS/KTIGWmMGoiZ1jh/TGE= 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 42585133E5; Thu, 6 Apr 2023 08:30:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id d8TuDSmDLmSGZAAAMHmgww (envelope-from ); Thu, 06 Apr 2023 08:30:33 +0000 Date: Thu, 6 Apr 2023 10:30:32 +0200 From: Michal Hocko To: Gang Li Cc: rientjes@google.com, linux-kernel@vger.kernel.org, Waiman Long , Zefan Li , cgroups@vger.kernel.org Subject: Re: Re: [PATCH v2] mm: oom: introduce cpuset oom Message-ID: References: <20230404115509.14299-1-ligang.bdlg@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Thu 06-04-23 11:22:16, Gang Li wrote: > > On 2023/4/4 22:31, Michal Hocko wrote: > > [CC cpuset people] > > > > The oom report should be explicit about this being CPUSET specific oom > > handling so unexpected behavior could be nailed down to this change so I > Yes, the oom message looks like this: > > ``` > [ 65.470256] oom-kill:constraint=CONSTRAINT_CPUSET,nodemask=(null),cpuset=test,mems_allowed=0,global_oom,task_memcg=/user.slice/user-0.slice/session-4.scope,task=memkiller,pid=1968,uid=0 > Apr 4 09:08:53 debian kernel: [ 65.481992] Out of memory: Killed process > 1968 (memkiller) total-vm:2099436kB, anon-rss:1971712kB, file-rss:1024kB, > shmem-rss:0kB, UID:0 pgtables:3904kB oom_score_adj:0 > ``` > > > > do not see a major concern from the oom POV. Nevertheless it would be > > still good to consider whether this should be an opt-in behavior. I > > personally do not see a major problem because most cpuset deployments I > > have seen tend to be well partitioned so the new behavior makes more > > sense. > > > > Since memcgroup oom is mandatory, cpuset oom should preferably be mandatory > as well. But we can still consider adding an option to user. > > How about introduce `/proc/sys/vm/oom_in_cpuset`? As I've said, I do not see any major concern having this behavior implicit, the behavior makes semantic sense and it is also much more likely that the selected oom victim will be a better choice than what we do currently. Especially on properly partitioned systems with large memory consumers in each partition (cpuset). That being said, I would just not add any sysctl at this stage and rather document the decision. If we ever encounter usecase(s) which would regress based on this change we can introcuce the sysctl later. -- Michal Hocko SUSE Labs