Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp594853pxh; Tue, 9 Nov 2021 15:53:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWRL01kVKHWWVepIZsxUaxAh63Lp5fLdjAf8WpsKdA4IlskFB+5tFoQQoVNTQVrzRlWiqU X-Received: by 2002:a92:d78a:: with SMTP id d10mr8535837iln.108.1636501992319; Tue, 09 Nov 2021 15:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636501992; cv=none; d=google.com; s=arc-20160816; b=K347NAf9Em4i7gi1UchYTWRTIHG4a9ZW02ls95FEYiFeKrz3UowbemPpP6OKz1rnww xzJlSJom9/jNkiE2zQNTPN97P5YvqKt2XMv5HMD93N8ut80DaRvaBGb7ETiTNbsuslxr mCAc7bnIMVSbu6bHDRQHnLaHPLlwQomirhxVDOIp3Nbwt9ju4GrFDcJaS4cktIbpswQc XLOyJZeICPCqOdLmA22dTRALtmhlvPxO4Eoo2IIu/TLoIKpdfvYgdW1PtPGg2UgrfRwj kfxANZOGNgzKnQIv7BAPPv1iP9QClImG8pJK7XS72W2QE9Sd5A5ZmoKx81Eam3F8Zqrw SPkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=Y30tES1mRbobBQ+m/yFfcYggfkhOFouTPN0eCLqdkac=; b=I0EhB5R9yK5mdTTrc5HnPtU8VlnfxDDIl+IahsJ94QqgoympMwDC58aw/e71FpK9hq Zkevsq0WJzrOtsis3hCQUa5zuDU3/uoG9zHqH70f5dp1/SAuYYSkQxTGvFusqOHTM0SL zsURPJ7tX63vCdteYLWHdgUBP6e7AFPQAf1CWQOMf20zZO0Pmx698VMA7agtHHP3Oiu9 BW7raXW0aL1POhgkpU0avYBaUN2ufqKNr1WCuRXykvHr3uRtRUYuUTZ/Zkd6uF/fV9U1 6VxOzqH66PqXqfplhR/SdrmwuM5ZLD2U3c7vnUSrdS2KmAry+qKF9De8421A1jlq6938 /VhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=Uxmdf4zn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si30338546jac.101.2021.11.09.15.53.00; Tue, 09 Nov 2021 15:53:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=Uxmdf4zn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbhKIOB2 (ORCPT + 97 others); Tue, 9 Nov 2021 09:01:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236679AbhKIOB1 (ORCPT ); Tue, 9 Nov 2021 09:01:27 -0500 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 A8E86C061767 for ; Tue, 9 Nov 2021 05:58:41 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id y5so9315805pfb.4 for ; Tue, 09 Nov 2021 05:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Y30tES1mRbobBQ+m/yFfcYggfkhOFouTPN0eCLqdkac=; b=Uxmdf4znCpTXGzwMRB/AMMCqss7/LZk+9jxusKZRrq3r5+Tb+7PwY3/Uz+yuixUuTc a7KF+nrZAsxO0ezbYvMvahzD9nRoKh1K1Y1fhWIYzbjkVQNwkF1Ldmtg7D7xKs02Bx1I +2Qzciv5ZLtEFIgXWj5hLSZStRi/GVrOhKefP5n/45RUXE4BVstirUAKlQSzaIJXE8Mq vOrCFmoZzUJaJnuqw3nYonp0nWKmW4aN55IH3I6CW3GGxxPXkU8syNSvsXMgoAqw69r5 efJwpH4k6IteCT9DfyhNnHVnPdsfftpuObaExxMpZ/URQma3NEkYdYudn92CR7TZgE7B hKqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y30tES1mRbobBQ+m/yFfcYggfkhOFouTPN0eCLqdkac=; b=SOjj57QU6HC2cTkb/Br0ryYBHUXapt8I+kJ6LZT4eUUFEdXTgTdcAbFtqKva7mVUzm Sa1w7Dqf368lHXQbiowXea/AlRH9rxoD8wNOyTtJb/aaLprrAKedGsXu2FHOZAaCK2rs 4q3cDXgyegBk5lLzyTWB4r422U0Rzy1pmUw9dPU9w9r45Tc2OoA/X/3EcQLSA0hcSR2Y E1gNNkyvZunxPNp1R2Y61eeqjIfKPghDjQMqooFfRO9djekp9P3GUBPgvr++VwSWxHgR q3FltRlQZILgaWgKtrRqc25XugTUQrXmDJcpuc7isQIlTxHgCiw6JtRTPyXJjyGhGuCb SJzg== X-Gm-Message-State: AOAM531+cVJjiqRYzCtDBy6s1RW23zVs8Ixpn4il1p7L827WHsO2UIJa 4XlY4v30vkv6SvICvrQxCbGstg== X-Received: by 2002:a63:9042:: with SMTP id a63mr5939760pge.345.1636466321161; Tue, 09 Nov 2021 05:58:41 -0800 (PST) Received: from [10.254.105.98] ([139.177.225.240]) by smtp.gmail.com with ESMTPSA id p3sm18854221pfb.205.2021.11.09.05.58.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 05:58:40 -0800 (PST) From: Gang Li Subject: Re: Re: Re: Re: Re: [PATCH v1] sched/numa: add per-process numa_balancing To: Mel Gorman Cc: Jonathan Corbet , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Daniel Bristot de Oliveira , linux-api@vger.kernel.org, LKML , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org References: <20211027132633.86653-1-ligang.bdlg@bytedance.com> <20211028153028.GP3891@suse.de> <20211029083751.GR3891@suse.de> <20211109091951.GW3891@suse.de> <7de25e1b-e548-b8b5-dda5-6a2e001f3c1a@bytedance.com> <20211109121222.GX3891@suse.de> Message-ID: <117d5b88-b62b-f50b-32ff-1a9fe35b9e2e@bytedance.com> Date: Tue, 9 Nov 2021 21:58:34 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211109121222.GX3891@suse.de> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/21 8:12 PM, Mel Gorman wrote: > > That would be a policy decision on how existing tasks should be tuned > if NUMA balancing is enabled at runtime after being disabled at boot > (or some arbitrary time in the past). Introducing the prctl does mean > that there is a semantic change for the runtime enabling/disabling > of NUMA balancing because previously, enabling global balancing affects > existing tasks and with prctl, it affects only future tasks. It could > be handled in the sysctl to some exist > > 0. Disable for all but prctl specifications > 1. Enable for all tasks unless disabled by prctl > 2. Ignore all existing tasks, enable for future tasks > > While this is more legwork, it makes more sense as an interface than > prctl(PR_NUMA_BALANCING,PR_SET_NUMA_BALANCING,1) failing if global > NUMA balancing is disabled. > Why prctl(PR_NUMA_BALANCING,PR_SET_NUMA_BALANCING,1) must work while global numa_balancing is disabled? No offense, I think that is a bit redundant. And it's complicated to implement. It's hard for me to understand the whole vision of your idea. I'm very sorry. Can you explain your full thoughts more specifically? ---------------------------------------------------- Also in case of misunderstanding, let me re-explain my patch using circuit diagram. Before my patch, there is only one switch to control numa_balancing. ______process1_ ...____/ __|______process2_|__... |______process3_| | global numa_balancing After my patch, we can selectively disable numa_balancing for processes. And global switch has a high priority. __/ __process1_ ...____/ __|__/ __process2_|__... |__/ __process3_| | | global per-process Why global numa_balancing has high priority? There are two reasons: 1. numa_balancing is useful to most processes, so there is no need to consider how to enable numa_balancing for a few processes while disabling it globally. 2. It is easy to implement. The more we think, the more complex the code becomes.