Received: by 10.223.164.202 with SMTP id h10csp213525wrb; Mon, 13 Nov 2017 05:22:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMY5WrqXtM9yLJ7h36zyojn/p114iZ6WwSZus84SfS4x6bmGILMp8+75BSEdjnzqnsFsHyCi X-Received: by 10.99.124.20 with SMTP id x20mr8719819pgc.419.1510579379879; Mon, 13 Nov 2017 05:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510579379; cv=none; d=google.com; s=arc-20160816; b=w8wFddDPeyXjKa9QD6nJhgjFg/ZU8i1K6QTzlR5UnEa0d0bdrkF9wc5oobRzsXuHgx TZT6j3XbqP5zRqDcqS5h+DNc0bJQKQl1u3dS6dplWjAN1f/x/lCwm8aBMGhY0AovcWFO BKZSdWYhXGyuFp3roz3lb+w9Fhm6GeSWmRXiqF/FChqTVNgOrIsgKDwvLYB0Fdd1e3KL TX+UHOotiFqPxaonpUZvYJP7YTxmLGkZGuB2fPsr1bmM4cdvZhV3NuhncMwSuzr/xKEr PmAVsY1tymfSoEA+3iY1dxhfFMJwr8tagXHbmwwTpNk49jWKI4ex1vClc7CCzxXh2HsP J29Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0EJwVg1GPkQiSGVDjPc1jUqadtF9AmJHjglv5MpkhZk=; b=C2EpAaAI5mK++S4h9usVWdBtDeaQ7tTqgeXW2YA41ays2+tO0UB28VruUMJJU9wQDZ ++fqa1hkUj/idUU1rghOB54Z+L0RmOft5JtLKDBXiDlTITutz8yeTIcWVnF/wIqpbaVU dYpPYbetu4aTHNmcX9OA8X9HlbLIdMJfE/uHifh/8xT9bRZuRJieiW35BgaibXqXuRh2 oaxgCdxzhMI0dBX8154J+Orngr63gXEPVUks4WW9bswwS4+l4RV/TT1KnrScTy6uXDPo qYXvEpTU2p6CB0BzuuSu+7uXgukHppko1zJBRiE7ee8c3Ach9LMvteqQFpOCHGQx9iOg PHjg== ARC-Authentication-Results: i=1; mx.google.com; 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 r7si13531118pgf.713.2017.11.13.05.22.46; Mon, 13 Nov 2017 05:22:59 -0800 (PST) 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; 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 S1754730AbdKMNBu (ORCPT + 95 others); Mon, 13 Nov 2017 08:01:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50308 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754708AbdKMNBp (ORCPT ); Mon, 13 Nov 2017 08:01:45 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2467AAA5; Mon, 13 Nov 2017 13:01:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiko Carstens , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.9 37/87] s390/topology: make "topology=off" parameter work Date: Mon, 13 Nov 2017 13:55:54 +0100 Message-Id: <20171113125618.701991638@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiko Carstens [ Upstream commit 68cc795d1933285705ced6d841ef66c00ce98cbe ] The "topology=off" kernel parameter is supposed to prevent the kernel to use hardware topology information to generate scheduling domains etc. For an unknown reason I implemented this in a very odd way back then: instead of simply clearing the MACHINE_HAS_TOPOLOGY flag within the lowcore I added a second variable which indicated that topology information should not be used. This is more than suboptimal since it partially doesn't work. For the fake NUMA case topology information is still considered and scheduling domains will be created based on this. To fix this and to simplify the code get rid of the extra variable and implement the "topology=off" case like it is done for other features. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/early.c | 12 ++++++++++++ arch/s390/kernel/topology.c | 11 ++--------- 2 files changed, 14 insertions(+), 9 deletions(-) --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -363,6 +363,18 @@ static inline void save_vector_registers #endif } +static int __init topology_setup(char *str) +{ + bool enabled; + int rc; + + rc = kstrtobool(str, &enabled); + if (!rc && !enabled) + S390_lowcore.machine_flags &= ~MACHINE_HAS_TOPOLOGY; + return rc; +} +early_param("topology", topology_setup); + static int __init disable_vector_extension(char *str) { S390_lowcore.machine_flags &= ~MACHINE_FLAG_VX; --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -37,7 +37,6 @@ static void set_topology_timer(void); static void topology_work_fn(struct work_struct *work); static struct sysinfo_15_1_x *tl_info; -static bool topology_enabled = true; static DECLARE_WORK(topology_work, topology_work_fn); /* @@ -56,7 +55,7 @@ static cpumask_t cpu_group_map(struct ma cpumask_t mask; cpumask_copy(&mask, cpumask_of(cpu)); - if (!topology_enabled || !MACHINE_HAS_TOPOLOGY) + if (!MACHINE_HAS_TOPOLOGY) return mask; for (; info; info = info->next) { if (cpumask_test_cpu(cpu, &info->mask)) @@ -71,7 +70,7 @@ static cpumask_t cpu_thread_map(unsigned int i; cpumask_copy(&mask, cpumask_of(cpu)); - if (!topology_enabled || !MACHINE_HAS_TOPOLOGY) + if (!MACHINE_HAS_TOPOLOGY) return mask; cpu -= cpu % (smp_cpu_mtid + 1); for (i = 0; i <= smp_cpu_mtid; i++) @@ -413,12 +412,6 @@ static const struct cpumask *cpu_drawer_ return &per_cpu(cpu_topology, cpu).drawer_mask; } -static int __init early_parse_topology(char *p) -{ - return kstrtobool(p, &topology_enabled); -} -early_param("topology", early_parse_topology); - static struct sched_domain_topology_level s390_topology[] = { { cpu_thread_mask, cpu_smt_flags, SD_INIT_NAME(SMT) }, { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, From 1583928326265362460@xxx Mon Nov 13 05:42:43 +0000 2017 X-GM-THRID: 1583928326265362460 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread