Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4659646rwb; Tue, 6 Sep 2022 10:32:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4GgfOa2/qBvhSQepOcqSECWnnfEesmcGqhUXhXedMkakkHShO/TiL4ausMt6YB5Myop7Sq X-Received: by 2002:a17:907:7208:b0:73d:7097:ac6f with SMTP id dr8-20020a170907720800b0073d7097ac6fmr41777486ejc.388.1662485541794; Tue, 06 Sep 2022 10:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662485541; cv=none; d=google.com; s=arc-20160816; b=oOUrlxWHpuv1zjf2gL1dNv2CWEYnq06ikZXk+LB0MauFk336HL5mlEAffWzUiXtyq1 xT+tGLS7/a97y0y/ZX91RIoHI51weab/kAGWAvccGFQnSK+95IJJaLrftA4jHtVsodox 5xTzuVGr1F/+F1L1MzaZwqTvZIg7Aj2gdq96pBMRVVo7vawedTqwBO2AOec+fBVsoliX pkcPxD0jANkx3bOeTdxwVyr9OIfK1X0YWG4bYKI4Y8uQTOhRtOSOpwIiJGg5/G/w71Bg 79tQjvFsl8/Gab58nutrdpnNnbqWezCKOHYKfwEGu3Dda0NfHC75xi9yc6aKi/KUjaaX eFLw== 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:sender:dkim-signature; bh=DLlnc6RmTg0BKq5WkTFW6Fs5pUb+s+A4h9B4fzKjhrI=; b=ovlGKk1OtVKkdooBv78LpfyJGLAkyKThLHpSEnnz9AjbSPuQHP7S/WxD/uSSWgMe54 fhAXdJM8co0QmgawI+sxlq2+EdqotueSDReJNpzbM2lfweq0YhzayenmC/lf/8qf147m XuWOQ0giSn+pMMK85dVc5L5Qm/dgsssuhlRrToShFy+HYnYlzfTb5UalaD7oyjzC/rWL RIanETCI83fTOxddCVgCwlOZckRjtKlvDTlXTAbTbXV6bIniMf+ikujieLefT8zhq5Iu BW9s/si8tIAIX4A4JTdQ9wi18A1cmGtYwGL1ZSQ7dpe0rQ78wRCE3EcxjbJfTrxt30AC Y93g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=csTIT6mI; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg42-20020a170907972a00b00741a1c5bf3dsi8388295ejc.1008.2022.09.06.10.31.56; Tue, 06 Sep 2022 10:32:21 -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=@gmail.com header.s=20210112 header.b=csTIT6mI; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234525AbiIFR2P (ORCPT + 99 others); Tue, 6 Sep 2022 13:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238408AbiIFR14 (ORCPT ); Tue, 6 Sep 2022 13:27:56 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D791EE2A; Tue, 6 Sep 2022 10:19:23 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id q15so12023000pfn.11; Tue, 06 Sep 2022 10:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date; bh=DLlnc6RmTg0BKq5WkTFW6Fs5pUb+s+A4h9B4fzKjhrI=; b=csTIT6mI2KzzjqaY8cqY1Odnetkmo9YoZgm1ta/V1CfQXFGHrNl5ID11UWr9EwdqWT ybdIbatthK94dyrnSRNDRzDCley5Yk5BpAeFv0jlVOckHWFPIroZTDp8BT8QYEWrvkct BA4eS1H6rJQxAfoCXt7ExiwOLg+VBwXu131zL1best+97Y5E8nYjpo+rR0a96WS+Wzv7 MjQLtS57kFrjmK6AclQeajykuyehhqAxxl6b2xCpvmumWgksYXgKSp//v3sHRcowshtU cRIDx7lZIZpbAiQjffFScK2mWcqYWBLsFSVHgLV9dxsr6wqBZCCZBcPK/KMRw6ofIq1L 5hEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date; bh=DLlnc6RmTg0BKq5WkTFW6Fs5pUb+s+A4h9B4fzKjhrI=; b=K+qVBmSeBKdclKp7xCaE7r7J8Qa1BCNLmu2b3VS+lAZoC+83N475YPiL5YrJBqvcSk 9jMP5cbXgf8FGHKrhNMJO/uZzagJRDxI9/M+z6VHlxZD+VcS10rQwFIgoPz4N9EJ2ukZ drR8PyYZqmZMNaSbtpLZizK9YhIUAoXzU87FELe2aQpQ1jU5VJ5ak5MXIcXjaqf580y0 eRL37oses8f9Ysoi3mXpgs+6surs4RVc8wi5CpRJg1Z7+kIh/HHgwlMfleVxW4nV/0jj k0Lt2ItpbkqrltDplh+6ZHbT3WK7alxgho65/5XEOAK/MsrhM6Aj/Wjt765XJ317y25B u6mg== X-Gm-Message-State: ACgBeo2zk29F/NlPSrUXp10P/HMzR6CJqKGlhyMijsL1z9tPWAcknDkW EfJoJsQLLuB76/WhHkH7VpsCJsha8h8= X-Received: by 2002:aa7:8b52:0:b0:537:c6c7:3ef4 with SMTP id i18-20020aa78b52000000b00537c6c73ef4mr54402894pfd.48.1662484763130; Tue, 06 Sep 2022 10:19:23 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id v28-20020aa799dc000000b0053651308a1csm10539462pfi.195.2022.09.06.10.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 10:19:22 -0700 (PDT) Sender: Tejun Heo Date: Tue, 6 Sep 2022 07:19:21 -1000 From: Tejun Heo To: Zhongkun He Cc: lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Phishing Risk] [External] Re: [PATCH] cgroup/cpuset: Add a new isolated mems.policy type. Message-ID: References: <20220902063303.1057-1-hezhongkun.hzk@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, On Mon, Sep 05, 2022 at 06:30:38PM +0800, Zhongkun He wrote: > We usually use numactl to set the memory policy, but it cannot be changed > dynamically. In addition, the mempolicy of cpuset can provide a more > convenient interface for management and control panel. But you can write a better tool easily in userspace to do whatever you wanna do, right? If you're worried about racing against forks, you can freeze the cgroup, iterate all pids applying whatever new policy and then unfreeze. We can probably improve the freezer interface so that multiple users don't conflict with each other but that shouldn't be too difficult to do and is gonna be useful generically. I don't see much point in adding something which can be almost trivially implemented in userspace as a built-in kernel feature. > Sorry,I don't quite understand the meaning of "don't enforce anything > resource related". Does it mean mempolicy, such as "prefer:2" must specify > node? Or "cpuset.mems.policy" need to specify a default value? > (cpuset.mems.policy does not require a default value.) In that there's no real resource being distributed hierarchically like cpu cycles or memory capacities. All it's doing is changing attributes for a group of processes, which can be done from userspace all the same. Thanks. -- tejun