Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp674382pxh; Tue, 9 Nov 2021 17:16:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNQQ/Bmehwd3eWV+vIETuPCyf2VqsQ2wwz3MqjGjYjsSviWuZYTpzanCBghLjeZ+oexIIk X-Received: by 2002:a05:6e02:18ce:: with SMTP id s14mr8374808ilu.142.1636507018641; Tue, 09 Nov 2021 17:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636507018; cv=none; d=google.com; s=arc-20160816; b=Yvq7kPBHMqyACIdZe7mDLKrl4WMNFBlAXl2b8JxCrqi/SF7DCoO2JgR5UgtOMQVktH TPRjNha3/DTLjaLQScmdLcWwmrtjqY7giCuqyL3OgeIDd0RWI117KwPtf+ZjvVyXtxWx iv6TKG3xwWOztezRwpk8mzhsUcTfclHBnbmWQ4KYKU2B/HRLMk6ha8QVJIBcih5IhpQa 8d5eTpd3rl/4ECaobVgRSzMOfp7x03vF9wswy+ioO4IkLrCGUE17dtUsjSjLIXaZuKLs m7O6U1sMqMPvRUYuCTOLu8EwCvuy6FMtptaCnaSl6QjssEPaemHQLkztR5Jgf8gWHWgI Ox8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=kR89D7ZrZQRdZQaPTOGekyWIy76pSZM8sfCYDY4AP7s=; b=M97MrlvsptI0Vyrgo4ONcyz5o+WBaW0ZLAUA4n7oPuqniHZOTVmyFmCJR3ZOFF+rOA RSb5yZg8URQnjLwPostxR4t8yRVW5Zki0mGmUTQcJ83T6vQB+nZJZR7myI2jI9hFHOBL SYjhsL6i3X2unDeeRrvw5munpP0W+iioyhZHyL/BxcxYwKMnTwkeD+EA6C4RGkz6ZEuf y0eKoxIsvxqyhdJRPpZk3q8Bqk2SU+ZaV2Adsdm/CqmWzzk01DNUlD2lCFSY256EQ8aX rWqf+gVpYLHZA+yX21lmCqqJ+Y5QtnQ4w+dk28nFr0DlsLoo5ugOq++PH3JlYnUkpqoS ux7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dJBhGZiV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si39311246ili.128.2021.11.09.17.16.46; Tue, 09 Nov 2021 17:16:58 -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=@suse.de header.s=susede2_rsa header.b=dJBhGZiV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239237AbhKIMPQ (ORCPT + 97 others); Tue, 9 Nov 2021 07:15:16 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:51854 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236245AbhKIMPQ (ORCPT ); Tue, 9 Nov 2021 07:15:16 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id F17EB1FD58; Tue, 9 Nov 2021 12:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1636459948; 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=kR89D7ZrZQRdZQaPTOGekyWIy76pSZM8sfCYDY4AP7s=; b=dJBhGZiVxcndU7kGad1tFglxyaE9whOIVSc5X4oSrKlgOFFqOE8mGMBQgHzkOJH7wBcddz 8iFfQsHvBwkYx887ZytRBcYa/G0UGd0IY/ZcVQZUek3CrOajxxJiz3pASZPUxg8ySK4oFq FLSm/ktLYjHn3RimRRc0aqOp5vvC4MI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1636459948; 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=kR89D7ZrZQRdZQaPTOGekyWIy76pSZM8sfCYDY4AP7s=; b=ZJxTwqsUWeGgSPBJlLfPpOlFsFFFGLeTRB7UpANTCWi3uFlO1xyMya1qJhleEoiN/9peS1 ckc1oKaIjvOrv/Cg== Received: from suse.de (mgorman.tcp.ovpn2.nue.suse.de [10.163.32.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 99194A3B87; Tue, 9 Nov 2021 12:12:27 +0000 (UTC) Date: Tue, 9 Nov 2021 12:12:22 +0000 From: Mel Gorman To: Gang Li 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 Subject: Re: Re: Re: Re: [PATCH v1] sched/numa: add per-process numa_balancing Message-ID: <20211109121222.GX3891@suse.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <7de25e1b-e548-b8b5-dda5-6a2e001f3c1a@bytedance.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 09, 2021 at 06:40:43PM +0800, Gang Li wrote: > On 11/9/21 5:19 PM, Mel Gorman wrote: > > On Tue, Nov 09, 2021 at 04:28:28PM +0800, Gang Li wrote: > > > If the global tuning affects default behaviour and the prctl > > > affects specific behaviour. Then when prctl specifies > > > numa_balancing for a process, there is no way for the > > > global tuning to affect that process. > > > > While I think it's very likely that the common case will be to disable > > NUMA balancing for specific processes, > > prctl(PR_NUMA_BALANCING,PR_SET_NUMA_BALANCING,1) should still be > > meaningful. > > > > I'm still a bit confused. > > If we really want to enable/disable numa_balancing for all processes, but > some of them override the global numa_balancing using prctl, what should we > do? > > Do we iterate through these processes to enable/disable them individually? > 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. -- Mel Gorman SUSE Labs