Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1564717rwl; Wed, 5 Apr 2023 20:18:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZyNP+01hZx3qFq7Ay6EWwfHNPVmq8hLvLc/0b4c83yHUMuEaqY/n3Rx2sV7/FcMeaJyb64 X-Received: by 2002:a05:6a20:b282:b0:da:39a5:6e66 with SMTP id ei2-20020a056a20b28200b000da39a56e66mr1610491pzb.18.1680751106320; Wed, 05 Apr 2023 20:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680751106; cv=none; d=google.com; s=arc-20160816; b=FRs5aC+1OB2fRGbVZuYnqIFtwHJpgyZcQHXDIG5LoYRoXQOIjt8jaPwmFVt5462LW/ 8OYtKkak0qcQ6NCHMhpkZZz2YqbHoFcm9zCSosIv2jRbwc+B1nii4I4nce6Y+F4CDLG/ Ny5/E9nPlk+o/j7BbX6Vnf7q6KRa6JZJXUsv5VMBxYwwD8cTvv5wWZISUYZ9hkozmgn/ C3gKFEhC/GICs36dxvvC6BVhvR3xvpOU35Q0viX7gk1hdO2/5iFrk+W5xc18JDBjTRyE QaDSG66YdBmZqPAWB6/sNnwlZSySfEQ6EtH50uLIIWVKpn1Nvjlp3omRfHkooRue/3nw r/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=I6yh5TVA4X0pNlhI29hqbF1nPgXkZ+EttVkjMKTBPRM=; b=URpgVPbONtFYKAP/60LIX3+IGd8Vuftv0x3dcI+9R/fe0IFgfz22rrBGASFwUH6wWz OQLt4hsDIBmZ7+GjUTsrucu05MoXQ0e3CQcJ9v4BQPPx9zu+Vob9OQkpSfepMNHqN1+T Xw4ZxmWcdaQHcEYs5W8JmVsWx2PUGDQQ37k9Mt/7rJQt8frvfEDwYVAr6xOTH8T+tR5T ku7M7j8bftABy/fwh0jtE8RiUpCNEuuuXyiLP8mPRJSo6BQ9s3rBL5q65MisRfq3Td7a IqKwhohLBrte613j/oCp/PxiDG13wiVasrCvhaRzAZiLlSyXO+bTKMAVK8QglQVHRLs0 xQYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="H/G3HG3/"; 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=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a630a53000000b004fbb6a09b99si197777pgk.341.2023.04.05.20.18.09; Wed, 05 Apr 2023 20:18:26 -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=@bytedance.com header.s=google header.b="H/G3HG3/"; 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=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232797AbjDFDGh (ORCPT + 99 others); Wed, 5 Apr 2023 23:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235288AbjDFDEt (ORCPT ); Wed, 5 Apr 2023 23:04:49 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9E593E6 for ; Wed, 5 Apr 2023 20:04:47 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id q102so36015074pjq.3 for ; Wed, 05 Apr 2023 20:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1680750287; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=I6yh5TVA4X0pNlhI29hqbF1nPgXkZ+EttVkjMKTBPRM=; b=H/G3HG3/REfnaZRUDzKbPBsB6d2/809SMnmKvLg15G3GN0Ij5mz2N8PBDS/CJiWpPJ 89wOAYBeD7KnaF+3S0NNJHXNaZPDrnHv4r/zIcEaf//rUurbeUMP3hBr7EIEhFezKuTO eDl2NQJSyX/tddla5wTvSkFaz6vgr6MZo60gPnUC73rNWoXKer0HW3RX0YjZDarngYnt iyk9A5SkZK8nobOFokMCZuqnaZc0RhUlL1lMQIeA7dALyNL/bM4rrYekQbhx0Uqf5R46 N/0wSvk+f68cZPPJ20bvxGlqhXh2gfWGw1vH9b/aUblowF5EbS9a+XLy4QyakngwOuRO zJIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680750287; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I6yh5TVA4X0pNlhI29hqbF1nPgXkZ+EttVkjMKTBPRM=; b=Wp9tacIGK9zmcPD7IvM0z4RG5+mwF7ihmDyA5nc4lPpKLeoHUZZPGuGFEkNfLxuSLw IM4DEBBG11Neydylc4TGWAsLht0fE/Co1remMoPk84qePWfUkGKa4A4LvgreWhxhcFZ0 8A1H5fmpEGTVomP5QvwXycEemqAhD9/MrAKuj5cboFoag762xTRXcQ85RHksAPKOJ2NB titpJ5YAPqPTFyuPuJvPW7U5Y59Lg03B8fthfIh8wVV0EQbKVbgNZxxopsaP9w2HERbb h5fqa4zwnAJcbWMq+LL097C3S9e7ZBrqLxOeaG5EqzGvaGPDtq8AxMhCh1rtEwQ+v5qW VDDQ== X-Gm-Message-State: AAQBX9dMfS5HXQxhPkuVBgXIucTK5t3hJVipiXn7k83GDTLdCOe6XOcv IPtNq1ORYSwRjkp1Z/pa2BH80Q== X-Received: by 2002:a17:90b:1649:b0:23f:dd27:169e with SMTP id il9-20020a17090b164900b0023fdd27169emr9247636pjb.17.1680750287283; Wed, 05 Apr 2023 20:04:47 -0700 (PDT) Received: from [10.2.117.253] ([61.213.176.13]) by smtp.gmail.com with ESMTPSA id c10-20020a17090abf0a00b00240015b837fsm4891739pjs.2.2023.04.05.20.04.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Apr 2023 20:04:46 -0700 (PDT) Message-ID: <88d1fd6b-f98e-c682-5e94-4725a9055f0c@bytedance.com> Date: Thu, 6 Apr 2023 11:04:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Re: [PATCH v2] mm: oom: introduce cpuset oom Content-Language: en-US To: Waiman Long , Michal Hocko Cc: rientjes@google.com, linux-kernel@vger.kernel.org, Zefan Li , cgroups@vger.kernel.org, rientjes@google.com, linux-kernel@vger.kernel.org, Waiman Long , Zefan Li , cgroups@vger.kernel.org References: <20230404115509.14299-1-ligang.bdlg@bytedance.com> <342c1967-8a68-275c-042e-765d5993157c@redhat.com> From: Gang Li In-Reply-To: <342c1967-8a68-275c-042e-765d5993157c@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 2023/4/4 22:31, Michal Hocko wrote: > [CC cpuset people] > > > This should go into more details about the usecase, testing and ideally > also spend couple of words about how CONSTRAINT_CPUSET is actually > implemented because this is not really immediately obvious. An example > of before/after behavior would have been really nice as well. > > You should also go into much more details about how oom victims are > actually evaluated. > > As this is a userspace visible change it should also be documented > somewhere in Documentation. > > I am not really familiar with cpusets internals so I cannot really judge > cpuset_cgroup_scan_tasks implementation. > > 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 > 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. > On 2023/4/5 01:24, Waiman Long wrote: > > You will also need to take cpuset_rwsem to make sure that cpusets are > stable. BTW, the cpuset_cgroup_scan_tasks() name is kind of redundant. I > will suggest you just name it as cpuset_scan_tasks(). Please also add a > doctext comment about its purpose and how it should be used. Thank you all. I will make the following changes and send v3. 1. Provide more details about the use case, testing, and implementation of CONSTRAINT_CPUSET, including an example of before/after behavior. 2. Provide more details about how OOM victims are evaluated. 3. Document the userspace visible change in Documentation. 4. Add an option /proc/sys/vm/oom_in_cpuset for cpuset oom. 5. Rename cpuset_cgroup_scan_tasks() to cpuset_scan_tasks() and add a doctext comment about its purpose and how it should be used. 6. Take cpuset_rwsem to ensure that cpusets are stable.