Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1419157imm; Fri, 28 Sep 2018 18:45:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV63S6LIwuhLP2x9QJAjncKlHdhDQSD4JeEUevmEHPZ93gjEw0kPh5gJgqxZEidCJNCtBUIbN X-Received: by 2002:a63:2bc9:: with SMTP id r192-v6mr1096301pgr.386.1538185526538; Fri, 28 Sep 2018 18:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538185526; cv=none; d=google.com; s=arc-20160816; b=Ev/lxcTBQzYS82Nkrb5w1aXlfHL1a+NkvysTuZ/ud96C/XOpPwkXXbPnPd/rVV4acG BCASSv1LoFAAReUBYrnYFk86LHrrekXhs2dWMKmPwvQFs9kSDevffRrw4kw8+kz0CpO6 s3nz+lUGnha7FrYZZ6XIhSlD3Utdw8JRjXjZThBmw1ftoNIHdeEtEu7FzG9uxEshOjFF 144zE9dw02uTB/Ru+cDc/iz2JbsufJyx15jWAAhpxlPzZXTiLJ2++sihUZ9Tf0yeajJ4 /n51aNITWFZHwfonyvRQLMIbaYs2AXuHNhIWgrX+PZURbXBxMyPg3Cj4wri4ZD5xgmtn gzfQ== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=+BUVeW5f7nhpy1dnH/n6Ghv3BNDXkkcNFzAT4AvDmSM=; b=Bw/+otyIXA6qk/X5u6pPVfo5ulSBU29yuCiqfJYfNHylMTiW/tQ5/p8v6kPH64NEDv xMWiKZgauN/9kk3ygr8/I//MHODhBChWeqck7G74oltFuXaHKCR3qPpvZhVYmkiLqQYK SvNLdIMUN2+ynFTCUk2RW0D+FdFJJqSl7PiPH4ylGpeGkrEcM2YM0rw95E8cBTyAezjR KZidhHKFRUpgdfEY2+ljZdOh85LcNhp4wIwwVpBqBCgC3L8rioc/JibWZC5eH6fjj4qj TcD/7xSeTh2YGYtrOo1EXHR//an6EsZuCpCNq3AvuDru+805YdlJWrbzEnj1LlKSH6WN 54Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=eeU2PHF5; 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 q21-v6si6086505plr.397.2018.09.28.18.45.12; Fri, 28 Sep 2018 18:45:26 -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=@sifive.com header.s=google header.b=eeU2PHF5; 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 S1727465AbeI2ILd (ORCPT + 99 others); Sat, 29 Sep 2018 04:11:33 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42769 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeI2ILc (ORCPT ); Sat, 29 Sep 2018 04:11:32 -0400 Received: by mail-pf1-f196.google.com with SMTP id l9-v6so5406895pff.9 for ; Fri, 28 Sep 2018 18:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=+BUVeW5f7nhpy1dnH/n6Ghv3BNDXkkcNFzAT4AvDmSM=; b=eeU2PHF5P3Mqkg+6qSYSOYMyH0psV3IBHwYcVLwjzIQep0esvXuq38jYXcuoUl5xzh rEbL7/aH5LyF941axglEbRVcAJLQ2q9n/7lynGBrynuid2CIc1KmH78FZNBWBhZgFeog zT6oUh4fiJvnQzVxFSIfFeV+9JHef9KihnAlHrOq3VQVigAzZVrCweHqG0kZh8iFs7QR 5rlQOkHFPGNR92phAc6JpvWybeUeCgutfuvQQ7VTdx/XRJKFiexpAO4+R4BI4oWynV0N AEPLAjq84eiVe84PjlBbI2JPDUUWGSto+LQevdTBThYgdLmah2J8GiFfhtsnC0sYcWkZ 9+Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=+BUVeW5f7nhpy1dnH/n6Ghv3BNDXkkcNFzAT4AvDmSM=; b=QGuvszcaNDDQYszav6YcTkI3UTyOit8YzUcbdUKPYogvXflyao+5pqjYsHCODG1XKn CQkUQMS4KV7fqxcWM+7VYfHY6ds41T1Pb4zhiTwwk1h4KuJcX3gUYUkWw6HTcw2obUnF MikVVSP2YuoO8JrR1xgsFjeko06kfz65APTHdhu3CS2yeShUfduGRa7EAUdtWddiJtJb q/5f6CbXV04zRZWTBjCMOdN/B6X7VXXnOJum11SfUXWgQ6gu5DLety1NY8PxgxleCwOU 7WkvDFRLDrYFdXWcHVWwVClKfKPbskP4ZwDzS/Hs8650RBzqFUkNxfVvbijXLwOIrSoB IaMA== X-Gm-Message-State: ABuFfoiGUk9DFhRS5MybZCK89mv3U45A6WMyFOSxd/mVhU0/Mrx9lDWZ iCYlZ+G1OPvHzKU9h9PRnxw1Vg== X-Received: by 2002:a62:6781:: with SMTP id t1-v6mr1165389pfj.200.1538185504701; Fri, 28 Sep 2018 18:45:04 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id h4-v6sm8579471pfe.49.2018.09.28.18.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 18:45:03 -0700 (PDT) Date: Fri, 28 Sep 2018 18:45:03 -0700 (PDT) X-Google-Original-Date: Fri, 28 Sep 2018 17:51:16 PDT (-0700) Subject: Re: [PATCH] RISC-V: Show IPI stats In-Reply-To: <20180910134659.GA30774@infradead.org> CC: anup@brainfault.org, aou@eecs.berkeley.edu, Christoph Hellwig , atish.patra@wdc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de From: Palmer Dabbelt To: Christoph Hellwig Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Sep 2018 06:46:59 PDT (-0700), Christoph Hellwig wrote: > On Fri, Sep 07, 2018 at 06:14:29PM +0530, Anup Patel wrote: >> This patch provides arch_show_interrupts() implementation to >> show IPI stats via /proc/interrupts. >> >> Now the contents of /proc/interrupts" will look like below: >> CPU0 CPU1 CPU2 CPU3 >> 8: 17 7 6 14 SiFive PLIC 8 virtio0 >> 10: 10 10 9 11 SiFive PLIC 10 ttyS0 >> IPI0: 170 673 251 79 Rescheduling interrupts >> IPI1: 1 12 27 1 Function call interrupts >> IPI2: 0 0 0 0 CPU wake-up interrupts >> >> Signed-off-by: Anup Patel > > Thanks, this looks pretty sensible to me. Maybe we want to also show > timer interrupts if we do this? IIRC we used to have some issue where the timer interrupt ID in /proc/interrupts aliased with a possible PLIC interrupt ID, but that was back when we had a big mess of chained interrupt drivers that didn't really talk to each other. I think at some point I might have just removed the timer interrupt from /proc/interrupts as a hack, but now that our interrupt controller mess is sorted out it'd be better to have it. I'm fine taking this without the timer interrupts, as something is better than nothing. >> --- a/arch/riscv/kernel/irq.c >> +++ b/arch/riscv/kernel/irq.c >> @@ -8,6 +8,7 @@ >> #include >> #include >> #include >> +#include >> >> /* >> * Possible interrupt causes: >> @@ -24,6 +25,14 @@ >> */ >> #define INTERRUPT_CAUSE_FLAG (1UL << (__riscv_xlen - 1)) >> >> +int arch_show_interrupts(struct seq_file *p, int prec) >> +{ >> +#ifdef CONFIG_SMP >> + show_ipi_stats(p, prec); >> +#endif >> + return 0; >> +} > > If we don't also add timer stats I'd just move arch_show_interrupts > to smp.c and make it conditional. If we don't this split might make > more sense. Makes sense, but I think timer interrupts are more interesting to see than IPIs so we'll eventually pipe them through. Might just be my workloads, though :) >> +static const char *ipi_names[IPI_MAX] = { >> + [IPI_RESCHEDULE] = "Rescheduling interrupts", >> + [IPI_CALL_FUNC] = "Function call interrupts", >> + [IPI_CALL_WAKEUP] = "CPU wake-up interrupts", >> +}; > > No need for the explicit array size. Also please use a few tabs to > align this nicely: > > static const char *ipi_names[] = { > [IPI_RESCHEDULE] = "Rescheduling interrupts", > [IPI_CALL_FUNC] = "Function call interrupts", > [IPI_CALL_WAKEUP] = "CPU wake-up interrupts", > }; I don't see a v2 of this, was there one? If not then I'll just clean up ipi_names and drop this on for-next. Thanks for the patch!