Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp413303pxm; Wed, 2 Mar 2022 18:46:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvRFN6LbEn53kKc63dzMuG3s5Ws0Uuq+ZRlyEh9b5NQ3wK6IWvt5soEhPOW4pmWfoFBewB X-Received: by 2002:a17:90a:300f:b0:1bd:57c8:a7a5 with SMTP id g15-20020a17090a300f00b001bd57c8a7a5mr2899905pjb.31.1646275608787; Wed, 02 Mar 2022 18:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646275608; cv=none; d=google.com; s=arc-20160816; b=brtA2McnVP0oaNda8R3Ia7gt5+Nfn0ylQhNcM0/ZDIm2gE6hsf6SJYhJvxiBfTEf8B iNUPuII/wWw452o5ciDmravjaBD3/k86sin2jo4/jz375zCA7EloZno0YmYhXebCzMho XdugqdLufCFKTN1YoraJGn5r/ozjUDaFrVq2haTicODOsJNejMXv7hQCiFoFSBCbtWi2 srltAo7yCYhXljsc5wqbd4q04sIgN/W1bEqj3Lse7FQOmWzFYyMW+gnpKPyZKejmQb4R PqjQQRfELqnAl6W+l4isdKinekmJ2uawUf4g841Iai5dQrVIwXraO1Z3wdkIYWQHP9o7 IfLg== 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:to:from :references:cc:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=WKpgUKvbgmgS/+XZIYcGoureDOsojTAGGMqwpMVSdx0=; b=i/4uLWM6wFlM8/HFnnyFwAB8tlYh6Ztmm/YZefqoxw+QxmaNUFVkK7tYrMHsKOvMl1 6csrj2+vyMXQta1Tl2/Eeb8bvd0VN1Q8NFfIT6dDYwqeDKK4fn9vZ9cLd1/335+eVYQC 20aqBLZLnNaiDn9ZCIxWAOMZzCqwiRpfRBY0UpoBwWi3dofwHw0nlUnGTGkkZUs6fgsM HrTGRbkPsbTl541VA4JNdu4dDCkNlWGHcy5+xWPxs4FVWBAQ4zCWu9637d/7NfF4l7Uv 0LBYtzOrpNmJ0xf3pCgPwtvs55nnuNQhmpbN5+BHR9dM6O1eQjzPwZV9VVuqQwYlqTmU EJ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=WkDu5aHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 124-20020a630482000000b003746b49e71bsi823082pge.717.2022.03.02.18.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 18:46:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=WkDu5aHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5DEE321810; Wed, 2 Mar 2022 18:41:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbiCCCll (ORCPT + 99 others); Wed, 2 Mar 2022 21:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbiCCClj (ORCPT ); Wed, 2 Mar 2022 21:41:39 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9A76328 for ; Wed, 2 Mar 2022 18:40:55 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id z12-20020a17090ad78c00b001bf022b69d6so2451660pju.2 for ; Wed, 02 Mar 2022 18:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:cc :references:from:to:in-reply-to:content-transfer-encoding; bh=WKpgUKvbgmgS/+XZIYcGoureDOsojTAGGMqwpMVSdx0=; b=WkDu5aHPpmG3JoGrcKXOSVtPyVZqVsnK9TfxUoj9Yj3PEpa6J+V/9fQwamFkioHzpi GfDxjNVajhLweHzfHllvGWROpleV0ERKGRiDG21o9iU9qu1YjprDnWiFRcatw9XQC1rM 7sg4g4v4ucriVtTOi9A7iZ1PpUOhOET1ALx40wMhkt9JLGx1rqA7RfYuNcLxag7aq98/ KcLZKC4flRjOBeebXDCRsK5wGicPYjIg80LIBmi25TK/xcQQqYjtNnSuK6ls/CWInWJ2 a+AM1y8HzMvC5pKjQmwpWGBoprOZm5xBsply77UPufQIJWTVWaNIU4DMAjALn8ot1XPS ShKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:cc:references:from:to:in-reply-to :content-transfer-encoding; bh=WKpgUKvbgmgS/+XZIYcGoureDOsojTAGGMqwpMVSdx0=; b=AVM5J23UdicffnqsXzwOYNfmRTX2Cwt6EWzNTLoGwN4aMDkxeVdXGiTif506Km/1B1 DofPOIw/JxRMpKKQ3WISkfBhS57MFlWL0I+Qre26eq/iKl5cWVHbVppPfbQSntThPSVF L/8tDnoCNtaijkfutW+hkzl/lFrjuucUevQABqQmwN3x567Ihb7bZqe7UzblatjDuwDy BKb/iu88QOMS7QvWki4Cm11BJyf29Z7HMv6CDOdO8Dhksr9ouQjp+EwBCXTxnj/z76UT RmzccRK1FaSdsNwfe1UZJmMbGxqudyLNCNnUCYQki8lU6LlsBRpOpDrOFHH8i1J0oaIf YtYg== X-Gm-Message-State: AOAM53264vMLtN+tpcPRrNgSXf0e8MrAV9AzhvtR/nerwWixcXMMlgXj 89pC6sLhBHIggVBuN7Fu2vP+dA== X-Received: by 2002:a17:902:7fc5:b0:151:863e:44ee with SMTP id t5-20020a1709027fc500b00151863e44eemr10350330plb.163.1646275254888; Wed, 02 Mar 2022 18:40:54 -0800 (PST) Received: from [10.76.43.192] ([61.120.150.76]) by smtp.gmail.com with ESMTPSA id q7-20020a056a0002a700b004f357e3e42fsm546095pfs.36.2022.03.02.18.40.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 18:40:54 -0800 (PST) Message-ID: Date: Thu, 3 Mar 2022 10:40:48 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] sched/numa: add per-process numa_balancing Content-Language: en-US Cc: songmuchun@bytedance.com, zhengqi.arch@bytedance.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org References: <20220224075227.27127-1-ligang.bdlg@bytedance.com> From: Gang Li To: Peter Zijlstra , Mel Gorman In-Reply-To: <20220224075227.27127-1-ligang.bdlg@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,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 Hi Peter Zijlstra, On 2022/1/12 22:43, Peter Zijlstra wrote: >> Set per-process numa balancing: >> prctl(PR_NUMA_BALANCING, PR_SET_NUMAB_DISABLE); //disable >> prctl(PR_NUMA_BALANCING, PR_SET_NUMAB_ENABLE); //enable >> prctl(PR_NUMA_BALANCING, PR_SET_NUMAB_DEFAULT); //follow global > > This seems to imply you can prctl(ENABLE) even if the global is > disabled, IOW sched_numa_balancing is off. I have discussed the semantics of this API with Mel Gorman, we both agree that we can prctl(ENABLE) even if the global is disabled. On 2021/11/10 00:26, Mel Gorman wrote: [1] > For symmetry and consistency of the tuning. Either there is per-process > control or there is not. Right now, there is only the ability to turn > off NUMA balancing via prctl if globally enabled. There is no option to > turn NUMA balancing on for a single task if globally disabled. On 11/18/21 4:58 PM, Mel Gorman wrote: [2] > On Thu, Nov 18, 2021 at 11:26:30AM +0800, Gang Li wrote: >> 3. prctl(PR_NUMA_BALANCING, PR_SET_NUMAB_ENABLE); //enable > > If PR_SET_NUMAB_ENABLE enables numa balancing for a task when > kernel.numa_balancing == 0 instead of returning an error then sure. [1] Link: https://lore.kernel.org/lkml/20211109162647.GY3891@suse.de/ [2] Link: https://lore.kernel.org/lkml/20211118085819.GD3301@suse.de/ -- Thanks Gang Li