Received: by 10.213.65.68 with SMTP id h4csp382790imn; Fri, 6 Apr 2018 01:43:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+rlgCbai/KXEtXpRX+TJgwK75R81rhdithlUIgRIHXFc1znYd47Vihq9IGauLJaQAtxOHy X-Received: by 10.101.100.89 with SMTP id s25mr16680742pgv.401.1523004222530; Fri, 06 Apr 2018 01:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523004222; cv=none; d=google.com; s=arc-20160816; b=hxMYtTj0RY9P6d79SR5Snx9J0WSSqVUCYFHP742jk8d/8J1hPOGx7Aj4qLCkfC+AsF Z0l+Bpc/Oy4ND2UtJflWkd+yiiPG3P4OR/bHg/VnXrcfnN8l8yu3hnXzsiy5SBKsj5K2 3xhKDYUAtBHX+Y6DskaULIz3tt49urH+IhCo/bKw0RakOb/3VRYMAmK9VK+ZqZcAYWBn /dJzlwIR8ir770AiIPLpLzNojTr1V4GeZLZG1ke9CyBcbSZH87RaTetj7lpB0yYl97sl 8CSSxncitQr3/8WweY4g8nvg1sZUvv/kxVxcWTgXolo3cAqVCfNQIKDUf79kWtlJmqbZ 9cRA== 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=tvhAdqixp+FOOEUlDw3y9gW1iV9q1gbd08HYQmi58Hc=; b=VcsIz4j+Yi9yj7iHK/LluzAUASkUO3vI8D2XkapNRplQ9/JWsToZdNtq44M2EHAo6N QJlQ6hw1craZ3CZqO+136A5wv7HBODRRkYDLgBm9Q8tebZ5WycU32I4H/AmlwaUv30Xx RUNfFYVuWxxIe9kN4FA7z4GEJL4bTVqsCx0ckVOoLWegsbbe30gcJ9bok5W87i2r/eSD d0bWXfjdiKvggO9/0DDOyCDVW5TxYCGbvo4tEwCyRonSYISSlg2xxjVxcOsZgCQZaX4m pr+Btg/JqcnrQYFJq5CujMFSgB2kWtdv14zBHSo+rgcKKlSDomo3YVglD1y3wuuVbOz1 scdg== 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 q2si6638975pgp.815.2018.04.06.01.43.28; Fri, 06 Apr 2018 01:43:42 -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 S1751623AbeDFImT (ORCPT + 99 others); Fri, 6 Apr 2018 04:42:19 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:32579 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751312AbeDFImR (ORCPT ); Fri, 6 Apr 2018 04:42:17 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38644329" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 06 Apr 2018 16:42:15 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 93A394D0EFF5; Fri, 6 Apr 2018 16:42:15 +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; Fri, 6 Apr 2018 16:42:16 +0800 Subject: Re: [PATCH] genirq: only scan the present CPUs To: Peter Zijlstra , Thomas Gleixner CC: Li RongQing , LKML References: <1522647902-11426-1-git-send-email-lirongqing@baidu.com> <20180403112311.GF4043@hirez.programming.kicks-ass.net> From: Dou Liyang Message-ID: Date: Fri, 6 Apr 2018 16:42:14 +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: <20180403112311.GF4043@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="gbk"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 93A394D0EFF5.A9F89 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 Thomas, Peter, At 04/03/2018 07:23 PM, Peter Zijlstra wrote: > On Tue, Apr 03, 2018 at 12:25:56PM +0200, Thomas Gleixner wrote: >> On Mon, 2 Apr 2018, Li RongQing wrote: >> >>> lots of application will read /proc/stat, like ps and vmstat, but we >>> find the reading time are spreading on Purley platform which has lots >>> of possible CPUs and interrupt. >>> >>> To reduce the reading time, only scan the present CPUs, not all possible >>> CPUs, which speeds the reading of /proc/stat 20 times on Purley platform >>> which has 56 present CPUs, and 224 possible CPUs >> >> Why is BIOS/ACPI telling the kernel that there are 224 possible CPUs unless >> it supports physical CPU hotplug. > > BIOS is crap, news at 11. I've got boxes like that too. Use > possible_cpu=$nr if you're bothered by it -- it's what I do. > Yes, I think so. it is a manual way to reset the number. For this situation, I am investigating to restrict the number of possible CPUs automatically, But, due to the limitation of ACPI subsystem, I can do it _before_ setup_percpu_area where the number will be used. But, I can provider an indicator to tell the system that whether the physical CPU hotplug is support or not later. Can we use this indicator like that in this situation: if ture Using for_each_possible_cpu(cpu) else Using for_each_present_cpu(cpu) Thanks, dou > >