Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp274735imm; Mon, 1 Oct 2018 09:43:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV622AmktZfEhUHG4hQXEyUzvT5VwAvMurZlOcfX6JJu+qabyQWdOBxJLB+2EZSB/JdYw7uY4 X-Received: by 2002:a62:b604:: with SMTP id j4-v6mr12249039pff.199.1538412187386; Mon, 01 Oct 2018 09:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538412187; cv=none; d=google.com; s=arc-20160816; b=aEpyGgd9Xa6bvgtjtbu/t7a2ekNOMMoJ5KDree4hELmBVebjiNzJgoDXE30VnGKlW1 Qa8cqgQTZzocSTZs6OZkih358mXjYNJcouteXvd9qsb326/Ma/XFriPBRLAIr65FwKXY MtSIuL2OIXEy6k0/64D3DvjRvVpavXwP5GAZInsLxlvMcRs8MONIrd1xdiTuSozAooMJ UUrDxFeEiPcIfEjMBkHdvGVg/BtpxlB4hgNtQ6R+GONMX7E2eoDFwwkz8QZ4LDfoYXbG v/HRJJcg3Fb0OL0VMSjkt3W2uzEDHw3LRs0H5/NKDdQGCV3mJJ9CSamRXstuRv8jYxoQ tvCQ== 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=EP0D+xKiYmwTMZCIYZJa1cvzQbdjSkNEBgbTXnpOkDQ=; b=w+bfPFzUD+dVIBlajtwa0GjU21oheI9bpP39xEnbke6C0XDLtW9F1EGnXxBPRHAzS1 ET2U68T7HzqL9NdfTNYgcSN+aKf62jMh1Wj83Wkjx13qN9ldW6Tquajep314jowDcxPg u1ucnbtzkLHCwpZri/0CkTVOmnj9eueS3r0uFwbhNeg6pbwKewxgtTv/dcuWTBoXiVuo sBbJFrE7rUN94xF0fxRdviC0S04eZWTfb1Xr1ZyeZkt0NnDqBQVnMb3mBauFgs0eXvXs CPv7NGLG6G4fgco8z6ndQZ1t9Ck4gDjxDBTK/d0V5l95p/6DTPIcoKkV3ZyTnyabFGcX KLgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Tzat2iel; 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 r3-v6si12816106plb.221.2018.10.01.09.42.53; Mon, 01 Oct 2018 09:43:07 -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=Tzat2iel; 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 S1726282AbeJAXVT (ORCPT + 99 others); Mon, 1 Oct 2018 19:21:19 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33606 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725740AbeJAXVS (ORCPT ); Mon, 1 Oct 2018 19:21:18 -0400 Received: by mail-pg1-f196.google.com with SMTP id y18-v6so9885456pge.0 for ; Mon, 01 Oct 2018 09:42:39 -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=EP0D+xKiYmwTMZCIYZJa1cvzQbdjSkNEBgbTXnpOkDQ=; b=Tzat2iel/22ETgOGvxHN40ayowqas6whI2GcF79SC5nNGy2hli6VhX53kNSg5l00p6 IWENyAtscnoAxesc7i3XtfYLboZVfh1uaDHcyLIGPkNVR61pCQ3oR5oqrDaH9PdQA8In PmslhSf5SfJsDsGbAbM1rtpVZJ4pkGmvUWCDswZD6tizL7bIE9/HPEBoYmH/Y+01aj4L SirZIOEvCue4di/jUh1ctkttvYye9iNkRBWhI6Ws18etEpM/qUlczUHssg+xx9RZYGcc hZPBrhQ6ExTaOZxZt8l5ItdU8VNDkO0QbP5NKgz9PGY2Tjh3uoEA6zsOte/cVaGSALn/ UggA== 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=EP0D+xKiYmwTMZCIYZJa1cvzQbdjSkNEBgbTXnpOkDQ=; b=tHo9JTUNziE6W/bct1A5Axr1Td9+Oir9wGVaMRZuZyPkhkFzrHSv6YUSmnhFzIxOAT SfGz+JiuBMgKbip/4P07zEjsMgE8eTTLSXyypAHRiwEKm0HFT3P1YcLbGnf+Ow6G9vAi 1mNU5qW0Gb1DVO4/4FsWA7lDNiI8qTpXV5+oYmX3wjIVq3nZo0XN3OrjAWUhazJovHtf ls+V6pAVx2IdBZ/eb/D8hG/AWQeXbXMzvXHjxZKd1SlxzEhw10ZNEA+f6mQuyg9sZH7j QaFUSJ57CvBqneNqj31dZScrwQDYBfsnil+TXDQeuk2ffh55IMHaoAm2fhVHUBKfxv6f DyMA== X-Gm-Message-State: ABuFfohBkpq6jGLifeE3tJD0khcdVdc0meS9oh4REAAcKrUEieUfiAgf AjMWhQZmZ1NOAQYGeVeElCXBaw== X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr12627684plk.232.1538412159081; Mon, 01 Oct 2018 09:42:39 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a1-v6sm28316459pfc.28.2018.10.01.09.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 09:42:37 -0700 (PDT) Date: Mon, 01 Oct 2018 09:42:37 -0700 (PDT) X-Google-Original-Date: Mon, 01 Oct 2018 09:40:03 PDT (-0700) Subject: Re: [PATCH] RISC-V: Show IPI stats In-Reply-To: CC: Christoph Hellwig , aou@eecs.berkeley.edu, atish.patra@wdc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de From: Palmer Dabbelt To: anup@brainfault.org 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 Fri, 28 Sep 2018 23:09:56 PDT (-0700), anup@brainfault.org wrote: > On Sat, Sep 29, 2018 at 7:15 AM Palmer Dabbelt wrote: >> >> 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. > > If we have irqdomain and irqchip for HLIC then showing timer interrupts > becomes cleaner. My RISCV INTC patch achieves this. > >> >> I'm fine taking this without the timer interrupts, as something is better than >> nothing. > > Sure. > >> >> >> --- 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! > > I will send v3 patch because IPI_CALL_WAKEUP is not going to be available. > > I will base v3 patch upon v5 of Atish's patchset. Atish will take v3 of this > patch and make it part of his v6 patchset so that it will be easy for you > to apply. Thanks!