Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp274265ybi; Wed, 29 May 2019 21:09:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4ut58WXGhYamdEvy12k18MpUULeF5Vqo6MiZpke3ikoY/mcdoXYu3OE7125HIbnlNzx8x X-Received: by 2002:a17:902:1126:: with SMTP id d35mr1873331pla.82.1559189367562; Wed, 29 May 2019 21:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189367; cv=none; d=google.com; s=arc-20160816; b=GyxTredpEgvfCk3JFslqifCoaTpJsSKcvUh15bntOEp0phfUaZMwRpA4/sSri+nMca cbNmORTWcyevZ8OQ23KzMPNv63Uyo6Y+8k3L1UmFzUlT/1ntZ7W8yohC2vYPgeRMgvUT 7dK0CNGWlsjS+ztkxXlm9IkGfqnpWLgO9FkUTFYuXbFw9XBQffI/c6owP4Zn5O167kgs iRHeL68NpKoF3m4XrOPEeMut0dzypeRnRbzeDs7cDYjHAsUnhTjxvs1v/j/4QvBXNgMh MvRzCE29ENMrY6jO9Lv+sBFqeLpII6nryqV5Cfi1+EMkphaoCqTg0Kt4vbMvQ432fTm0 iNBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DKfYdtx7hzjdFsN/WjJMHTl9b9X6N4tx/s1WWaxF248=; b=KFoj2kSeEyHHFLBZhsMQGF5Acihqt5WPSVg8fKGXoRxYdJrKBC1am5Fmxvd/M0gPjn tUo2z4rNz8NXA+EFRFflsYuiYDwN13mvuefaAwWeTnaqPTAgI862/hsRYpoAmtoLDaJi blp4LFB6A8a50I5j7mxY2AD5kBUBMX2VZcU0rVF0yVxDYip7CcR690RbT0Qc64Yc9Ods qyxQ9kN0mjgz7FNRC5AgI91hcQnSCZGPYwFgAELJe0A1u5I93eG9cBwaT/uH5KT+8UTR xzP8AkHe1J4jnd+nJ4vLBBOKJEugw5+V8BuCK1iR/rvZN5277f13P15yXo1oxBS0gsWy nydQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YaYxx+dY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si2297097pgo.595.2019.05.29.21.09.10; Wed, 29 May 2019 21:09:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YaYxx+dY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbfE3EGt (ORCPT + 99 others); Thu, 30 May 2019 00:06:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:47328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731156AbfE3DRd (ORCPT ); Wed, 29 May 2019 23:17:33 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B89DF24688; Thu, 30 May 2019 03:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186252; bh=NOkrN0lKYEPfSj/JDM6nhXqGNqiCL8qB7RMWBbBhFIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YaYxx+dYf1d9wnTFa82JKGG/XtxYWP/aSBDakP1gDHaNPwxAiT/L3OG1NesdjlGhB FG0by7Q4au/TM4bcDzXael/wsuVhFZOkd9PctoiJO/JziW4ZfpF5dLFqACm6wwNL30 Mq1bBsv1B1iZqhUFUoRFLuqici3/lJH6PJ3AePVQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 131/276] powerpc/numa: improve control of topology updates Date: Wed, 29 May 2019 20:04:49 -0700 Message-Id: <20190530030533.967434621@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2d4d9b308f8f8dec68f6dbbff18c68ec7c6bd26f ] When booted with "topology_updates=no", or when "off" is written to /proc/powerpc/topology_updates, NUMA reassignments are inhibited for PRRN and VPHN events. However, migration and suspend unconditionally re-enable reassignments via start_topology_update(). This is incoherent. Check the topology_updates_enabled flag in start/stop_topology_update() so that callers of those APIs need not be aware of whether reassignments are enabled. This allows the administrative decision on reassignments to remain in force across migrations and suspensions. Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/mm/numa.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 10fb43efef508..f473c05e96497 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1495,6 +1495,9 @@ int start_topology_update(void) { int rc = 0; + if (!topology_updates_enabled) + return 0; + if (firmware_has_feature(FW_FEATURE_PRRN)) { if (!prrn_enabled) { prrn_enabled = 1; @@ -1524,6 +1527,9 @@ int stop_topology_update(void) { int rc = 0; + if (!topology_updates_enabled) + return 0; + if (prrn_enabled) { prrn_enabled = 0; #ifdef CONFIG_SMP @@ -1579,11 +1585,13 @@ static ssize_t topology_write(struct file *file, const char __user *buf, kbuf[read_len] = '\0'; - if (!strncmp(kbuf, "on", 2)) + if (!strncmp(kbuf, "on", 2)) { + topology_updates_enabled = true; start_topology_update(); - else if (!strncmp(kbuf, "off", 3)) + } else if (!strncmp(kbuf, "off", 3)) { stop_topology_update(); - else + topology_updates_enabled = false; + } else return -EINVAL; return count; @@ -1598,9 +1606,7 @@ static const struct file_operations topology_ops = { static int topology_update_init(void) { - /* Do not poll for changes if disabled at boot */ - if (topology_updates_enabled) - start_topology_update(); + start_topology_update(); if (vphn_enabled) topology_schedule_update(); -- 2.20.1