Received: by 10.213.65.68 with SMTP id h4csp745135imn; Tue, 13 Mar 2018 21:12:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELss+kj5ZAEGtnG5ZrQlIIFmx8IOGvqUh9TB5yQjvx3gxipWcZnpatHo4bsrqii3JBwhsAo4 X-Received: by 10.98.226.16 with SMTP id a16mr2869267pfi.157.1521000764790; Tue, 13 Mar 2018 21:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521000764; cv=none; d=google.com; s=arc-20160816; b=hQLhFoF0uvdqE6M84U7bA2I5ZBPAp24jWtFvNUAKyLnwnqmgk18JrNpreLuEN0VWWw rAXb0xBcLBZfuSpPnssEunARHnfJW+y+a4JVXysxH6slHSTQv8AiuMGkEn39vuVJ8C72 DKlOrvpYk6BSvM2AGF2ndIs6tqi/70mkRxkBDK8vwG3xvMR+5gssF+fP0c9ZM+I12Kbk zz/ZJErk23+/ehDyWX2Um1yJCGymRuJqavrTcNEy/vXnhlB9zAelUpjKbtoEHpQkGtJl gcJGUTNB4mnIooWyztWwPWSRaEvxwwi8qE+kn0/8s46WraVIUMS+qO7IHaJygi8vokmq 3MHg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=e9YwUiKET1CySUyCcg0HmGPweeU7wlWTaQ2JTso9Vl8=; b=TXt/DjXW5pw8KGvfIdGZRsI90eIqxiIwGA54d3W/Fl61EL7Q32ryv+Rr3XngmDaA4N leE0Y/vax/YR1fRC6HXqi0TkRTfSiyfnp1NZDnTKvYjaYbJMoY15ceQCH58/7taJ5J8a gsKSHQS+r3s84y235YBBuhc2uvI4PxBcTrR/lkA1PQ2+ZPbTjhsM51yLSvB+HPiWx0xI Hffb9XqFXmtb0KjdFRGHAfFDdtcm7fM8ghloD3T1mmdYz91nUZTccZfUNR+nfyt0wU4O 0O95jBd8jLXrtjW7eo8OxnIFdDZEtrJ9SXpve8oq22LuQW30ZTREZzWRMXva8U9loU24 fQRw== 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 s13si1323429pfm.392.2018.03.13.21.12.30; Tue, 13 Mar 2018 21:12:44 -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; 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 S1751414AbeCNELg (ORCPT + 99 others); Wed, 14 Mar 2018 00:11:36 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:34784 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750818AbeCNELe (ORCPT ); Wed, 14 Mar 2018 00:11:34 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37807004" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 14 Mar 2018 12:11:31 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id CAD00400281A; Wed, 14 Mar 2018 12:11:30 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 14 Mar 2018 12:11:29 +0800 Subject: Re: [PATCH V3 0/4] genirq/affinity: irq vector spread among online CPUs as far as possible To: "Rafael J. Wysocki" , Artem Bityutskiy CC: Ming Lei , Thomas Gleixner , Jens Axboe , Christoph Hellwig , Linux Kernel Mailing List , , Laurence Oberman References: <20180308105358.1506-1-ming.lei@redhat.com> <1520515113.20980.31.camel@gmail.com> <20180308133440.GA2713@ming.t460p> <20180309012458.GD5228@ming.t460p> <20180309120833.GB30257@ming.t460p> <5e5f3852-5314-c479-245e-d0a575e533a5@cn.fujitsu.com> <1520926721.20980.210.camel@gmail.com> <20180313083535.GA21612@ming.t460p> <1520930375.20980.213.camel@gmail.com> From: Dou Liyang Message-ID: Date: Wed, 14 Mar 2018 12:11:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: CAD00400281A.A8D57 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Artem, At 03/14/2018 11:29 AM, Dou Liyang wrote: > Hi All, > > At 03/13/2018 05:35 PM, Rafael J. Wysocki wrote: >> On Tue, Mar 13, 2018 at 9:39 AM, Artem Bityutskiy >> wrote: >>> On Tue, 2018-03-13 at 16:35 +0800, Ming Lei wrote: >>>> Then looks this issue need to fix by making possible CPU count >>>> accurate >>>> because there are other resources allocated according to >>>> num_possible_cpus(), >>>> such as percpu variables. >>> >>> Short term the regression should be fixed. It is already v4.16-rc6, we >>> have little time left. >> >> Right. >> >>> Longer term, yeah, I agree. Kernel's notion of possible CPU count >>> should be realistic. >> > > I did a patch for that, Artem, could you help me to test it. > I didn't consider the nr_cpu_ids before. please ignore the old patch and try the following RFC patch. Thanks dou --------------------------->8------------------------------------- diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 449d86d39965..96d568408515 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -671,6 +671,23 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, } +static void __init acpi_refill_possible_map(void) +{ + unsigned int cpu, nr = 0; + + if (nr_cpu_ids <= nr_unique_ids) + return; + + for_each_possible_cpu(cpu) { + if (nr >= nr_unique_ids) + set_cpu_possible(cpu, false); + nr++; + } + + nr_cpu_ids = nr_unique_ids; + pr_info("Allowing %d possible CPUs\n", nr_cpu_ids); +} + static void __init acpi_processor_check_duplicates(void) { /* check the correctness for all processors in ACPI namespace */ @@ -680,6 +697,9 @@ static void __init acpi_processor_check_duplicates(void) NULL, NULL, NULL); acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, acpi_processor_ids_walk, NULL, NULL); + + /* make possible CPU count more realistic */ + acpi_refill_possible_map(); } bool acpi_duplicate_processor_id(int proc_id)