Received: by 10.192.165.148 with SMTP id m20csp114146imm; Thu, 19 Apr 2018 14:07:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ciWFyUem/ZswStICgQicliq2p0c6jGPj2cXBQlOgTmdirsQmkS5sDnvBJcxbaYWuIZxyV X-Received: by 10.98.192.220 with SMTP id g89mr3516748pfk.223.1524172025770; Thu, 19 Apr 2018 14:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524172025; cv=none; d=google.com; s=arc-20160816; b=zrT8L6FLlUz0SQ+1+mmEfW/DYRalpbrOh8+XEb0OGyt3D/nd2b7sVmMqOyMVG/slOb r2ZIJRZAl5hWlDxX8pS97rRCsNrFUgWUJm00ITsVgRGzEmUimNlSfcZpYAkzuwUdoqIx zcH91VrI21HllGfGaoHY9x73p/fuEbW1uI5b2OZ4QLvg0GUvEd3t7uD3rxKt1cEmAY2b eFLOPuE3hyW5SLNIy5ExD1cgKeCyCyDcOgcWs0AoNTo3iuQVaBN3TU9ESXl0i6eL4JN4 +Gd7FxqgCjxm4xsSCciAgmGBc7pTZCXVipDBcRNfgq4rpzBCvp1cSqcNAzBIefI3M+x6 URdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=2DvX7OJDghJRUUHRw6rVXnM2GywP6TqVT2QpunWdR4E=; b=rfgTEfOIUS/Y13U5SeA3S9eYYexU9sb1xPck2cJmlPZsFwHLS5+SK+RvH+O1M8OM3j DNpeoM6X0+svB3UGyDPIjdIRLAkYzYW2m3zGql9kZk5Tr6EEPRKOd79aee0/AKekk0/q Oft1Is1bAJE5JNB/wnRN/onArpsSORgziG8l8HJhYEVEczwGHxtsTwdMvwpl1K541pDV jFwdp5oJM8bF8/GHx6985E8o6RyG0Y4n8cr6HHuheCdVBwAbNxH6BQGF3AXjXDS5V1bL 5LJA/0/hW7JkFBuqLefWWz0KR6bRLCEAC7Nw8ea5F++klecnhmacEjaGBnjOTNAFWdbT rQDg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h32-v6si3802161pld.170.2018.04.19.14.06.47; Thu, 19 Apr 2018 14:07:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbeDSVFZ (ORCPT + 99 others); Thu, 19 Apr 2018 17:05:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752153AbeDSVFY (ORCPT ); Thu, 19 Apr 2018 17:05:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0687BF95CC; Thu, 19 Apr 2018 21:05:24 +0000 (UTC) Received: from llong.remote.csb (ovpn-126-106.rdu2.redhat.com [10.10.126.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA03C9457E; Thu, 19 Apr 2018 21:05:23 +0000 (UTC) Subject: Re: [PATCH] proc/stat: Separate out individual irq counts into /proc/stat_irqs To: Alexey Dobriyan Cc: linux-kernel@vger.kernel.org, rdunlap@infradead.org, akpm@linux-foundation.org References: <20180419190846.GE2066@avx2> <1c3b9cf3-3a36-568f-3da2-e560a721f4aa@redhat.com> <20180419195504.GA4343@avx2> <20180419203949.GA4555@avx2> From: Waiman Long Organization: Red Hat Message-ID: <053d4061-6bf8-a772-aa3b-f5791fa75fab@redhat.com> Date: Thu, 19 Apr 2018 17:05:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180419203949.GA4555@avx2> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Apr 2018 21:05:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Apr 2018 21:05:24 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19/2018 04:39 PM, Alexey Dobriyan wrote: >> >> Yes, that can probably help. >> >> This is the data from the problematic skylake server: >> >> model name : Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz >> 56 sosreport-carevalo.02076935-20180413085327/proc/stat >> Interrupts: 5370 >> Interrupts without "0" entries: 1011 >> >> There are still quite a large number of non-zero entries, though. >> >>> Or maintain array of registered irqs and iterate over them only. >> Right, we can allocate a bitmap of used irqs to do that. >> >>> I have another idea. >>> >>> perf record shows mutex_lock/mutex_unlock at the top. >>> Most of them are irq mutex not seqfile mutex as there are many more >>> interrupts than reads. Take it once. >>> >> How many cpus are in your test system? In that skylake server, it was >> the per-cpu summing operation of the irq counts that was consuming most >> of the time for reading /proc/stat. I think we can certainly try to >> optimize the lock taking. > It's 16x(NR_IRQS: 4352, nr_irqs: 960, preallocated irqs: 16) > Given that irq registering is rare operation, maintaining sorted array > of irq should be the best option. > BTW, the skylake server is 2-socket 24-core 48-thread. Cheers, Longman